/// <summary> /// Randomly sets an RPM rating and makes the correct display visible /// </summary> private void CreateRPM() { m_RPMRating = (RPMRating)Random.Range(0, 5); switch (m_RPMRating) { case (RPMRating.RPM700): m_RPM700.SetActive(true); break; case (RPMRating.RPM856): m_RPM856.SetActive(true); break; case (RPMRating.RPM900): m_RPM900.SetActive(true); break; case (RPMRating.RPM902): m_RPM902.SetActive(true); break; case (RPMRating.RPM1000): m_RPM1000.SetActive(true); break; } }
/// <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; } }