/// <summary> /// /// </summary> private void Update() { if (m_interactableType == PressInteractableType.RESTART_BUTTON && m_isPressed) //if restart button and is currently being pressed { m_heldTimer += Time.deltaTime; //increment timer if (!m_needsHolding && m_heldTimer >= m_maxHeldTime) //if restart button doesn't need holding and was held for too long, subtract remaining time { Debug.Log("Held too long!"); m_parent.SubtractTime(m_incorrectTimeSubtraction); return; } else if (m_needsHolding && m_heldTimer >= m_heldTime) //if restart button needed holding and has been held for long enough, fix machine { Debug.Log("Restart button was held long enough!"); m_parent.FixMachine(); return; } } }