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);
        }
    }
}
相关推荐
黄思搏4 小时前
Unity坐标转换指南 - 3D与屏幕UI坐标互转
ui·3d·unity
weixin_424294675 小时前
在 Unity 游戏开发中,为视频选择 VP8 还是 H.264
unity·游戏引擎
一步一个foot-print1 天前
【Unity】Light Probe 替代点光源给环境动态物体加光照
unity·游戏引擎
@LYZY1 天前
Unity 中隐藏文件规则
unity·游戏引擎·游戏程序·vr
霜绛1 天前
C#知识补充(二)——命名空间、泛型、委托和事件
开发语言·学习·unity·c#
Sator11 天前
使用Unity ASE插件设置数值不会生效的问题
unity·游戏引擎
AA陈超1 天前
虚幻引擎5 GAS开发俯视角RPG游戏 P07-08 点击移动
c++·游戏·ue5·游戏引擎·虚幻
程序猿追1 天前
轻量级云原生体验:在OpenEuler 25.09上快速部署单节点K3s
人工智能·科技·机器学习·unity·游戏引擎
B0URNE1 天前
【Unity基础详解】(7)Unity核心:动画系统
unity·游戏引擎
我的golang之路果然有问题1 天前
mac M系列芯片 unity 安装会遇到的错误以及解决
经验分享·学习·macos·unity·游戏引擎