本文整理汇总了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);
}
}
示例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);
}
示例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++;
}
}
示例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++;
}
}
示例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 ();
}
示例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;
}
示例7: Start
// Use this for initialization
void Start()
{
anim = GetComponent<Animation>();
Debug.Log (anim.GetClipCount());
}