回答編集履歴
1
OnEnabledでのruntimeAnimatorController無効化が抜けていたため追加、改行を調整
answer
CHANGED
@@ -35,17 +35,9 @@
|
|
35
35
|
new Dictionary<Equation, Func<float, float>>
|
36
36
|
{
|
37
37
|
{Equation.Linear, t => t},
|
38
|
-
{
|
39
|
-
Equation.EaseInOutQuad,
|
40
|
-
|
38
|
+
{Equation.EaseInOutQuad, t => t < 0.5f ? (t *= 2.0f) * t * 0.5f : 1.0f - ((t = (1.0f - t) * 2.0f) * t * 0.5f)},
|
41
|
-
},
|
42
39
|
{Equation.EaseOutCirc, t => Mathf.Sqrt(1.0f - ((t -= 1.0f) * t))},
|
43
|
-
{
|
44
|
-
Equation.EaseInOutBounce,
|
45
|
-
t => t < 0.5f
|
46
|
-
|
40
|
+
{Equation.EaseInOutBounce, t => t < 0.5f ? (1.0f - EaseOutBounce(1.0f - (t * 2.0f))) * 0.5f : (EaseOutBounce((t * 2.0f) - 1.0f) * 0.5f) + 0.5f}
|
47
|
-
: (EaseOutBounce((t * 2.0f) - 1.0f) * 0.5f) + 0.5f
|
48
|
-
}
|
49
41
|
};
|
50
42
|
private static float EaseOutBounce(float v)
|
51
43
|
{
|
@@ -136,6 +128,9 @@
|
|
136
128
|
|
137
129
|
private void OnEnable()
|
138
130
|
{
|
131
|
+
this.runtimeAnimatorController = this.animator.runtimeAnimatorController;
|
132
|
+
this.animator.runtimeAnimatorController = null;
|
133
|
+
|
139
134
|
if (this.animationGraph.IsValid())
|
140
135
|
{
|
141
136
|
this.animationGraph.Play();
|