旧动画系统



using System.Collections;
using System.Collections.Generic;
using UnityEngine; public class Move : MonoBehaviour
{
// Start is called before the first frame update
public float moveSpeed =5f;
public float roundSpeed=120f;
public Animation ani;
void Start(){
ani=this.GetComponent<Animation>();
}
public void Run(){
ani.Play("Run");
}
public void Jump(){
ani.Play("JumpUp");
}
public void Roll(){
ani.Play("Roll");
} }

新动画系统

用Controller控制人物



添加动作Motion

点击箭头,设置动作转移条件





拖拽到Animation下

using System.Collections;
using System.Collections.Generic;
using UnityEngine; public class Move : MonoBehaviour
{ public Animator at;
// Start is called before the first frame update
void Start()
{ } // Update is called once per frame
void Update()
{
if(Input.anyKey){
at.SetBool("IsWalking",true);
//this.transform.Translate(Input.GetAxis("Vertical")*Vector3.forward*3f*Time.deltaTime);
// this.transform.Rotate(Input.GetAxis("Horizontal")*Vector3.up*1f);
}
else at.SetBool("IsWalking",false);
}
}

最新文章

  1. View and Data API Tips: how to make viewer full screen
  2. git版本控制管理实践-4
  3. f
  4. effective OC2.0 52阅读笔记(二 对象、消息、运行期)
  5. UVa 1611 (排序 模拟) Crane
  6. 修改的某人的SqlHelper FOR ODBC
  7. 高可用软件Keepalived
  8. 【转载】test和cmp比较
  9. JAVA Metrics 度量工具使用介绍
  10. Windows Azure入门教学系列 (六):使用Table Storage
  11. Kendo UI开发教程(26): 单页面应用(四) Layout
  12. 漫谈PID——实现与调参
  13. what i want
  14. HTTP协议之url详解
  15. ENVIRONMENT
  16. Quartz.Net定时任务EF+MVC版的web服务
  17. python——回文函数(reversed)
  18. Webservice发布
  19. hustoj搭建--常见问题
  20. 【ZABBIX】ZABBIX3.2升级3.4

热门文章

  1. '\ddd'转义字符与八进制转换
  2. 1_开环系统和闭环系统_反馈控制_Open/Closed Loop System_Feedback
  3. 解决 css 浮动后 父元素高度失效问题
  4. sublime text3 好用的插件
  5. 实用的 CSS — 贝塞尔曲线(cubic-bezier)
  6. 惠普电脑win10系统中WLAN不见了
  7. win11拖动窗口造成崩溃的问题
  8. springboot+maven实现模块化编程
  9. Mybatsi注解开发-基础操作
  10. echarts饼图禁止鼠标悬浮区块突出