Exemple #1
0
    // Press Button
    void OnTriggerEnter2D(Collider2D other)
    {
        animator.SetBool("isDown", true);
        GetComponent <BoxCollider2D>().enabled = false;

        gateController.OpenGate();
    }
Exemple #2
0
 public void UpdateRingText()
 {
     if (NumRing - CurrentRing <= 0)
     {
         _GateController.OpenGate();
     }
     RingText.text = "X" + (NumRing - CurrentRing).ToString();
 }
Exemple #3
0
    // Press Button
    void OnTriggerEnter2D(Collider2D other)
    {
        // If colliding object is heavier than 1.5
        if (GameObject.Find(other.name).GetComponent <Rigidbody2D>().mass >= 1.5)
        {
            animator.SetBool("isDown", true);
            GetComponent <BoxCollider2D>().enabled = false;

            gateController.OpenGate();
        }
    }
Exemple #4
0
 // Open the gate when the conditions are met
 void Finish()
 {
     isFinished = true;
     gateController.OpenGate();
 }