Animation Parameter

  Animation Parameters are variables that are defined within the animation system but can also be accessed and assigned values from scripts.

  Animation Parameters 是Animator Controller中的用户自定义变量,script可以获取和设置其值,其值也可以作为transition转换的条件。配置界面如下:

  

  有四种类型的Parameter可选:

  

  Parameter可以作为transition的判定条件:

  

  script访问parameter的示例如下:

 using UnityEngine;
using System.Collections; public class AvatarCtrl : MonoBehaviour { protected Animator animator; public float DirectionDampTime = .25f; void Start ()
{
animator = GetComponent<Animator>();
} void Update ()
{
if(animator)
{
//get the current state
AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(); //if we're in "Run" mode, respond to input for jump, and set the Jump parameter accordingly.
if(stateInfo.nameHash == Animator.StringToHash("Base Layer.RunBT"))
{
if(Input.GetButton("Fire1"))
animator.SetBool("Jump", true );
}
else
{
animator.SetBool("Jump", false);
} float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical"); //set event parameters based on user input
animator.SetFloat("Speed", h*h+v*v);
animator.SetFloat("Direction", h, DirectionDampTime, Time.deltaTime);
}
}
}

  综上所述,Animation Parameter是一个script可写,transition可读的控制变量。

参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/Manual/AnimationParameters.html

  

Animation Parameter的更多相关文章

  1. Unity随机随学

    1.什么是渲染管道? 是指在显示器上为了显示出图像而经过的一系列必要操作.渲染管道中的步骤很多,都要将几何物体从一个坐标系中变换到另一个坐标系中去. 主要步骤有: 本地坐标->视图坐标-> ...

  2. Swift - EasingAnimation绘制圆环动画

    Swift - EasingAnimation绘制圆环动画 效果 源码 https://github.com/YouXianMing/Swift-Animations // // CircleView ...

  3. 【Unity】10.4 类人动画角色的控制

    分类:Unity.C#.VS2015 创建日期:2016-05-02 一.简介 导入角色网格和动画及设置 Avatar 之后,就可以准备开始在游戏中使用它们了.以下部分涵盖 Mecanim 提供的.用 ...

  4. ExtJS6.0扩展日期选择控件为也可以选择时间

    PS:ExtJS自带的日期选择控件只能够选择日期,但是现在的需求需要精确到秒,所以在网上搜索了一些例子(大部分是4.0的)作为参考,然后改出了6.0可用的一个日期时间选择控件. 1.找到extjs6. ...

  5. Unity Glossary

    https://docs.unity3d.com/2018.4/Documentation/Manual/Glossary.html 2D terms 2D Physics terms AI term ...

  6. Flutter-动画-实践篇

    一.了解AnimatedWidget 通常我们给一个Widget添加动画的时候都需要监听Animation的addListener()方法,并在这个方法里面不停的调用setState()方法通知Wei ...

  7. Projected coordinate systems 和 wkid

    Projected coordinate systems Well-known ID Name Well-known text 2000 Anguilla_1957_British_West_Indi ...

  8. jQuery1.9.1源码分析--Animation模块

    var fxNow, // 使用一个ID来执行动画setInterval timerId, rfxtypes = /^(?:toggle|show|hide)$/, // eg: +=30.5px / ...

  9. Unity3D之Mecanim动画系统学习笔记(四):Animation State

    动画的设置 我们先看看Animation Clip的一些设置: Loop time:动画是否循环播放. 下面出现了3个大致一样的选项: Root Transform Rotation:表示为播放动画的 ...

随机推荐

  1. MAC版画图软件 paintbrush 推荐,类似 windows 上系统自带的画图软件

    不想开photoshop这么重的软件,但是对于屏幕截图有需要有一点处理.这时候我想起 windows上画图的好了. 搜索了一下,知道了 paintbrush 这个软件,于是下载试用了一下,果然很好. ...

  2. C与C++结构体的区别

    笔者介绍:姜雪伟,IT公司技术合伙人,IT高级讲师,CSDN社区专家,特邀编辑,畅销书作者,已出版书籍:<手把手教你架构3D游戏引擎>电子工业出版社和<Unity3D实战核心技术详解 ...

  3. Unity3d command line arguments

    Options Many of these relate to Unity3d command line arguments Batch Mode - should be left enabled u ...

  4. Python打包上传

    你可以用pip导出你的dependency: $ pip freeze > requirements.txt 然后在通过以下命令安装dependency: pip install -r requ ...

  5. [转载] 视音频数据处理入门:RGB、YUV像素数据处理

    ===================================================== 视音频数据处理入门系列文章: 视音频数据处理入门:RGB.YUV像素数据处理 视音频数据处理 ...

  6. HDU - 5936: Difference(暴力:中途相遇法)

    Little Ruins is playing a number game, first he chooses two positive integers yy and KK and calculat ...

  7. Thinking in Java 4th(Java编程思想第四版)文档、源码、习题答案

    Thinking in Java 4th 中.英文两版pdf文档,书中源码及课后习题答案.链接:https://pan.baidu.com/s/1BKJdtgJ3s-_rN1OB4rpLTQ 密码:2 ...

  8. 调试SPRING MVC(或者整合SSH)的时候遇到了org/objectweb/asm/Type

    调试SPRING MVC(或者整合SSH)的时候遇到了org/objectweb/asm/Type 解决方法1: 原因是Spring中的cglib-nodep-2.x.x.jar与Hibernate中 ...

  9. BZOJ5337 [TJOI2018]str

    题意 小豆参加了生物实验室.在实验室里,他主要研究蛋臼质.他现在研究的蛋臼质是由k个氨基酸按一定顺序构成的.每一个氨基酸都可能有a种碱基序 列si_j 构成.现在小豆有一个碱基串s,小豆想知道在这个碱 ...

  10. 对Tornado异步操作Sqlalchemy方法的选定 不错

    使用原因 在一个实时通讯的项目中,由于需要使用Websocket这一协议,便在Python框架中选定了Tornado,也同时使用了Sqlalchemy这一ORM框架. 大家都知道Tornado有异步非 ...