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);
        }
    }
}
相关推荐
め.6 小时前
UIFramework
ui·unity
fqbqrr6 小时前
2606d,用d语言构建游戏引擎
游戏引擎·d
℡枫叶℡16 小时前
Unity - Import Activity Window 资源导入诊断信息窗口
unity·资源导入诊断
TO_ZRG18 小时前
Unity 证书校验
unity·游戏引擎
mxwin20 小时前
Unity Shader 切线空间数据是如何计算出来的
unity·游戏引擎·shader
mxwin1 天前
Unity Shader 法线贴图跟切线空间有什么关系
unity·游戏引擎·贴图·shader
mxwin1 天前
Unity Shader 贴图和采样的关系 如何保证贴图清晰
unity·游戏引擎·贴图·shader
心前阳光1 天前
Unity之使用火山引擎实现文字提问流式回复
unity·游戏引擎·火山引擎
mxwin1 天前
Unity Shader 什么是球谐光照 原理是什么
unity·游戏引擎·shader