/// <summary> /// Creates the interactable and sets up variables /// Should only be called from a press /// Should only be called for a restart button specifically /// </summary> /// <param name="machine">The machine this interactable is linked to</param> /// <param name="interactableType">The type of interactable this is</param> /// <param name="incorrectTime">How much time should be subtracted on incorrect press</param> /// <param name="heldTime">How long this button should need to be held for</param> public void Create(Press machine, PressInteractableType interactableType, float incorrectTime, float heldTime, float maxHeldTime) { if (interactableType != PressInteractableType.RESTART_BUTTON) { Debug.LogError("This PressInteractable.Create() overload should only be used with RESTART_BUTTON"); return; } m_parent = machine; m_interactableType = interactableType; m_incorrectTimeSubtraction = incorrectTime; m_heldTime = heldTime; m_maxHeldTime = maxHeldTime; RPMRating RPM = machine.GetRPM(); if (RPM == RPMRating.RPM856 || RPM == RPMRating.RPM902) { m_needsHolding = true; } else { m_needsHolding = false; } }