当前位置: 首页>>代码示例>>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;未经允许,请勿转载。