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

        gateController.OpenGate();
    }
예제 #2
0
 public void UpdateRingText()
 {
     if (NumRing - CurrentRing <= 0)
     {
         _GateController.OpenGate();
     }
     RingText.text = "X" + (NumRing - CurrentRing).ToString();
 }
예제 #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();
        }
    }
예제 #4
0
 // Open the gate when the conditions are met
 void Finish()
 {
     isFinished = true;
     gateController.OpenGate();
 }