Skip to content

Commit 9f1012b

Browse files
Merge pull request #77 from Live2D/develop
Update to Cubism 5 SDK for Unity R1
2 parents 0f4be3f + a9b30c1 commit 9f1012b

24 files changed

+328
-264
lines changed

Assets/Live2D/Cubism/CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77

8+
## [5-r.1] - 2024-03-26
9+
10+
### Added
11+
12+
* Add `CubimMath` class in namespace `Live2D.Cubism.Framework.Utils`.
13+
* Add function `ModF()` to compute floating-point remainder in `CubismMath` class.
14+
15+
### Changed
16+
17+
* Change the message to output the latest Moc version supported by the CubismCore when the `.moc3` file fails to load correctly.
18+
* Change the version of the development project to `2021.3.36f1`.
19+
20+
### Deprecated
21+
22+
* The `ToIndex()` and `ReturnTiles()` functions of the `CubismMaskTilePool` class are not used.
23+
24+
### Fixed
25+
26+
* Fix fade calculation bug in MotionFade.
27+
* Fix a bug in which masks were not generated correctly when using multiple render textures and displaying two or more models.
28+
* Fix an issue where normal processing could not be performed when `CubismMaskTilePool.Subdivisions` is less than `1`.
29+
30+
### Removed
31+
32+
* Remove `CubismWebGLPluginProcessor.cs`.
33+
* This change is due to the removal of Cubism Core built with `Emscripten 1.38.48`.
34+
* See `CHANGELOG.md` in Core.
35+
36+
837
## [5-r.1-beta.4] - 2024-01-18
938

1039
### Added
@@ -367,6 +396,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
367396
* Fix issue where Priority value was not reset after playing motion with CubismMotionController.
368397

369398

399+
[5-r.1]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.4...5-r.1
370400
[5-r.1-beta.4]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.3...5-r.1-beta.4
371401
[5-r.1-beta.3]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.2...5-r.1-beta.3
372402
[5-r.1-beta.2]: https://github.com/Live2D/CubismUnityComponents/compare/5-r.1-beta.1...5-r.1-beta.2

Assets/Live2D/Cubism/Core/CubismMoc.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public static CubismMoc CreateFrom(byte[] moc3, bool shouldCheckMocConsistency =
4242
{
4343
if (shouldCheckMocConsistency && !HasMocConsistency(moc3))
4444
{
45-
Debug.LogError("This Moc3 is Invalid. This model generation process is aborted and prefab is not created.");
45+
Debug.LogError("This Moc3 is Invalid. This model generation process is aborted and prefab is not created.\n" +
46+
$"Please check Model's Moc version. This CubismCore supported latest Moc version is `{LatestVersion}`.");
4647
return null;
4748
}
4849

Assets/Live2D/Cubism/Framework/MotionFade/CubismFadeController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,15 @@ public void OnLateUpdate()
176176
}
177177

178178
var playingMotions = _fadeStates[i].GetPlayingMotions();
179-
for (int j = 0; j < playingMotions.Count && playingMotions.Count > 2;)
179+
for (var j = playingMotions.Count - 2; j >= 0; --j)
180180
{
181181
var playingMotion = playingMotions[j];
182182
if (time <= playingMotion.EndTime)
183183
{
184-
j++;
185184
continue;
186185
}
186+
187+
// If fade-in has been completed, delete the motion that has been played back.
187188
_fadeStates[i].StopAnimation(j);
188189
}
189190
}

Assets/Live2D/Cubism/Framework/Utils.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright(c) Live2D Inc. All rights reserved.
3+
*
4+
* Use of this source code is governed by the Live2D Open Software license
5+
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
6+
*/
7+
8+
9+
using UnityEngine;
10+
11+
12+
namespace Live2D.Cubism.Framework.Utils
13+
{
14+
public class CubismMath : MonoBehaviour
15+
{
16+
/// <summary>
17+
/// Returns the remainder of the division of two numbers.
18+
/// If invalid dividend or divisor is passed, it returns <see cref="float.NaN"/>.
19+
/// </summary>
20+
/// <param name="dividend"><see cref="Mathf.Infinity"/>, <see cref="Mathf.NegativeInfinity"/> and <see cref="float.NaN"/> are not allowed.</param>
21+
/// <param name="divisor"><see cref="float.NaN"/> and Zero is not allowed.</param>
22+
/// <returns></returns>
23+
public static float ModF(float dividend, float divisor)
24+
{
25+
if (!float.IsFinite(dividend) || Mathf.Approximately(divisor, 0)
26+
|| float.IsNaN(dividend) || float.IsNaN(divisor))
27+
{
28+
Debug.LogWarning($"Invalid dividend or divisor. divided: {dividend}, divisor: {divisor} Mod() returns 'NaN'.");
29+
return float.NaN;
30+
}
31+
32+
// Calculate the remainder of the division.
33+
return dividend % divisor;
34+
}
35+
}
36+
}

