Ejemplo n.º 1
0
 private void OnTriggerEnter(Collider col)
 {
     if (col.tag == "Goal")
     {
         this.GetComponent <PlayerMove>().enabled = false;
         aController.PlaySE(goalClip);
         lManager.SetIsGoal();
         animator.SetTrigger("Goal");
         lManager.DisplayTitleButton();
     }
     else if (col.name == "Shoes(Clone)")
     {
         aController.PlaySE(speedClip);
         speed = 35f;
         GameObject.Find("Camera_2").GetComponent <Camera>().enabled = true;
         StartCoroutine("SetPreSpeed");
         Destroy(col.gameObject);
     }
     else if ((col.name == "Rock(Clone)" || col.name == "Rock_2(Clone)" || col.name == "Rock_3(Clone)") && isGetStar == false)
     {
         aController.PlaySE(hitClip);
         animator.SetTrigger("Hit");
         speed = 0f;
         StartCoroutine("SetPreSpeed");
         Destroy(col.gameObject);
         isCanMove = false;
     }
     else if (col.name == "Star(Clone)")
     {
         aController.PlaySE(starClip);
         GetComponentInChildren <Light>().enabled = true;
         isGetStar = true;
         StartCoroutine("SetPreState");
         Destroy(col.gameObject);
     }
 }