《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)

《UnityAPI.Animator动画器》

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第1张图片

版本

作者

参与者

完成日期

备注

UnityAPI_Animator_V01_1.0

严立钻

 

2020.06.19

 

 

 

 

 

 

 

#《UnityAPI.Animator动画器》发布说明:

++++“UnityAPI.Animator动画器是对UnityAPIAnimator动画器类的剖析和拓展

立钻哥哥:Unity是一个入门快、提高难的游戏引擎,想要提升能力,至少需要越过3道坎:API+Shader+综合能力

++1、API的积累:API的合理利用不仅可以减轻自己的编码负担,而且往往可以提高程序的运行效率;这也是钻哥开始“Unity API”独立打造分类的初衷

++2、Shader编程:想要做出一款精品游戏往往需要有高效的Shader的支持;Unity提供了一套改良的“Shader Lab”系统,优化了繁杂的“Open GL”编程

++3、综合能力(技术+业务+管理):一款产品的制作除了功能编程外,往往会涉及很多其他领域,例如产品架构、UI交互设计、模型制作等,作为主要的编程人员,对其他相关领域的了解程序往往会影响到产品制作直至最后的产品体验

++++立钻哥哥一直在推动【VR云游戏=Unity+SteamVR+云技术+5G+AI,这个只是一个引子,抛砖引玉让大家对整个知识体系有一个明确的落地方向,宝宝们可以根据自己的兴趣方向进行拓展:比如Unity这里是指一种“3D游戏引擎”,也可拓展至“UE4Cocos2dx”等游戏引擎;SteamVR是一种跨硬件解决方案,也可拓展至“VRTK”等第三方插件;“云技术+5G”是一种跨平台解决方案的核心技术,同样可拓展至其他平台解决方案;AI也是一种先进技术的举例,也可以拓展至任何一种前沿技术

 

 

@@提示:有些博客可能只是开了头,如果感兴趣的同学,可以“点赞”或“评论区留言”,只要关注的同学多了,那就会继续完善哟!(“++==”,表示没有写完的,如果关注度不高就不完善了;“++ok++”,表示此篇博客已经完成,是阶段性完整的!)

 

$$$$博客溯源:

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第2张图片

 