Assets/Live2D/Cubism/Plugins/Editor/CubismWebGLPluginProcessor.cs.meta renamed to Assets/Live2D/Cubism/Framework/Utils/CubismMath.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Live2D/Cubism/NOTICE.ja.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,34 @@
44

55
# お知らせ
66

7-
## [注意事項] Windows 11の対応状況について (2021-12-09)
8-
9-
Windows 11対応につきまして、Windows 11上にて成果物の動作を確認しております。
10-
ただし、Windows 11を利用したビルドにつきましては動作を保証しておりません、ご了承ください。
11-
対応バージョンや時期につきましては今後のリリースをもってお知らせいたします。
12-
137
## [制限事項] Windows ARM64向けの対応状況について (2024-01-18)
148

159
Unity 2023.1以降にて指定可能となったWindows ARM64向けビルドにつきまして、Cubim SDK for Unityは現在対応しておりません。
1610
対応バージョンや時期につきましては今後のリリースをもってお知らせいたします。
1711

1812

13+
## [注意事項] Apple社のPrivacy Manifest Policy対応について
14+
15+
Apple社が対応を必要としているPrivacy Manifest Policyについて、本製品では指定されているAPI及びサードパーティ製品を使用しておりません。
16+
もし本製品で対応が必要と判断した場合、今後のアップデートにて順次対応する予定です。
17+
詳しくはApple社が公開しているドキュメントをご確認ください。
18+
19+
[Privacy updates for App Store submissions](https://developer.apple.com/news/?id=3d8a9yyh)
20+
21+
1922
## [注意事項] macOS Catalina 以降での `.bundle``.dylib` の利用について
2023

2124
macOS Catalina 以降で `.bundle``.dylib` を利用する際、公証の確認のためオンライン環境に接続している必要があります。
2225

2326
詳しくは、Apple社 公式ドキュメントをご確認ください。
2427

2528
* [Apple社 公式ドキュメント](https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution)
29+
30+
31+
## [制限事項] 実行中のマスク用テクスチャの `RenderTextureCount` の値操作について (2024-03-26)
32+
33+
シーン実行中に `CubismMaskTexture.RenderTextureCount` を実行開始時よりも大きい値に変更すると、マスクが正常に再生成されない不具合を確認しています。
34+
対応バージョンや時期につきましては今後のリリースをもってお知らせいたします。
2635
---
2736

2837
©Live2D

Assets/Live2D/Cubism/NOTICE.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,34 @@
44

55
# Notices
66

7-
## [Caution] Support for Windows 11 (2021-12-09)
8-
9-
Regarding Windows 11 compatibility, we have confirmed that the deliverables work on Windows 11.
10-
However, please note that we do not guarantee the operation of builds using Windows 11.
11-
Supported version will be announced with a future release.
12-
137
## [Restrictions] Support for Windows ARM64 (2024-01-18)
148

159
Cubism SDK for Unity currently does not support Windows ARM64 builds for Unity 2023.1 or later.
1610
A supported version will be announced in a future release.
1711

1812

13+
## [Caution] Support for Apple's Privacy Manifest Policy
14+
15+
This product does not use the APIs or third-party products specified in Apple's privacy manifest policy.
16+
This will be addressed in future updates if this product requires such support.
17+
Please check the documentation published by Apple for details.
18+
19+
[Privacy updates for App Store submissions](https://developer.apple.com/news/?id=3d8a9yyh)
20+
21+
1922
### [Caution] About using `.bundle` and `.dylib` on macOS Catalina or later
2023

2124
To use `.bundle` and `.dylib` on macOS Catalina or later, you need to be connected to an online environment to verify your notarization.
2225

2326
For details, please check the official Apple documentation.
2427

2528
* [Apple Official Documentation](https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution)
29+
30+
31+
### [Restrictions] Manipulation of `RenderTextureCount` value for mask textures during execution (2024-03-26)
32+
33+
If `CubismMaskTexture.RenderTextureCount` is changed during scene execution to a value greater than that at the start of execution, the mask will not be regenerated correctly.
34+
A supported version will be announced in a future release.
2635
---
2736

2837
©Live2D

Assets/Live2D/Cubism/Plugins/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77

8+
## 2024-03-26
9+
10+
### Remove
11+
12+
* [Unity] Remove built with Emscripten 1.38.48.
13+
* Unity 2021.2 or later uses only Core under `Assets/Live2D/Cubism/Plugins/Experimental/Emscripten/latest`.
14+
15+
816
## 2023-09-28
917

1018
### Remove

Assets/Live2D/Cubism/Plugins/Editor/CubismWebGLPluginProcessor.cs

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)