2

コードから UI アニメーションを作成しようとしています。位置アニメーションは正常に機能しますが、回転カーブが正しく作成されませんでした。

ここに画像の説明を入力 ここに画像の説明を入力

最後のフレームでのみ回転値が変化します。なぜ?

var angle = Quaternion.Euler(FadeOutEndAngleX, FadeOutEndAngleY, FadeOutEndAngleZ);

curve1 = AnimationCurve.Linear(0f, 0f, 0.5f, Screen.width);
curve2 = AnimationCurve.Linear(0f, 0f, 0.5f, Screen.height);
curve3 = AnimationCurve.Linear(0f, 0f, 0.5f, angle.x);
curve4 = AnimationCurve.Linear(0f, 0f, 0.5f, angle.y);
curve5 = AnimationCurve.Linear(0f, 0f, 0.5f, angle.z);
curve6 = AnimationCurve.Linear(0f, 0f, 0.5f, angle.w);

clip.SetCurve("", typeof(RectTransform), "m_AnchoredPosition.x", curve1);
clip.SetCurve("", typeof(RectTransform), "m_AnchoredPosition.y", curve2);
clip.SetCurve("", typeof(RectTransform), "localRotation.x", curve3);
clip.SetCurve("", typeof(RectTransform), "localRotation.y", curve4);
clip.SetCurve("", typeof(RectTransform), "localRotation.z", curve5);
clip.SetCurve("", typeof(RectTransform), "localRotation.w", curve6);
4

0 に答える 0