本文整理汇总了C#中UnityEngine.Animation.SyncLayer方法的典型用法代码示例。如果您正苦于以下问题:C# Animation.SyncLayer方法的具体用法?C# Animation.SyncLayer怎么用?C# Animation.SyncLayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Animation
的用法示例。
在下文中一共展示了Animation.SyncLayer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetAnis
public static void SetAnis( Animation _animation, AnimationClip[] anisIn, int layerIn, WrapMode wrapModeIn, bool bSyncLayer = false )
{
for( int i = 0; i < anisIn.Length; i++ ) {
if( anisIn[ i ] != null ) {
try {
if( _animation.GetClip( anisIn[ i ].name ) != null ) {
_animation[ anisIn[ i ].name ].wrapMode = wrapModeIn;
_animation[ anisIn[ i ].name ].layer = layerIn;
}
} catch( System.Exception ex ) {
Debug.LogWarning( ex.Message + anisIn[ i ].name + " From: " + _animation.gameObject.name );
}
}
}
if( bSyncLayer ) {
_animation.SyncLayer( layerIn );
}
}
示例2: AnimationSetup
private void AnimationSetup()
{
anim = GetComponent<Animation>();
// 把walk和run动画放到同一层,然后同步他们的速度。
anim["Walk"].layer = 1;
anim["Run"].layer = 1;
anim.SyncLayer(1);
//设置“跳跃”,“爬楼梯”,“下楼梯”的动画模式和速度
anim["RunJump"].wrapMode = WrapMode.ClampForever;
anim["RunJump"].speed = 2;
anim["Ladder Up"].wrapMode = WrapMode.ClampForever;
anim["Ladder Up"].speed = 2;
anim["Ladder Down"].wrapMode = WrapMode.ClampForever;
anim["Ladder Down"].speed = 2;
//初始化动画状态为Idle
anim.CrossFade("Idle", 0.1f, PlayMode.StopAll);
}
示例3: AnimationSetup
private void AnimationSetup()
{
anim_ = GetComponent("Animation") as Animation;
// loop in sync
anim_["Walk"].layer = 1;
anim_["Run"].layer = 1;
anim_.SyncLayer(1);
// speed up & play once
anim_["RunJump"].wrapMode = WrapMode.ClampForever;
anim_["RunJump"].speed = 2;
anim_["Ladder_Up"].wrapMode = WrapMode.ClampForever;
anim_["Ladder_Up"].speed = 2;
anim_["Ladder_Down"].wrapMode = WrapMode.ClampForever;
anim_["Ladder_Down"].speed = 2;
if ( isADAPTMan_ )
{
anim_["Turn180"].wrapMode = WrapMode.ClampForever;
anim_["Turn180"].speed = ladderSpeed_;
anim_["Turn180-down"].wrapMode = WrapMode.ClampForever;
anim_["Turn180-down"].speed = ladderSpeed_;
anim_["Walk_Up"].wrapMode = WrapMode.ClampForever;
anim_["Walk_Up"].speed = ladderSpeed_;
}
anim_.CrossFade("Idle", blendTime, PlayMode.StopAll);
}