++++VR云游戏=Unity+SteamVR+云技术+5G+AI;(说明:AI人工智能不是我们的主要研究技术,只是了解一下,领略一下有风的感觉!但是,VR是我们的研究重点

++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html

++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html

++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html

++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html

++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html

++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/

 

 

 

 

 

 

#Animator动画器

#Animator动画器

#Animator动画器

++A1、Description描述

++B2、Variables变量

++C3、Public Function共有函数

++D4、Message消息

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第3张图片

 

 

 

 

 

#A1、Description描述

#A1、Description描述

++A1、Description描述

++++立钻哥哥:Animator(动画器)是控制Mecanim动画系统的接口

++++[namespace]:UnityEngine

++++[Inherits from]:Behaviour

++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html

++++[Unity快速入门]:https://blog.csdn.net/VRunSoftYanlz/article/details/105776475

++++[UnityAPI目录]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533906

++++[Application应用]:https://blog.csdn.net/VRunSoftYanlz/article/details/106086327

++++[Object对象]:https://blog.csdn.net/VRunSoftYanlz/article/details/106202194

++++[GameObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106223815

++++[MonoBehaviour]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533256

++++[Component组件]:https://blog.csdn.net/VRunSoftYanlz/article/details/106367004

++++[Transform变换]:https://blog.csdn.net/VRunSoftYanlz/article/details/106607761

++++[Camera摄像机]:https://blog.csdn.net/VRunSoftYanlz/article/details/106148837

++++[Shader着色器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106321040

++++[Material材质]:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303

++++[Physics物理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106268062

++++[Collider碰撞器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106696886

++++[Rigidbody刚体]:https://blog.csdn.net/VRunSoftYanlz/article/details/106698042

++++[Joint关节]:https://blog.csdn.net/VRunSoftYanlz/article/details/106771226

++++[RaycastHit]:https://blog.csdn.net/VRunSoftYanlz/article/details/106292370

++++[ParticleSystem]:https://blog.csdn.net/VRunSoftYanlz/article/details/106341995

++++[WWW万维网]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412890

++++[LineRenerer]:https://blog.csdn.net/VRunSoftYanlz/article/details/106306388

++++[WheelCollider]:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217

++++[MovieTexture]:https://blog.csdn.net/VRunSoftYanlz/article/details/106434063

 

 

 

 

 

 

#B2、Variables变量

#B2、Variables变量

++B2、Variables变量

++++B2.1、angularVelocity

++++B2.2、applyRootMotion

++++B2.3、avatar

++++B2.4、bodyPosition

++++B2.5、bodyRotation

++++B2.6、cullingMode

++++B2.7、deltaPosition

++++B2.8、deltaRotation

++++B2.9、feetPivotActive

++++B2.10、gravityWeight

++++B2.11、hasRootMotion

++++B2.12、hasTransformHierarchy

++++B2.13、humanScale

++++B2.14、isHuman

++++B2.15、isMatchingTarget

++++B2.16、isOptimizable

++++B2.17、layerCount

++++B2.18、leftFeetBottomHeight

++++B2.19、linearVelocityBlending

++++B2.20、parameters

++++B2.21、pivotPosition

++++B2.22、pivotWeight

++++B2.23、playbackTime

++++B2.24、recorderMode

++++B2.25、recorderStartTime

++++B2.26、recorderStopTime

++++B2.27、rightFeetBottomHeight

++++B2.28、rootPosition

++++B2.29、rootRotation

++++B2.30、runtimeAnimatorController

++++B2.31、speed

++++B2.32、stabilizeFeet

++++B2.33、targetPosition

++++B2.34、targetRotation

++++B2.35、updateMode

++++B2.36、velocity

++++B2.37、YanlzXREngine.Animator.Variables

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第4张图片

 

 

++B2.1、angularVelocity

++B2.1、angularVelocity

++B2.1、angularVelocity

++++立钻哥哥:角速度

public Vector3 angularVelocity;

++++获得上一帧计算的阿凡达角速度

 

 

 

 

 

++B2.2、applyRootMotion

++B2.2、applyRootMotion

++B2.2、applyRootMotion

++++立钻哥哥:应用根运动

bool applyRootMotion;

++++是否应用根运动?

++++根运动是对象整体移动来影响,远离它的起点,但运动是由动画自己创建,而不是通过Transform来改变位置;注意:当脚本执行MonoBehaviour.OnAnimatorMove函数时,applyRootMotion没有影响

 

 

 

 

 

++B2.3、avatar

++B2.3、avatar

++B2.3、avatar

++++立钻哥哥:化身

Avatar avatar;

++++获取或设置当前的Avatar

++++运行时修改不完全支持;自己承担使用风险

 

 

 

 

 

++B2.4、bodyPosition

++B2.4、bodyPosition

++B2.4、bodyPosition

++++立钻哥哥:身体位置

Vector3 bodyPosition;

++++身体质量中心的位置

++++该位置是对象局部的位置

 

 

 

 

 

++B2.5、bodyRotation

++B2.5、bodyRotation

++B2.5、bodyRotation

++++立钻哥哥:身体旋转

Quaternion bodyRotation;

++++该身体质量中心的旋转

++++该旋转是对象的局部旋转

 

 

 

 

 

++B2.6、cullingMode

++B2.6、cullingMode

++B2.6、cullingMode

++++立钻哥哥:剔除模式

AnimatorCullingMode cullingMode;

++++控制动画器组件的剔除模式

 

 

 

 

 

++B2.7、deltaPosition

++B2.7、deltaPosition

++B2.7、deltaPosition

++++立钻哥哥:增量位置

Vector3 deltaPosition;

++++获取上一帧avatar的增量位置

 

 

 

 

 

++B2.8、deltaRotation

++B2.8、deltaRotation

++B2.8、deltaRotation

++++立钻哥哥:增量旋转

Quaternion deltaRotation;

++++获取上一帧avatar的增量旋转

 

 

 

 

 

++B2.9、feetPivotActive

++B2.9、feetPivotActive

++B2.9、feetPivotActive

++++立钻哥哥:脚轴心点激活

float feetPivotActive;

++++混合身体质量中心与脚质量中心的轴心点;0%表示混合轴心点在身体的质量中心;100%表示混合轴心点在脚的轴心点

 

 

 

 

 

++B2.10、gravityWeight

++B2.10、gravityWeight

++B2.10、gravityWeight

++++立钻哥哥:重力

float gravityWeight;

++++基于当前播放的动画的当前重力

 

 

 

 

 

++B2.11、hasRootMotion

++B2.11、hasRootMotion

++B2.11、hasRootMotion

++++立钻哥哥:是否根运动

bool hasRootMotion;

++++如果当前绑定已经是根运动,返回真

 

 

 

 

 

++B2.12、hasTransformHierarchy

++B2.12、hasTransformHierarchy

++B2.12、hasTransformHierarchy

++++立钻哥哥:是否是变换层级

bool hasTransformHierarchy;

++++如果该对象已经是变换层级,返回真

++++基于模型导入器中的优化游戏对象开关

 

 

 

 

 

++B2.13、humanScale

++B2.13、humanScale

++B2.13、humanScale

++++立钻哥哥:人形缩放

float humanScale;

++++返回当前人形绑定Avatar的缩放,(如果绑定是generic,默认为1

++++此缩放相当于Unity的默认Avatar

 

 

 

 

 

++B2.14、isHuman

++B2.14、isHuman

++B2.14、isHuman

++++立钻哥哥:是否是人形

bool isHuman;

++++如果当前的绑定是人形的,返回真;如果是generic(普通)的则返回假

 

 

 

 

 

++B2.15、isMatchingTarget

++B2.15、isMatchingTarget

++B2.15、isMatchingTarget

++++立钻哥哥:是否匹配目标

bool isMatchingTarget;

++++如果自动匹配是激活的

 

 

 

 

 

++B2.16、isOptimizable

++B2.16、isOptimizable

++B2.16、isOptimizable

++++立钻哥哥:是否优化

bool isOptimizable;

++++如果当前的绑定是AimatorUtility.OptimizeTransformHierarchy优化的

 

 

 

 

 

++B2.17、layerCount

++B2.17、layerCount

++B2.17、layerCount

++++立钻哥哥:层数

int layerCount;

++++该动画器控制器的层数

 

 

 

 

 

++B2.18、leftFeetBottomHeight

++B2.18、leftFeetBottomHeight

++B2.18、leftFeetBottomHeight

++++立钻哥哥:左脚底高度

float leftFeetBottomHeight;

++++获得左脚底的高度

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzAnimator : MonoBehaviour{

    

    void LateUpdate(){

        if(animator){

            Vector3 leftFootT = animator.GetIKPosition(AvatarIKGoal.LeftFoot);

            Quaternion leftFootQ = animator.GetIKPosition(AvatarIKGoal.LeftFoot);

            Vector3 leftFootH = new Vector3(0, -animator.leftFeetBottomHeight, 0);

 

            Vector3 pos = leftFootT + leftFootQ * leftFootH;

            Debug.Log(pos);

        }    //立钻哥哥:if(){}

    }    //立钻哥哥:void LateUpdate(){}

 

}    //立钻哥哥:public class YanlzAnimator{}

 

 

 

 

 

++B2.19、linearVelocityBlending

++B2.19、linearVelocityBlending

++B2.19、linearVelocityBlending

++++立钻哥哥:线性速度混合

public bool linearVelocityBlending;

++++linearVelocityBlending设置为true,根运动速度和角速度将线性混合

 

 

 

 

 

++B2.20、parameters

++B2.20、parameters

++B2.20、parameters

++++立钻哥哥:参数列表

public AnimatorControllerParameter[] parameters;

++++linearVelocityBlending设置为true,根运动速度和角速度将线性混合

 

 

 

 

 

++B2.21、pivotPosition

++B2.21、pivotPosition

++B2.21、pivotPosition

++++立钻哥哥:轴心点位置

Vector3 pivotPosition;

++++获得当前轴心点的位置

++++该轴心点是avatar的左右脚之间最稳定的轴心点

 

 

 

 

 

++B2.22、pivotWeight

++B2.22、pivotWeight

++B2.22、pivotWeight

++++立钻哥哥:轴心点权重

float pivotWeight;

++++获得轴心点的权重

++++该轴心点是avatar的左右脚之间最稳定的轴心点;值为0时,左脚是最稳定的轴心点;值为1时,右脚是最稳定的轴心点

 

 

 

 

 

++B2.23、playbackTime

++B2.23、playbackTime

++B2.23、playbackTime

++++立钻哥哥:播放时间

float playbackTime;

++++在记录缓冲区设置播放位置

++++当在播放模式,该值用于控制缓冲区当前的播放位置(秒);该值的范围在recorderStartTimerecorderStopTime之间

 

 

 

 

 

++B2.24、recorderMode

++B2.24、recorderMode

++B2.24、recorderMode

++++立钻哥哥:记录器模式

public AnimatorRecorderMode recorderMode;

++++获得动画器记录器的模式

 

 

 

 

 

++B2.25、recorderStartTime

++B2.25、recorderStartTime

++B2.25、recorderStartTime

++++立钻哥哥:记录开始时间

float recorderStartTime;

++++缓冲区第一帧的开始时间,相对于StartRecording被调用时的帧

++++例如:如果我们已在第10帧开始记录,缓存是5帧长;如果缓存没有被初始化(StartRecording没被调用),该属性值将为-1

 

 

 

 

 

++B2.26、recorderStopTime

++B2.26、recorderStopTime

++B2.26、recorderStopTime

++++立钻哥哥:记录停止时间

float recorderStopTime;

++++记录剪辑的结束时间,相对于StartRecording被调用的帧

++++例如:如果我们在第10秒开始记录,在第15秒结束记录,那么该值将会是5;如果缓存没有被初始化(StartRecording没被调用),该属性值将为-1

 

 

 

 

 

++B2.27、rightFeetBottomHeight

++B2.27、rightFeetBottomHeight

++B2.27、rightFeetBottomHeight

++++立钻哥哥:右脚底高度

float rightFeetBottomHeight;

++++获取右脚底的高度

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzAnimator : MonoBehaviour{

    

    void LateUpdate(){

        if(animator){

            Vector3 rightFootT = animator.GetIKPosition(AvatarIKGoal.RightFoot);

            Quaternion rightFootQ = animator.GetIKPosition(AvatarIKGoal.RightFoot);

            Vector3 rightFootH = new Vector3(0, -animator.rightFeetBottomHeight, 0);

 

            Vector3 pos = rightFootT + rightFootQ * rightFootH;

            Debug.Log(pos);

        }    //立钻哥哥:if(){}

    }    //立钻哥哥:void LateUpdate(){}

 

}    //立钻哥哥:public class YanlzAnimator{}

 

 

 

 

 

++B2.28、rootPosition

++B2.28、rootPosition

++B2.28、rootPosition

++++立钻哥哥:根位置

Vector3 rootPosition;

++++根位置,该游戏对象的位置

 

 

 

 

 

++B2.29、rootRotation

++B2.29、rootRotation

++B2.29、rootRotation

++++立钻哥哥:根旋转

Quaternion rootRotation;

++++根旋转,该游戏对象的旋转角度

 

 

 

 

 

++B2.30、runtimeAnimatorController

++B2.30、runtimeAnimatorController

++B2.30、runtimeAnimatorController

++++立钻哥哥:运动时动画器控制器

RuntimeAnimatorController runtimeAnimatorController;

++++AnimatorController的运行时代表,用来控制Animator

 

 

 

 

 

++B2.31、speed

++B2.31、speed

++B2.31、speed

++++立钻哥哥:速度

float speed;

++++动画器的播放速度;1表示正常播放速度

 

 

 

 

 

++B2.32、stabilizeFeet

++B2.32、stabilizeFeet

++B2.32、stabilizeFeet

++++立钻哥哥:稳定脚

bool stabilizeFeet;

++++过渡和混合时,脚自动稳定

 

 

 

 

 

++B2.33、targetPosition

++B2.33、targetPosition

++B2.33、targetPosition

++++立钻哥哥:目标位置

Vector3 targetPosition;

++++返回由SetTarget(AvatarTarget targetIndex, float targetNormalizedTime)指定的目标的位置

++++当帧在SetTarget调用计算后,该位置才有效

 

 

 

 

 

++B2.34、targetRotation

++B2.34、targetRotation

++B2.34、targetRotation

++++立钻哥哥:目标旋转

Quaternion targetRotation;

++++返回由SetTarget(AvatarTarget targetIndex, float targetNormalizedTime)指定的目标的旋转角度

++++当帧在SetTarget调用计算后,该旋转角度才有效

 

 

 

 

 

++B2.35、updateMode

++B2.35、updateMode

++B2.35、updateMode

++++立钻哥哥:更新模式

AnimatorUpdateMode updateMode;

++++该动画器的指定更新模式

 

 

 

 

 

++B2.36、velocity

++B2.36、velocity

++B2.36、velocity

++++立钻哥哥:速度

public Vector3 velocity;

++++获得上帧计算的阿凡达速度

 

 

 

 

 

 

 

#C3、Functions函数

#C3、Functions函数

++C3、Functions函数

++++C3.1、ApplyBuiltinRootMotion

++++C3.2、CrossFade

++++C3.3、CrossFadeInFixedTime

++++C3.4、GetAnimatorTransitionInfo

++++C3.5、GetBehaviour

++++C3.6、GetBehaviours

++++C3.7、GetBoneTransform

++++C3.8、GetBool

++++C3.9、GetCurrentAnimationClipState

++++C3.10、GetCurrentAnimatorStateInfo

++++C3.11、GetFloat

++++C3.12、GetIKHintPosition

++++C3.13、GetIKHintPositionWeight

++++C3.14、GetIKPosition

++++C3.15、GetIKPositionWeight

++++C3.16、GetIKRotation

++++C3.17、GetIKRotationWeight

++++C3.18、GetInteger

++++C3.19、GetLayerName

++++C3.20、GetLayerWeight

++++C3.21、GetNextAnimationClipState

++++C3.22、GetNextAnimatorStateInfo

++++C3.23、HasState

++++C3.24、InterruptMatchTarget

++++C3.25、IsInTransition

++++C3.26、IsParameterControlledByCurve

++++C3.27、MatchTarget

++++C3.28、Play

++++C3.29、PlayInFixedTime

++++C3.30、Rebind

++++C3.31、ResetTrigger

++++C3.32、SetBool

++++C3.33、SetFloat

++++C3.34、SetIKHintPosition

++++C3.35、SetIKHintPositionWeight

++++C3.36、SetIKPosition

++++C3.37、SetIKPositionWeight

++++C3.38、SetIKRotation

++++C3.39、SetIKRotationWeight

++++C3.40、SetInteger

++++C3.41、SetLayerWeight

++++C3.42、SetLookAtPosition

++++C3.43、SetLookAtWeight

++++C3.44、SetTarget

++++C3.45、SetTrigger

++++C3.46、StartPlayback

++++C3.47、StartRecording

++++C3.48、StopPlayback

++++C3.49、StopRecording

++++C3.50、Update

++++C3.51、YanlzXREngine.Animator.Functions

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第5张图片

 

 

++C3.1、ApplyBuiltinRootMotion

++C3.1、ApplyBuiltinRootMotion

++C3.1、ApplyBuiltinRootMotion

++++立钻哥哥:应用内置根运动

public void ApplyBuiltinRootMotion();

++++应用默认的根运动

++++使用OnAnimatorMoveStateMachineBehaviour.OnStateMove

 

 

 

 

 

++C3.2、CrossFade

++C3.2、CrossFade

++C3.2、CrossFade

++++立钻哥哥:淡入淡出

void CrossFade(string stateName, float transitionDuration, int layer=-1, float normalizedTime=float.NegativeInfinity);

void CrossFade(int stateNameHash, float transitionDuration, int layer=-1, float normalizedTime=float.NegativeInfinity);

++++[stateName]:目标状态的名字

++++[transitionDuration]:过渡的持续时间;该值是源状态的归一化时间

++++[normalizedTime]:当前目标状态的开始时间,该值是源状态的归一化时间,值在0~1之间

++++[layer]:包含目标状态的层索引

++++[stateNameHash]:目标状态的状态哈希

++++在当前状态和目标状态之间创建一个动态过滤

++++这两个状态需在同一层

++++不能在同步层改变当前状态,需要在索引层来改变它

 

 

 

 

 

++C3.3、CrossFadeInFixedTime

++C3.3、CrossFadeInFixedTime

++C3.3、CrossFadeInFixedTime

++++立钻哥哥:固定时间淡入淡出

public void CrossFadeInFixedTime(string stateName, float transitionDuration, int layer=-1, float fixedTime=0.0f);

public void CrossFadeInFixedTime(int stateNameHash, float transitionDuration, int layer=-1, float fixedTime=0.0f);

++++[stateName]:目标状态的名字

++++[transitionDuration]:过渡的持续时间;值为秒

++++[fixedTime]:当前目标状态的开始时间;如果没有显式被指定fixedTimefixedTime的值是float.NegativeInfinity,如果没有该状态没正播放,该状态将从开始播放,或将继续从当前时间继续播放并不会产生过渡

++++[layer]:包含目标状态的层索引;如果没有指定层或层是-1,给定名称或哈希找到的第一个状态将被播放

++++[stateNameHash]:目标状态的状态哈希;传入0将过渡到自己

++++animator.crossfade相同,但在目标状态的持续时间和偏移是在固定的时间

++++两个状态必须在同一层

++++不能再同步层改变当前状态,需要在索引层来改变它

 

 

 

 

 

++C3.4、GetAnimatorTransitionInfo

++C3.4、GetAnimatorTransitionInfo

++C3.4、GetAnimatorTransitionInfo

++++立钻哥哥:获取动画器过渡信息

AnimatorTransitionInfo GetAnimatorTransitionInfo(int layerIndex);

++++[layerIndex]:该层的索引

++++获取指定AnimatorController层的过渡信息

++++仅在过渡持续期间有效

 

 

 

 

 

++C3.5、GetBehaviour

++C3.5、GetBehaviour

++C3.5、GetBehaviour

++++立钻哥哥:获得行为

public T GetBehaviour();

++++返回匹配类型T或派生自T的首个状态机行为,如果没有找到返回null

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzRunBehaviour : StateMachineBehaviour{

    

    //OnStateUpdate is called at each Update frame between OnStateEnter and OnStateExit callback

    override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex){

        if(animator.GetComponent<Recorder>().enabled && !animator.GetComponent<Render>().isRecording){

            return;

        }    //立钻哥哥:if(animator.GetComponent<>()){}

 

        Transform transform = animator.GetComponent<Transform>();

 

        RaycastHit hitInfo;

        Vector3 dir = transform.TransformDirection(Vector3.forward);

        if(Physics.Raycast(transform.position + new Vector3(0, 1.5f, 0), dir, out hitInfo, 10)){

            if(hitInfo.collider.tag == MyObstacle){

                animator.GetBehaviour<YanlzSlideBehaviour>().target = transform.position + 1.25f * hitInfo.distance * dir;

                if(hitInfo.distance < 6){

                    animator.SetTrigger(MySlide);

                }    //立钻哥哥:if(hitInfo.distance<6){}

            }    //立钻哥哥:if(hitInfo.collider.tag==””){}

        }    //立钻哥哥:if(Physics.Raycast()){}

 

    }    //立钻哥哥:public override function OnStateUpdate(){}

 

}    //立钻哥哥:public class YanlzRunBehaviour{}

 

public class YanlzSlideBehaviour : StateMachineBehaviour{

    pubilc Vector3 target;

    public float slideMatchTargetStart = 0.11f;

    public float slideMatchTargetStop = 0.40f;

 

    //OnStateUpdate is called at each Update frame between OnStateEnter and OnStateExit callback

    override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex){

        animator.MatchTarget(target, new Quaternion(), AvatarTarget.Root, new MatchTargetWeightMask(new Vector3(1, 0, 1), 0), slideMatchTargetStart, slideMatchTargetStop);

    }    //立钻哥哥:override public void OnStateUpdate(){}

 

}    //立钻哥哥: public class YanlzSlideBehaviour{}

 

 

 

 

 

++C3.6、GetBehaviours

++C3.6、GetBehaviours

++C3.6、GetBehaviours

++++立钻哥哥:获得行为列表

public T[] GetBehaviours();

++++返回匹配类型T或派生自T的所有状态机行为,如果没有找到返回null

using UnityEngine;

using System.Collections;

using YanlzXREngine;

 

public class YanlzBreathBehaviour : StateMachineBehaviour{

    public bool fastBreath;

 

    //OnStateUpdate is called at each Update frame between OnStateEnter and OnStateExit callback

    override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex){

        animator.SetBool(MyFastBreath, fastBreath);

    }    //立钻哥哥:override public void OnStateUpdate(){}

 

}    //立钻哥哥:public class YanlzRunBehaviour{}

 

public class YanlzRunBehaviour : StateMachineBehaviour{

    

    //OnStateUpdate is called at each Update frame between OnStateEnter and OnStateExit callback

    override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex){

        YanlzBreathBehaviour[] breathBehaviours = animator.GetBehaviours<YanlzBreathBehaviour>();

        for(int i=0; i < breathBehaviours.Length(); i++){

            breathBehaviours[i].fastBreath = true;

        }    //立钻哥哥:for(){}

    }    //立钻哥哥:override public void OnStateUpdate(){}

 

}    //立钻哥哥:public class YanlzRunBehaviour{}

 

 

 

 

 

++C3.7、GetBoneTransform

++C3.7、GetBoneTransform

++C3.7、GetBoneTransform

++++立钻哥哥:获取骨骼变换

Transform GetBoneTransform(HumanBodyBones humanBoneId);

++++[humanBoneId]:要查询的人形骨骼

++++返回人形骨骼ID映射的变换

 

 

 

 

 

++C3.8、GetBool

++C3.8、GetBool

++C3.8、GetBool

++++立钻哥哥:获取布尔

bool GetBool(string name);

bool GetBool(int id);

++++[name]:参数的名字

++++[id]:参数的ID;该ID是由Animator.StringToHash生成

++++获取布尔参数的值

 

 

 

 

 

++C3.9、GetCurrentAnimationClipState

++C3.9、GetCurrentAnimationClipState

++C3.9、GetCurrentAnimationClipState

++++立钻哥哥:获取当前动画剪辑状态

AnimationInfo[] GetCurrentAnimationClipState(int layerIndex);

++++[layerIndex]:该层的索引

++++获取当前状态播放的当前动画信息列表

 

 

 

 

 

++C3.10、GetCurrentAnimatorStateInfo

++C3.10、GetCurrentAnimatorStateInfo

++C3.10、GetCurrentAnimatorStateInfo

++++立钻哥哥:获取当前动画器状态信息

AnimatorStateInfo GetCurrentAnimatorStateInfo(int layerIndex);

++++[layerIndex]:该层的索引

++++获取指定的AnimatorController层的当前状态信息

 

 

 

 

 

++C3.11、GetFloat

++C3.11、GetFloat

 

 

 

 

 

 

 

 

 

#E5、立钻哥哥对Animator类的拓展

#E5、立钻哥哥对Animator类的拓展

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第6张图片

++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html

++++[Unity快速入门]:https://blog.csdn.net/VRunSoftYanlz/article/details/105776475

++++[UnityAPI目录]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533906

++++[Application应用]:https://blog.csdn.net/VRunSoftYanlz/article/details/106086327

++++[Object对象]:https://blog.csdn.net/VRunSoftYanlz/article/details/106202194

++++[GameObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106223815

++++[MonoBehaviour]:https://blog.csdn.net/VRunSoftYanlz/article/details/106533256

++++[Component组件]:https://blog.csdn.net/VRunSoftYanlz/article/details/106367004

++++[Transform变换]:https://blog.csdn.net/VRunSoftYanlz/article/details/106607761

++++[Camera摄像机]:https://blog.csdn.net/VRunSoftYanlz/article/details/106148837

++++[Shader着色器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106321040

++++[Material材质]:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303

++++[Physics物理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106268062

++++[Collider碰撞器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106696886

++++[Rigidbody刚体]:https://blog.csdn.net/VRunSoftYanlz/article/details/106698042

++++[Joint关节]:https://blog.csdn.net/VRunSoftYanlz/article/details/106771226

++++[RaycastHit]:https://blog.csdn.net/VRunSoftYanlz/article/details/106292370

++++[ParticleSystem]:https://blog.csdn.net/VRunSoftYanlz/article/details/106341995

++++[WWW万维网]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412890

++++[LineRenerer]:https://blog.csdn.net/VRunSoftYanlz/article/details/106306388

++++[WheelCollider]:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217

++++[MovieTexture]:https://blog.csdn.net/VRunSoftYanlz/article/details/106434063

++++[Input输入]:https://blog.csdn.net/VRunSoftYanlz/article/details/106843487

++++[Resources资源]:https://blog.csdn.net/VRunSoftYanlz/article/details/106818524

++++[Network网络]:https://blog.csdn.net/VRunSoftYanlz/article/details/106795026

++++[Collision碰撞]:https://blog.csdn.net/VRunSoftYanlz/article/details/106697669

++++[Matrix4x4矩阵]:https://blog.csdn.net/VRunSoftYanlz/article/details/106504027

++++[Renerer渲染器]:https://blog.csdn.net/VRunSoftYanlz/article/details/106481994

++++[AudioSource]:https://blog.csdn.net/VRunSoftYanlz/article/details/106462679

++++[AudioClip]:https://blog.csdn.net/VRunSoftYanlz/article/details/106448955

++++[Texture纹理]:https://blog.csdn.net/VRunSoftYanlz/article/details/106448589

++++[AssetBundle]:https://blog.csdn.net/VRunSoftYanlz/article/details/106412190

++++[ScriptableObject]:https://blog.csdn.net/VRunSoftYanlz/article/details/106392769

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第7张图片

 

 

 

 

 

@@提示:有些博客可能只是开了头,如果感兴趣的同学,可以“点赞”或“评论区留言”,只要关注的同学多了,那就会继续完善哟!(“++==”,表示没有写完的,如果关注度不高就不完善了;“++ok++”,表示此篇博客已经完成,是阶段性完整的!)

 

 

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第8张图片

++++VR云游戏=Unity+SteamVR+云技术+5G+AI;(说明:AI人工智能不是我们的主要研究技术,只是了解一下,领略一下有风的感觉!但是,VR是我们的研究重点

++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html

++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html

++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html

++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html

++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html

++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/

 

 

 

 

 

 

【XR游戏开发QQ群:784477094

《UnityAPI.Animator动画器》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+Animator+avatar+CrossFade+Key+立钻哥哥++OK++)_第9张图片

++立钻哥哥推荐的拓展学习链接(Link_Url)

立钻哥哥推荐的拓展学习链接(Link_Url)

++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/

++++虚拟现实VR资讯: https://blog.csdn.net/VRunSoftYanlz/article/details/89165846

++++HTC_VIVE开发基础https://blog.csdn.net/VRunSoftYanlz/article/details/81989970

++++Oculus杂谈https://blog.csdn.net/VRunSoftYanlz/article/details/82469850

++++Oculus安装使用https://blog.csdn.net/VRunSoftYanlz/article/details/82718982

++++Unity+SteamVR=>VRhttps://blog.csdn.net/VRunSoftYanlz/article/details/88809370

++++Unity减少VR晕眩症https://blog.csdn.net/VRunSoftYanlz/article/details/89115518

++++SteamVR简介https://blog.csdn.net/VRunSoftYanlz/article/details/86484254

++++SteamVR脚本功能分析https://blog.csdn.net/VRunSoftYanlz/article/details/86531480

++++SteamVR2.0开发指南https://blog.csdn.net/VRunSoftYanlz/article/details/86618187

++++SteamVR2.2.0开发指南https://blog.csdn.net/VRunSoftYanlz/article/details/88784527

++++SteamVR2.2.0快速入门https://blog.csdn.net/VRunSoftYanlz/article/details/88833579

++++SteamVR2.2.0交互系统https://blog.csdn.net/VRunSoftYanlz/article/details/89199778

++++SteamVR2.2.0传送机制https://blog.csdn.net/VRunSoftYanlz/article/details/89390866

++++SteamVR2.2.0教程(一)https://blog.csdn.net/VRunSoftYanlz/article/details/89324067

++++SteamVR2.2.0教程(二)https://blog.csdn.net/VRunSoftYanlz/article/details/89894097

++++SteamVR_Skeleton_Poserhttps://blog.csdn.net/VRunSoftYanlz/article/details/89931725

++++SteamVR实战之PMCorehttps://blog.csdn.net/VRunSoftYanlz/article/details/89463658

++++SteamVR/Extrashttps://blog.csdn.net/VRunSoftYanlz/article/details/86584108

++++SteamVR/Inputhttps://blog.csdn.net/VRunSoftYanlz/article/details/86601950

++++OpenXR简介https://blog.csdn.net/VRunSoftYanlz/article/details/85726365

++++VRTK杂谈https://blog.csdn.net/VRunSoftYanlz/article/details/82562993

++++VRTK快速入门(杂谈)https://blog.csdn.net/VRunSoftYanlz/article/details/82955267

++++VRTK官方示例(目录)https://blog.csdn.net/VRunSoftYanlz/article/details/82955410

++++VRTK代码结构(目录)https://blog.csdn.net/VRunSoftYanlz/article/details/82780085

++++VRTK(SceneResources)https://blog.csdn.net/VRunSoftYanlz/article/details/82795400

++++VRTK_ControllerEventshttps://blog.csdn.net/VRunSoftYanlz/article/details/83099512

++++VRTK_InteractTouchhttps://blog.csdn.net/VRunSoftYanlz/article/details/83120220

++++虚拟现实行业应用https://blog.csdn.net/VRunSoftYanlz/article/details/88360157

++++Steam平台上的VRhttps://blog.csdn.net/VRunSoftYanlz/article/details/88960085

++++Steam平台热销VRhttps://blog.csdn.net/VRunSoftYanlz/article/details/89007741

++++VR实验:以太网帧的构成https://blog.csdn.net/VRunSoftYanlz/article/details/82598140

++++实验四:存储器扩展实验https://blog.csdn.net/VRunSoftYanlz/article/details/87834434

++++FrameVR示例V0913https://blog.csdn.net/VRunSoftYanlz/article/details/82808498

++++FrameVR示例V1003https://blog.csdn.net/VRunSoftYanlz/article/details/83066516

++++SwitchMachineV1022https://blog.csdn.net/VRunSoftYanlz/article/details/83280886

++++PlaySceneManagerV1022https://blog.csdn.net/VRunSoftYanlz/article/details/83280886

++++Unity5.x用户手册https://blog.csdn.net/VRunSoftYanlz/article/details/81712741

++++Unity面试题ABChttps://blog.csdn.net/vrunsoftyanlz/article/details/78630687

++++Unity面试题Dhttps://blog.csdn.net/VRunSoftYanlz/article/details/78630838

++++Unity面试题Ehttps://blog.csdn.net/vrunsoftyanlz/article/details/78630913

++++Unity面试题Fhttps://blog.csdn.net/VRunSoftYanlz/article/details/78630945

++++Cocos2dx面试题https://blog.csdn.net/VRunSoftYanlz/article/details/78630967

++++禅道[zentao]https://blog.csdn.net/VRunSoftYanlz/article/details/83964057

++++Lua快速入门篇(Xlua拓展):https://blog.csdn.net/VRunSoftYanlz/article/details/81173818

++++Lua快速入门篇(XLua教程):https://blog.csdn.net/VRunSoftYanlz/article/details/81141502

++++Lua快速入门篇(基础概述)https://blog.csdn.net/VRunSoftYanlz/article/details/81041359

++++框架知识点https://blog.csdn.net/VRunSoftYanlz/article/details/80862879

++++游戏框架(UI框架夯实篇)https://blog.csdn.net/vrunsoftyanlz/article/details/80781140

++++游戏框架(初探篇)https://blog.csdn.net/VRunSoftYanlz/article/details/80630325

++++.Net框架设计https://blog.csdn.net/VRunSoftYanlz/article/details/87401225

++++从零开始学架构https://blog.csdn.net/VRunSoftYanlz/article/details/88095895

++++设计模式简单整理https://blog.csdn.net/vrunsoftyanlz/article/details/79839641

++++专题:设计模式(精华篇)https://blog.csdn.net/VRunSoftYanlz/article/details/81322678

++++U3D小项目参考https://blog.csdn.net/vrunsoftyanlz/article/details/80141811

++++Unity小游戏算法分析https://blog.csdn.net/VRunSoftYanlz/article/details/87908365

++++Unity案例(Vehicle)https://blog.csdn.net/VRunSoftYanlz/article/details/82355876

++++UML类图https://blog.csdn.net/vrunsoftyanlz/article/details/80289461

++++PowerDesigner简介https://blog.csdn.net/VRunSoftYanlz/article/details/86500084

++++Unity知识点0001https://blog.csdn.net/vrunsoftyanlz/article/details/80302012

++++Unity知识点0008https://blog.csdn.net/VRunSoftYanlz/article/details/81153606

++++U3D_Shader编程(第一篇:快速入门篇)https://blog.csdn.net/vrunsoftyanlz/article/details/80372071

++++U3D_Shader编程(第二篇:基础夯实篇)https://blog.csdn.net/vrunsoftyanlz/article/details/80372628

++++Unity引擎基础https://blog.csdn.net/vrunsoftyanlz/article/details/78881685

++++Unity面向组件开发https://blog.csdn.net/vrunsoftyanlz/article/details/78881752

++++Unity物理系统https://blog.csdn.net/vrunsoftyanlz/article/details/78881879

++++Unity2D平台开发https://blog.csdn.net/vrunsoftyanlz/article/details/78882034

++++UGUI基础https://blog.csdn.net/vrunsoftyanlz/article/details/78884693

++++UGUI进阶https://blog.csdn.net/vrunsoftyanlz/article/details/78884882

++++UGUI综合https://blog.csdn.net/vrunsoftyanlz/article/details/78885013

++++Unity动画系统基础https://blog.csdn.net/vrunsoftyanlz/article/details/78886068

++++Unity动画系统进阶https://blog.csdn.net/vrunsoftyanlz/article/details/78886198

++++Navigation导航系统https://blog.csdn.net/vrunsoftyanlz/article/details/78886281

++++Unity特效渲染https://blog.csdn.net/vrunsoftyanlz/article/details/78886403

++++Unity数据存储https://blog.csdn.net/vrunsoftyanlz/article/details/79251273

++++Unity中Sqlite数据库https://blog.csdn.net/vrunsoftyanlz/article/details/79254162

++++WWW类和协程https://blog.csdn.net/vrunsoftyanlz/article/details/79254559

++++Unity网络https://blog.csdn.net/vrunsoftyanlz/article/details/79254902

++++Unity资源加密https://blog.csdn.net/VRunSoftYanlz/article/details/87644514

++++PhotonServer简介https://blog.csdn.net/VRunSoftYanlz/article/details/86652770

++++编写Photon游戏服务器https://blog.csdn.net/VRunSoftYanlz/article/details/86682935

++++C#事件https://blog.csdn.net/vrunsoftyanlz/article/details/78631267

++++C#委托https://blog.csdn.net/vrunsoftyanlz/article/details/78631183

++++C#集合https://blog.csdn.net/vrunsoftyanlz/article/details/78631175

++++C#泛型https://blog.csdn.net/vrunsoftyanlz/article/details/78631141

++++C#接口https://blog.csdn.net/vrunsoftyanlz/article/details/78631122

++++C#静态类https://blog.csdn.net/vrunsoftyanlz/article/details/78630979

++++C#中System.String类https://blog.csdn.net/vrunsoftyanlz/article/details/78630945

++++C#数据类型https://blog.csdn.net/vrunsoftyanlz/article/details/78630913

++++Unity3D默认的快捷键https://blog.csdn.net/vrunsoftyanlz/article/details/78630838

++++游戏相关缩写https://blog.csdn.net/vrunsoftyanlz/article/details/78630687

++++UnityAPI.Rigidbody刚体https://blog.csdn.net/VRunSoftYanlz/article/details/81784053

++++UnityAPI.Material材质https://blog.csdn.net/VRunSoftYanlz/article/details/81814303

++++UnityAPI.Android安卓https://blog.csdn.net/VRunSoftYanlz/article/details/81843193

++++UnityAPI.AndroidJNI安卓JNIhttps://blog.csdn.net/VRunSoftYanlz/article/details/81879345

++++UnityAPI.Transform变换https://blog.csdn.net/VRunSoftYanlz/article/details/81916293

++++UnityAPI.WheelCollider轮碰撞器https://blog.csdn.net/VRunSoftYanlz/article/details/82356217

++++UnityAPI.Resources资源https://blog.csdn.net/VRunSoftYanlz/article/details/83155518

++++JSON数据结构https://blog.csdn.net/VRunSoftYanlz/article/details/82026644

++++CocosStudio快速入门https://blog.csdn.net/VRunSoftYanlz/article/details/82356839

++++Unity企业内训(目录)https://blog.csdn.net/VRunSoftYanlz/article/details/82634668

++++Unity企业内训(第1讲)https://blog.csdn.net/VRunSoftYanlz/article/details/82634733

++++Unity企业内训(第2讲)https://blog.csdn.net/VRunSoftYanlz/article/details/82861180

++++Unity企业内训(第3讲)https://blog.csdn.net/VRunSoftYanlz/article/details/82927699

++++Unity企业内训(第4讲)https://blog.csdn.net/VRunSoftYanlz/article/details/83479776

++++Unity企业内训(第5讲)https://blog.csdn.net/VRunSoftYanlz/article/details/83963811

++++Unity企业内训(第6讲)https://blog.csdn.net/VRunSoftYanlz/article/details/84207696

++++钻哥带您了解产品原型https://blog.csdn.net/VRunSoftYanlz/article/details/87303828

++++插件https://blog.csdn.net/VRunSoftYanlz/article/details/83963905

++++计算机组成原理(教材篇)https://blog.csdn.net/VRunSoftYanlz/article/details/82719129

++++5G接入:云计算和雾计算https://blog.csdn.net/VRunSoftYanlz/article/details/88372718

++++云计算通俗讲义https://blog.csdn.net/VRunSoftYanlz/article/details/88652803

++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz

--_--VRunSoft:lovezuanzuan--_--

--_--VRunSoft:lovezuanzuan--_--

你可能感兴趣的:(VR云游戏实战零碎技术点,Unity开发基础,UnityAPI,Yanlz,VR云游戏,Unity,Animator,立钻哥哥)