Animator Override Controllers 学习及性能测试
本文由博主(YinaPan)原创,转载请注明出处:http://www.cnblogs.com/YinaPan/p/Unity_AnimatorOverrideContorller.html
The Animator Override Controller is a type of asset which allows you to extend an existing Animator Controller, replacing the specific animations used but otherwise retaining the original’s structure, parameters and logic.
动画覆盖器是一类asset,它允许你扩张已经存在的动画控制器,用特定的animations 但是需要保留原始的结构、参数和逻辑;
This allows you to create multiple variants of the same basic state machine, but with each using different sets of animations.
这就允许你创建同一个基础状态机的多个变种,这些变种使用不同的animations
For example, your game may have a variety of NPC types living in the world, but each type (goblin, ogre, elf, etc) has their own unique animations for walking, idling, sitting, etc.
例如:你有一系列的npc生活在游戏中,他们有自己的独特走、idle、坐等animations;
By creating one “base” Animator Controller containing the logic for all NPC types, you could then create an override for each type and drop in their respective animation files.
To demonstrate, here’s a typical Animator Controller asset:
创建一个基础动画控制器,包含所有种类npc的逻辑,你就可以创建一个override为每一种NPC,然后用他们各自的animation去填充;
using UnityEngine;
using System.Collections; public class AnimatorOveridePerformance : MonoBehaviour {
public bool m_test = true;
Animator m_animator = null;
AnimatorOverrideController m_Old = null;
AnimatorOverrideController m_New = null; // Use this for initialization
void Start () {
m_animator = GetComponent<Animator>();
m_Old = new AnimatorOverrideController();
m_New = Resources.Load<AnimatorOverrideController>("Packages/ArtWorks/Player/M2/M2_P04/M2_P04");
Debug.LogError(m_New);
m_Old = (AnimatorOverrideController)m_animator.runtimeAnimatorController;
if (null != m_New) {
Debug.LogError(m_Old["P01Attack01"]);
Debug.LogError(m_Old["P01Attack02"]);
m_Old["P01Attack01"] = m_New["P04Attack01"];
m_Old["P01Attack02"] = m_New["P04Attack02"];
Debug.LogError(m_Old["P01Attack01"]);
Debug.LogError(m_Old["P01Attack02"]);
}
} void Update() {
Profiler.BeginSample("Update");
if (m_test && m_New) {
Profiler.BeginSample("this[]");
m_Old["P01Attack01"] = m_New["P04Attack01"];
m_Old["P01Attack02"] = m_New["P04Attack02"];
Profiler.EndSample();
}
Profiler.EndSample();
} }
单次消耗大概在0.5到1ms
Animator Override Controllers 学习及性能测试的更多相关文章
- Animator Override Controller学习及性能测试
本文由博主(YinaPan)原创,转载请注明出处: http://www.cnblogs.com/xsln/p/Animator_Override_Controller.html 一.Animator ...
- 如何学习LoadRunner性能测试?
最近组内同事针对性能测试LR的脚本部分做了介绍,是个不错的分享.会后反思自己也有很长一段时间没做性能测试了,根据以往的经验,有必要做些整理和补充,本文主要介绍一些Loadrunner性能测试的学习方法 ...
- JMeter学习-030-JMeter性能测试常用之事务控制器实例
通常进行性能测试时,我们一般仅考虑主要的数据返回,不考虑页面渲染所需要的数据(例如:css.js.图片等).但当我们需要衡量打开一个页面(页面渲染完成)的性能时,我们就需要考虑完成页面渲染所需要的图片 ...
- httprunner学习16-locust性能测试
前言 HttpRunner 的 yaml 脚本文件,可以结合locust做性能测试 locust环境准备 安装完成 HttpRunner 后,系统中会新增locusts命令,但不会同时安装 Locus ...
- JMeter学习笔记--性能测试理论
一.性能测试技能树 二.性能测试流程 三.性能测试相关术语 性能测试指标就是: 多(并发量)快(响应时间)好(稳定性[长时间运行])省(资源使用率).思考时间 1.负载 模拟业务操作对服务器造成压力的 ...
- linux学习------磁盘性能测试
测试服务器 1核1G配置 下载后放在你想测试的目录下,执行preparefile.sh准备测试文件,完成后执行runTest.sh执行测试,等待测试结果完成. {sysbench_bin}> ...
- Unity3D之Mecanim动画系统学习笔记(五):Animator Controller
简介 Animator Controller在Unity中是作为一种单独的配置文件存在的文件类型,其后缀为controller,Animator Controller包含了以下几种功能: 可以对多个动 ...
- Animator Controller 继承关系
准备知识 对于Animator Controller中蜘蛛网一样的几十条连线,后续如果靠人工维护,那成本将是很大. AnimatorOverrideController组件的文档:https://do ...
- Animator
[Animator] 1.State Machine Behaviours A State Machine Behaviour is a special class of script. In a s ...
随机推荐
- Building a Space Station(kruskal,说好的数论呢)
Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3820 Accepted: 1950 Description You a ...
- Eclipse启动jboss局域网无法访问的问题
在启动jboss的时候加上参数 -b 0.0.0.0(本地用localhost也能访问,用ip也能访问)
- VSTS负载测试——如何:使用 SQL 创建结果存储区
原文地址:http://www.cnblogs.com/chenxizhang/archive/2009/06/01/1493939.html 原文参见:http://msdn.microsoft.c ...
- codevs2492 上帝造题的七分钟 2
2492 上帝造题的七分钟 2 题目描述 Description XLk觉得<上帝造题的七分钟>不太过瘾,于是有了第二部. "第一分钟,X说,要有数列,于是便给定了一个正整数数列 ...
- 视频监控之VSCloud版本计划
下个版本会加入 1.人脸检测和人脸识别功能 2. 车牌识别. https://code.google.com/p/vscloud/ 下载连接 https://sourceforge.net/proje ...
- drp用户管理完成后,asp.net与java的一个简单比较
DRP视频断断续续看了有一个月的时间了,跟着视频进行,从需求到设计,到现在的编码实现,跟之前用asp.net做系统步调一致,都遵守软件设计的规范,一步步来进行.尤其是编码实现,越来越感觉java与as ...
- PL/SQL Developer 与tnsnames.ora
PL/SQL Developer 是一款流行的oracle开发与管理的IDE. 在登录PL/SQL Developer时所选择的数据库依赖于tnsnames.ora文件中的信息. 如果我们安装了多个o ...
- js标题文字向上滚动
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xht ...
- Hadoop入门--HDFS(单节点)配置和部署 (一)
一 配置SSH 下载ssh服务端和客户端 sudo apt-get install openssh-server openssh-client 验证是否安装成功 ssh username@192.16 ...
- 九度OnlineJudge之1001:A+B for Matrices
题目描述: This time, you are supposed to find A+B where A and B are two matrices, and then count the num ...