// Start is called before the first frame update void Start() { // creates new variables allButtonsReady = new List <bool>(); for (int i = 0; i < myActivators.Capacity; i++) { allButtonsReady.Add(false); } // creates the event buttonPressedEvent = new ButtonPressedEvent(); buttonUnPressedEvent = new ButtonUnPressedEvent(); // adds self as listener to button pressed event EventManager.AddButtonPressedListeners(AreAllMyButtonsPressed); EventManager.AddButtonUnPressedListeners(AnyUnPressedButtons); // for those using the or door //anyButtonsOn = false; // gets audio object myAudio = gameObject.GetComponent <AudioSource>(); // gets current y for door movement startingposition = transform.localPosition.y; // updates door hight for special doors doorHight += specialDropDistance; dropSpeed += specialDropDistance / 2; }
// Start is called before the first frame update void Start() { myAudio = gameObject.GetComponent <AudioSource>(); // handles extra problems // creates new event buttonPressedEvent = new ButtonPressedEvent(); // creates new event buttonUnPressedEvent = new ButtonUnPressedEvent(); // makes new list cubeTouching = false; playerTouching = false; secondTouching = false; // makes sure we aren't spamming pressed = false; unPressed = true; // tells door it is an open button to start if so //if (isReverseButton) //{ // ButtonPressed(); //} // adds button to list of invokers EventManager.AddButtonUnPressedInvokers(gameObject); // adds button to list of invokers EventManager.AddButtonPressedInvokers(gameObject); }