當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。