// Press Button void OnTriggerEnter2D(Collider2D other) { animator.SetBool("isDown", true); GetComponent <BoxCollider2D>().enabled = false; gateController.OpenGate(); }
public void UpdateRingText() { if (NumRing - CurrentRing <= 0) { _GateController.OpenGate(); } RingText.text = "X" + (NumRing - CurrentRing).ToString(); }
// 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(); } }
// Open the gate when the conditions are met void Finish() { isFinished = true; gateController.OpenGate(); }