创建游戏物体
创建Animator Controller
使用SubState来将多个动画状态及其过渡看作单独的状态
运行效果:
通过脚本来控制
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SubState : MonoBehaviour {
private Animator anim;
void Start() {
anim = GetComponent<Animator>();
}
// Update is called once per frame
void Update() {
if (Input.GetKeyDown(KeyCode.Space)) {
anim.SetTrigger("SubState");
}
}
}