Пример #1
0
    private void InitAnimator(GameObject player)
    {
        m_animator = ObjectCommon.GetChildComponent <Animator>(player, "player");
        if (m_animator == null)
        {
            Debug.LogError("Animator cannot find!!");
        }
        //todo:Load Controller

        m_curAnimType = EPlayerAnimType.Idle;
    }
Пример #2
0
    private string GetAnimName(EPlayerAnimType animType)
    {
        GamePlayerAnimData data = null;

        m_gamePlayerAnimDataDic.TryGetValue((byte)animType, out data);
        if (data == null)
        {
            Debug.LogError("Anim data is null    :   " + animType);
            return(string.Empty);
        }

        return(data.AnimName);
    }
Пример #3
0
    public void PlayAnim(EPlayerAnimType animType)
    {
        if (m_curAnimType == animType)
        {
            return;
        }

        m_curAnimType = animType;

        if (m_animator != null)
        {
            m_animator.Play(GetAnimName(m_curAnimType));
        }
    }
Пример #4
0
    public bool IsPlaying(EPlayerAnimType animType)
    {
        AnimatorStateInfo info = m_animator.GetCurrentAnimatorStateInfo(0);

        return(info.IsName(GetAnimName(animType)));
    }
 public GamePlayerAnimData(EPlayerAnimType animType, string animName)
 {
     m_animName = animName;
     m_animType = animType;
 }