Пример #1
0
    public bool PlayAnimation(AnimationActor eActiveAni, bool bLoop = false)
    {
        bool bResult = false;
        if (AnimatorIsPlaying() == false)
        {
            if (eActiveAni == AnimationActor.ANI_DIE1 ||
                eActiveAni == AnimationActor.ANI_DIE2)
            {
                bResult = false;
            }
            else
            {
                //if (bLoop)
                //{
                //    anim.CrossFade(ClipName[(int)eActiveAni]);
                //}
                //else
                {
                    anim.Play(ClipName[(int)AnimationActor.ANI_IDLE]);
                }

                bResult = false;
            }
        }
        else
        {
            anim.Play(ClipName[(int)eActiveAni]);
            bResult = true;
        }

        return bResult;
    }
Пример #2
0
    public bool IsPlaying(AnimationActor eActiveAni)
    {
        //return anim.IsPlaying(ClipName[(int)eActiveAni]);
        if (anim.GetCurrentAnimatorStateInfo(0).IsName(ClipName[(int)eActiveAni]))
        {
            return AnimatorIsPlaying();
        }

        return false;
    }