本文整理匯總了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);
}