本文整理汇总了C#中AnimationType类的典型用法代码示例。如果您正苦于以下问题:C#AnimationType类的具体用法?C#AnimationType怎么用?C#AnimationType使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:Attack
///
///Performananimationofthegiventypeandindex.Noanimationwillbeplayediftheanimation
///isnotpresent.Theindexgivenistheindexoftheanimationinthearrayspecifiedonthe
///prefab,nottheindexoftheanimationoutofalltheanimations
///
///
Thetypeofanimationtoplay
///Theindexoftheanimation
publicvoidAttack(AnimationTypetype,intindex)
{
AnimationClip[]animations;
switch(type)
{
caseAnimationType.Spell:
animations=_spellAnimations;
break;
caseAnimationType.Misc:
animations=_miscAnimations;
break;
default:
animations=_meleeAnimations;
break;
}
try
{
animation.Play(animations[index].name);
}
catch
{
Debug.LogWarning("Thereisno"+type+"animation"+"indexedat"+index+".");
}
}
原文链接:http://www.jxszl.com/biancheng/C/556535.html