/// <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; } }
/// <summary> /// Sets a new correct interactable /// </summary> /// <param name="interactableType">The new interactable to be set as correct</param> /// <param name="secondStage">Whether or not this is on the second stage</param> public void SetNewInteractable(PressInteractableType interactableType) { switch (interactableType) { case (PressInteractableType.SECOND_BOLT): m_secondBolt.SetCorrect(true); break; case (PressInteractableType.THIRD_BOLT): m_thirdBolt.SetCorrect(true); break; case (PressInteractableType.LOOSEN_INK): m_loosenInk.SetCorrect(true); break; case (PressInteractableType.TIGHTEN_INK): m_tightenInk.SetCorrect(true); break; case (PressInteractableType.ORANGE_LEVER): m_orangeLever.SetCorrect(true); break; case (PressInteractableType.YELLOW_LEVER): m_yellowLever.SetCorrect(true); break; case (PressInteractableType.RESTART_BUTTON): m_restartButton.SetCorrect(true); break; default: Debug.LogError("Invalid interactable type on Press!"); break; } }
/// <summary> /// Creates the interactable and sets up variables /// Should only be called from a press /// </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> public void Create(Press machine, PressInteractableType interactableType, float incorrectTime) { m_parent = machine; m_interactableType = interactableType; m_incorrectTimeSubtraction = incorrectTime; }