Animation Parameter
【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的更多相关文章
- Unity随机随学
1.什么是渲染管道? 是指在显示器上为了显示出图像而经过的一系列必要操作.渲染管道中的步骤很多,都要将几何物体从一个坐标系中变换到另一个坐标系中去. 主要步骤有: 本地坐标->视图坐标-> ...
- Swift - EasingAnimation绘制圆环动画
Swift - EasingAnimation绘制圆环动画 效果 源码 https://github.com/YouXianMing/Swift-Animations // // CircleView ...
- 【Unity】10.4 类人动画角色的控制
分类:Unity.C#.VS2015 创建日期:2016-05-02 一.简介 导入角色网格和动画及设置 Avatar 之后,就可以准备开始在游戏中使用它们了.以下部分涵盖 Mecanim 提供的.用 ...
- ExtJS6.0扩展日期选择控件为也可以选择时间
PS:ExtJS自带的日期选择控件只能够选择日期,但是现在的需求需要精确到秒,所以在网上搜索了一些例子(大部分是4.0的)作为参考,然后改出了6.0可用的一个日期时间选择控件. 1.找到extjs6. ...
- Unity Glossary
https://docs.unity3d.com/2018.4/Documentation/Manual/Glossary.html 2D terms 2D Physics terms AI term ...
- Flutter-动画-实践篇
一.了解AnimatedWidget 通常我们给一个Widget添加动画的时候都需要监听Animation的addListener()方法,并在这个方法里面不停的调用setState()方法通知Wei ...
- Projected coordinate systems 和 wkid
Projected coordinate systems Well-known ID Name Well-known text 2000 Anguilla_1957_British_West_Indi ...
- jQuery1.9.1源码分析--Animation模块
var fxNow, // 使用一个ID来执行动画setInterval timerId, rfxtypes = /^(?:toggle|show|hide)$/, // eg: +=30.5px / ...
- Unity3D之Mecanim动画系统学习笔记(四):Animation State
动画的设置 我们先看看Animation Clip的一些设置: Loop time:动画是否循环播放. 下面出现了3个大致一样的选项: Root Transform Rotation:表示为播放动画的 ...
随机推荐
- xhtml html
xhtml是用xml语言重写了html,相比html更规范了, XHTML是HTML像XML的一个过渡语言,它比HTML严谨性会高点,然后基本语言都还是沿用的HTML的标签,只不过废除了部分表现层的标 ...
- js控制iframe的刷新(页面局部刷新)
今天遇到个问题,后台会员审核之后,页面内的会员审核状态要及时改变,但又不能指望用户手动刷新(用户体验很不好) 如果审核页面和显示审核状态时同在一个html页面的话,那么直接用js改变div内部的文本就 ...
- lzugis—搭建属于自己的小型的版本控制SVN
对于不了解SVN的同志们可以参考下"mh942408056"的这篇博文,SVN简介,链接地址为:http://blog.csdn.net/mh942408056/article/d ...
- Shell 参数(1)
shell 中参数相关: ./a.sh a b c d $# 是传给脚本的参数个数 $0 是脚本本身的名字 $1 是传递给该shell脚本的第一个参数 $2 是传递给该shell脚本的第二个参数 $@ ...
- Java中数据库连接池原理机制的详细讲解(转)
连接池的基本工作原理 1.基本概念及原理 由上面的分析可以看出,问题的根源就在于对数据库连接资源的低效管理.我们知道,对于共享资源,有一个很著名的设计模式:资源池 (Resource Pool).该模 ...
- Python使用教程
1.下载python windows:http://www.python.org/download/ 2.环境变量: 3.pycharm下载:http://www.python.org/downloa ...
- Hibernate HQL查询(2)
hql是面向对象查询,格式:from + 类名 + 类对象 + where + 对象的属性 sql是面向数据库表查询,格式:from + 表名 + where + 表中字段 1.查询 一般在Hiber ...
- 【精品分享二】ASP.NET MVC系列精品图书高清PDF下载
更多图书请关注:第一教育云电子书平台 http://book.1eduyun.com/ 注:本专题提供的所有的电子书下载资源均系收集于百度云,本网站(http://book.1eduyun.com/ ...
- dubbo-demo安装运行指南
步骤步骤:1.安装JDK:2.安装Tomcat:3.安装Zookeeper:4.安装Dubbo: 修改Consumer配置文件
- 读写另一EXE的内存
procedure TfrmMain.tmrChangeServerNameTimer(Sender: TObject); function GetProcessID(FileName: string ...