1.1,unity动画Animator

(1)模型动画

一种是美工完全制作好的分开的动画 ,

另一种是美工给了一个完整的动画,需要自己去分割

(2)切换动画和动画控制器,以及动画控制需要的参数

(3)控制动画和对应的状态

控制脚本

脚本文件

复制代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestAni_1 : MonoBehaviour
{

    private Animator anim;
    // Start is called before the first frame update
    void Start()
    {
        anim = GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.W))
        {
            anim.SetBool("yap", true);
        }

        if (Input.GetKeyDown(KeyCode.S))
        {
            anim.SetBool("yap", false);
        }
    }
}
相关推荐
狂人开飞机7 小时前
23、实战平台跳跃游戏
游戏·游戏引擎·godot
灸木16 小时前
Unity 多线程与并发:什么时候该用多线程?
unity
淡海水20 小时前
11-02-Unity-Mono-vs-IL2CPP-两种脚本后端的数据结构行为差异
数据结构·unity·游戏引擎·il2cpp·mono
彧azz20 小时前
初学Unity:编辑器
笔记·学习·unity·游戏引擎
小小数媒成员21 小时前
GPU优化(1)
游戏·unity·游戏引擎
淡海水21 小时前
11-03-Unity-List-T-和Dictionary-TKey-TValue-的性能调优实战
算法·unity·c#·list·dictionary
狂人开飞机1 天前
27、实战物理益智游戏
游戏·游戏引擎·godot
小小数媒成员2 天前
如何优化代码适应托管内存?
游戏·unity·游戏引擎
狂人开飞机2 天前
21、游戏架构设计模式
游戏·游戏引擎·godot