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);
        }
    }
}
相关推荐
淡海水2 小时前
05-03-源码-Boehm GC分配与碎片管理
开发语言·算法·unity·c#·游戏引擎·gc
WarPigs2 天前
Unity无法修改Assembly-CSharp.csproj错误
unity
FairGuard手游加固3 天前
手游加固怎么做?SO、IL2CPP、AssetBundle 与运行时保护详解
安全·游戏·unity
阿松爱学习4 天前
【Unity开发】监听Scene场景事件
unity·c#
xiaogai_gai4 天前
BOM 物料清单同步实战:金蝶云星空 → 四化智造 MES 修改场景深度拆解
unity·游戏引擎
淡海水4 天前
03-03-架构篇-SGen GC架构解析
unity·架构·c#·gc·sgen
/**书香门第*/4 天前
Cocos Creator 打螺丝游戏的实现
游戏引擎·cocos2d·螺丝·打螺丝
萌萌的提莫队长5 天前
Unity相机捕捉,图像识别,抠像+合成
opencv·unity
mxwin6 天前
Unity Shader 光线追踪原理与实战案例
unity·游戏引擎
地狱为王6 天前
Unity使用DPDFNet实现实时语音增强(降噪)
unity·语音增强·降噪·dpdfnet