예제 #1
0
    void Start()
    {
        dl = GameObject.FindGameObjectWithTag("Dog").GetComponent <DogLocomotion>();
        if (!pauseMenuFull)
        {
            pauseMenuFull = GameObject.FindGameObjectWithTag("PauseMenu");
        }
        if (pauseMenuFull)
        {
            pauseMenuMain = pauseMenuFull.transform.GetChild(0).gameObject;

            optionsMenu = pauseMenuFull.transform.GetChild(1).gameObject;
            exitMenu    = pauseMenuFull.transform.GetChild(2).gameObject;

            for (int i = 0; i < pauseMenuFull.transform.childCount; i++)
            {
                pauseMenuFull.transform.GetChild(i).gameObject.SetActive(false);
            }
        }
        if (!camCon)
        {
            camCon = GameObject.FindWithTag("Player").GetComponentInChildren <CameraController>();
        }
        if (!charMov)
        {
            charMov = GameObject.FindWithTag("Player").GetComponent <CharacterMovement>();
        }
    }
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     dogLocomotion = animator.GetComponent <DogLocomotion> ();
     dogLocomotion.StartIdleTurn();
 }