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);
        }
    }
}
相关推荐
张老师带你学18 小时前
UnityVR弯曲UI
科技·游戏·unity·游戏引擎·模型
张老师带你学19 小时前
unity作业,街角小场景
科技·游戏·unity·游戏引擎·模型
mxwin1 天前
Unity Shader LOD:动态 Shader 等级切换技术详解
unity·游戏引擎·shader
ALex_zry1 天前
C++高性能日志与监控系统设计
c++·unity·wpf
魔士于安1 天前
Unity太空战舰完整工程,包含战损,实时战损
游戏·unity·游戏引擎·贴图·模型
Nuopiane1 天前
MyPal3(10)视锥体剔除
unity
爱搞虚幻的阿恺1 天前
RPG游戏开发【加餐】实现游戏小地图的简单方法
游戏·ue5·游戏引擎·虚幻
海海不瞌睡(捏捏王子)1 天前
Unity知识点概要
unity·1024程序员节
学不完的1 天前
Zrlog面试问答及问题解决方案
linux·运维·nginx·unity·游戏引擎
小清兔1 天前
unity游戏制作中问题汇总(持续更新)
游戏·unity·游戏引擎