luoyikun

导航

u3d 控制animation播放速度

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AniSpeed : MonoBehaviour {
    Animation m_ani;
    public float m_speed = 1.0f;
	// Use this for initialization
	void Start () {
        m_ani = transform.GetComponent<Animation>();
        foreach (AnimationState state in m_ani)
        {
            state.speed = m_speed;
        }
    }
}

posted on 2017-07-14 09:42  luoyikun  阅读(23)  评论(0)    收藏  举报  来源