u3d 控制animation播放速度

2023-08-24 13:43:30 浏览数 (1)

代码语言:javascript复制
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;
        }
    }
}

0 人点赞