当前位置: 首页>>代码示例>>C#>>正文


C# Animation.GetClipCount方法代码示例

本文整理汇总了C#中UnityEngine.Animation.GetClipCount方法的典型用法代码示例。如果您正苦于以下问题:C# Animation.GetClipCount方法的具体用法?C# Animation.GetClipCount怎么用?C# Animation.GetClipCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.Animation的用法示例。


在下文中一共展示了Animation.GetClipCount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animation>();
     if(anim != null && anim.GetClipCount() > 0)
     {
         anim.wrapMode = WrapMode.Loop;
         clipid = anim.GetClipCount() - 1;
         anim.Play("" + clipid);
     }
 }
开发者ID:Gh0stBlade,项目名称:TR2-Level-Viewer,代码行数:11,代码来源:DefaultStatePlayer.cs

示例2: Start

    // Use this for initialization
    void Start()
    {
        m_Animation = GetComponent<Animation>();
        On = m_Animation.GetClipCount() - 1;
        m_CurrentKeyState = Off;

        m_Animation.wrapMode = WrapMode.ClampForever;
        m_Animation.Play(""+ m_CurrentKeyState);
    }
开发者ID:Gh0stBlade,项目名称:TR2-Level-Viewer,代码行数:10,代码来源:DoorStatePlayer.cs

示例3: Awake

    //public void Move(int InputAxis)
    //{
    //    directionInput = InputAxis;
    //    GetComponent<Rigidbody2D>().velocity = new Vector2(InputAxis * maxSpeed, GetComponent<Rigidbody2D>().velocity.y);
    //}

    //public void Jump(bool IsJump)
    //{
    //    if (!grounded)
    //        return;
    //    if (grounded)
    //    {
    //        GetComponent<Rigidbody2D>().AddForce(new Vector2(0f, jumpForce));
    //    }
    //}

    void Awake()
    {
        anim = GetComponent<Animation>();
        respawnPoint = transform.position;

        animations = new string[anim.GetClipCount()];
        int i = 0;
        foreach (AnimationState a in anim)
        {
            animations[i] = a.name;
            i++;
        }
    }
开发者ID:JerryStreith,项目名称:DangerLands,代码行数:29,代码来源:characterController.cs

示例4: Awake

    void Awake()
    {

        // Setting up references.
        groundCheck = transform.Find("groundCheck");
        anim = GetComponent<Animation>();
        respawnPoint = transform.position;

        animations = new string[anim.GetClipCount()];
        int i = 0;
        foreach (AnimationState a in anim)
        {
            animations[i] = a.name;
            i++;
        }
    }
开发者ID:JerryStreith,项目名称:DangerLands,代码行数:16,代码来源:PlayerControl.cs

示例5: OnInspectorGUI

    public override void OnInspectorGUI()
    {
        m_Object	= target as AnimationUnityEvent;
        m_Animation	= m_Object.GetComponent<Animation> ();
        m_ClipCount	= m_Animation.GetClipCount ();
        m_ClipNames	= new string[m_ClipCount];
        int i=0;
        foreach (AnimationState state in m_Animation) {
            m_ClipNames[i++]	= state.name;
        }

        serializedObject.Update ();
        base.OnInspectorGUI ();
        showAnimationsPopup ();
        showPropaties ();
        serializedObject.ApplyModifiedProperties ();
    }
开发者ID:2ty,项目名称:race3d,代码行数:17,代码来源:AnimationUnityEventEditor.cs

示例6: SetAnimation

	public static AnimationClip SetAnimation(Animation tarAnimation, int tarIndex, AnimationClip srcClip)
	{
		int nCount = 0;
		AnimationClip[]	backClip = new AnimationClip[tarAnimation.GetClipCount() - tarIndex + 1];

		foreach (AnimationState clip in tarAnimation)
		{
			if (tarIndex == nCount)
				tarAnimation.RemoveClip(clip.clip);
			if (tarIndex < nCount)
			{
				backClip[nCount - tarIndex - 1] = clip.clip;
				tarAnimation.RemoveClip(clip.clip);
			}
		}

		tarAnimation.AddClip(srcClip, srcClip.name);
		for (int n = 0; n < backClip.Length; n++)
			tarAnimation.AddClip(backClip[n], backClip[n].name);
		return srcClip;
	}
开发者ID:Kinderril,项目名称:p3,代码行数:21,代码来源:NgAnimation.cs

示例7: Start

 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animation>();
     Debug.Log (anim.GetClipCount());
 }
开发者ID:emeliesvensson,项目名称:CIU265-virtualPet,代码行数:6,代码来源:TriggerAnimations.cs


注:本文中的UnityEngine.Animation.GetClipCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。