Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.name == "Trigger 1")
     {
         Debug.Log(125);
         levelControl.Action_one();
     }
     else if (collision.name == "Trigger 2")
     {
         Debug.Log(125);
         levelControl.Action_two();
     }
     else if (collision.name == "Trigger 3")
     {
         Debug.Log(125);
         levelControl.Action_three();
     }
     else if (collision.name == "Trigger 4")
     {
         Debug.Log(125);
         levelControl.Action_four();
     }
     else if (collision.name == "FinishLine")
     {
         buttons.EducationalScene();
     }
     if (collision.gameObject.tag == "Pushable")
     {
         FindObjectOfType <AudioManager>().Play("Pushable Object");
     }
     else if (collision.gameObject.tag == "Pushable Exit")
     {
         FindObjectOfType <AudioManager>().Stop("Pushable Object");
     }
     if (collision.gameObject.tag == "Current Enter")
     {
         FindObjectOfType <AudioManager>().Play("Currents");
     }
     if (collision.gameObject.tag == "Current Exit")
     {
         FindObjectOfType <AudioManager>().Stop("Currents");
     }
     if (collision.gameObject.tag == "Can Rings" && canRings == null)
     {
         stuck    = true;
         canRings = collision.gameObject;
         Destroy(canRings.GetComponent <Rigidbody2D>());
         canRings.transform.parent = transform;
     }
 }