using
1using UnityEngine.UI; 2using System.Collections; 3 4public class MyScript : MonoBehaviour { 5 6 // Use this for initialization 7 void Start () { 8 AnimationClip clip = new AnimationClip (); 9 clip.legacy = true; 10 AnimationCurve curve = AnimationCurve.Linear(0f, 1f, 1f, 1f); 11 Keyframe key = new Keyframe (1.5f, 7f); 12 curve.AddKey (key); 13 clip.SetCurve ("", typeof(Transform), "localPosition.z", curve); 14 clip.wrapMode = WrapMode.Loop; 15 Animation animation = GetComponent<Animation> (); 16 animation.AddClip (clip, "clip1"); 17 animation.Play("clip") ; 18 19 } 20 21 // Update is called once per frame 22 void Update () { 23 transform.Rotate(1f, 1f, 1f); 24 } 25} 26コード
Cubeのオブジェクトが回るだけで移動しません。
なにか設定の忘れやたりないものがないでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/11/21 13:15