// Update is called once per frame void Update() { if (isActive == false && (Button1.GetComponent <Object_Button_Trigger>().activated == true || Button2.GetComponent <Object_Button_Trigger>().activated == true)) { scrambleZone.SetActive(false); Timer = 8; isActive = true; Door1.GetComponent <Object_Door>().DoorSwitch(); Door2.GetComponent <Object_Door>().DoorSwitch(); bopity = true; } if (isActive) { Timer -= Time.deltaTime; if (Timer <= 2 && bopity == true) { BipBop.Play(); bopity = false; } if (Timer <= 0) { scrambleZone.SetActive(true); isActive = false; Door1.GetComponent <Object_Door>().DoorSwitch(); Door2.GetComponent <Object_Door>().DoorSwitch(); } } }
void Start() { sr = gameObject.GetComponent <SpriteRenderer>(); if (Lift) { oc = Lift.GetComponent <open_close>(); } if (Door1) { oc1 = Door1.GetComponent <open_close>(); oc2 = Door2.GetComponent <open_close>(); } }