[unity] Renamed misleading MixMode.SpineStyle enum name at SkeletonMecanim to MixMode.Hard. SkeletonMecanim Layer Mix Mode now defaults to MixMode.MixNext instead of MixMode.Hard for new instances. Closes #1505.

This commit is contained in:
Harald Csaszar 2019-09-26 13:40:25 +02:00
parent d6d4953b2c
commit 1f0269b919
2 changed files with 7 additions and 6 deletions

View File

@ -231,6 +231,7 @@
a) the `Packages` directory in your project where it will automatically be loaded, or
b) to an arbitrary directory outside the Assets directory and then open Package Manager in Unity, select the `+` icon, choose `Add package from disk..` and point it to the package.json file.
The Project panel should now show an entry `Spine Timeline Extensions` under `Packages`. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents.
* `SkeletonMecanim`'s `Layer Mix Mode` enum name `MixMode.SpineStyle` has been renamed to `MixMode.Hard`. This is most likely not set via code and thus unlikely to be a problem. Serialized scenes and prefabs are unaffected.
* **Additions**
* **Spine Preferences stored in Assets/Editor/SpineSettings.asset** Now Spine uses the new `SettingsProvider` API, storing settings in a SpineSettings.asset file which can be shared with team members. Your old preferences are automatically migrated to the new system.
@ -263,7 +264,7 @@
You can leave this parameter disabled when everything is drawn correctly to save the additional performance cost.
* **Changes of default values**
* `SkeletonMecanim`'s `Layer Mix Mode` now defaults to `MixMode.SpineStyle` instead of `MixMode.MixAlways`.
* `SkeletonMecanim`'s `Layer Mix Mode` now defaults to `MixMode.MixNext` instead of `MixMode.MixAlways`.
* `BlendModeMaterialAsset` and it's instance `Default BlendModeMaterials.asset` now have `Apply Additive Material` set to `true` by default in order to apply all blend modes by default.
* **Deprecated**

View File

@ -116,7 +116,7 @@ namespace Spine.Unity {
public MixBlend[] layerBlendModes = new MixBlend[0];
#endregion
public enum MixMode { AlwaysMix, MixNext, SpineStyle }
public enum MixMode { AlwaysMix, MixNext, Hard }
readonly Dictionary<int, Spine.Animation> animationTable = new Dictionary<int, Spine.Animation>(IntEqualityComparer.Instance);
readonly Dictionary<AnimationClip, int> clipNameHashCodeTable = new Dictionary<AnimationClip, int>(AnimationClipEqualityComparer.Instance);
@ -161,7 +161,7 @@ namespace Spine.Unity {
public void Apply (Skeleton skeleton) {
if (layerMixModes.Length < animator.layerCount) {
System.Array.Resize<MixMode>(ref layerMixModes, animator.layerCount);
layerMixModes[animator.layerCount-1] = MixMode.SpineStyle;
layerMixModes[animator.layerCount-1] = MixMode.MixNext;
}
#if UNITY_EDITOR
@ -266,7 +266,7 @@ namespace Spine.Unity {
interruptingStateInfo.loop, null, weight, layerBlendMode, MixDirection.In);
}
}
} else { // case MixNext || SpineStyle
} else { // case MixNext || Hard
// Apply first non-zero weighted clip
int c = 0;
for (; c < clipInfoCount; c++) {
@ -283,7 +283,7 @@ namespace Spine.Unity {
c = 0;
if (hasNext) {
// Apply next clip directly instead of mixing (ie: no crossfade, ignores mecanim transition weights)
if (mode == MixMode.SpineStyle) {
if (mode == MixMode.Hard) {
for (; c < nextClipInfoCount; c++) {
var info = nextClipInfo[c]; float weight = info.weight * layerWeight; if (weight == 0) continue;
GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(nextStateInfo.normalizedTime, info.clip.length, nextStateInfo.speed < 0), nextStateInfo.loop, null, 1f, layerBlendMode, MixDirection.In);
@ -300,7 +300,7 @@ namespace Spine.Unity {
c = 0;
if (isInterruptionActive) {
// Apply next clip directly instead of mixing (ie: no crossfade, ignores mecanim transition weights)
if (mode == MixMode.SpineStyle) {
if (mode == MixMode.Hard) {
for (; c < interruptingClipInfoCount; c++) {
var info = interruptingClipInfo[c];
float clipWeight = shallInterpolateWeightTo1 ? (info.weight + 1.0f) * 0.5f : info.weight;