Example #1
0
 void JoinAnimation()
 {
     if (m_CurrentAnimation != null)
     {
         Destroy(m_CurrentAnimation);
     }
     m_CurrentAnimation = m_DB.GetAnimationById(m_PlayerNumber);
     m_CurrentAnimation = Instantiate(m_CurrentAnimation, transform.position, transform.rotation) as GameObject;
     m_CurrentAnimation.transform.parent = transform;
 }
Example #2
0
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        m_PlayerAnimationDB = animator.GetComponent <PlayerAnimationDatabase>();
        m_PlayerState       = animator.GetComponent <PlayerState>();
        if (m_PlayerState.m_CurrentAnimation != null)
        {
            Destroy(m_PlayerState.m_CurrentAnimation);
        }

        m_CurrentAnimation = m_PlayerAnimationDB.GetAnimationById(EXTINGUISHER_IDLE);
        m_CurrentAnimation = Instantiate(m_CurrentAnimation, animator.rootPosition, animator.transform.rotation) as GameObject;
        m_CurrentAnimation.transform.parent = animator.transform;
        m_PlayerState.m_CurrentAnimation    = m_CurrentAnimation;
    }