當前位置: 首頁>>代碼示例>>C#>>正文


C# Animation.SyncLayer方法代碼示例

本文整理匯總了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 );
		}
	}
開發者ID:fengqk,項目名稱:Art,代碼行數:20,代碼來源:ChpAnimation.cs

示例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);
    }
開發者ID:zhutaorun,項目名稱:unitygame,代碼行數:20,代碼來源:AgentLocomotion.cs

示例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);
    }
開發者ID:SymphonyX,項目名稱:VAST,代碼行數:29,代碼來源:SoldierLocomotion.cs


注:本文中的UnityEngine.Animation.SyncLayer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。