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; }
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); }
public void PlayAnim(EPlayerAnimType animType) { if (m_curAnimType == animType) { return; } m_curAnimType = animType; if (m_animator != null) { m_animator.Play(GetAnimName(m_curAnimType)); } }
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; }