public void OnStartStopLogicChanged(StartStopStatus status) { switch (status) { case StartStopStatus.Motion: image.color = Color_Motion; TMP_Text.text = "--> MOTION ACTIVE <--"; break; case StartStopStatus.Pause: image.color = Color_Pause; TMP_Text.text = "Paused"; break; case StartStopStatus.Park: image.color = Color_Park; TMP_Text.text = "Parked"; break; case StartStopStatus.Transit: image.color = Color_Transit; TMP_Text.text = "In Transit"; break; default: break; } }
private void Start() { lerpPause = platform_Pause.GetComponent <Lerp2Target>(); lerpPhysical = platform_Physical.GetComponent <Lerp2Target>(); lerpPause.Percentage = 0.0f; lerpPhysical.Percentage = 0.0f; Logicstatus = StartStopStatus.Park; }
///////////---COROUTINES---////////////// IEnumerator Park2Pause(Lerp2Target lerp) { Logicstatus = StartStopStatus.Transit; StartStopChanged.Invoke(Logicstatus); while (lerp.Percentage < 1) { lerp.Percentage += (1.0f / transitionTime) * Time.deltaTime; yield return(null); } lerp.Percentage = 1; Logicstatus = StartStopStatus.Pause; StartStopChanged.Invoke(Logicstatus); }
void Mapper_StartedOrStopped(object sender, StartStopStatus e) { _actionQueue.Add(() => { switch (e.StartedOrStopped) { case StartStopStatus.StartStopType.Started: Running = true; AddMessage("Mapping Started"); break; case StartStopStatus.StartStopType.Stopped: Running = false; AddMessage("Mapping Stopped"); break; } }); }
IEnumerator Motion2Pause(Lerp2Target lerp) { Logicstatus = StartStopStatus.Transit; StartStopChanged.Invoke(Logicstatus); CoR.SetActive(false); while (lerp.Percentage > 0) { lerp.Percentage -= (1.0f / transitionTime) * Time.deltaTime; yield return(null); } lerp.Percentage = 0; Logicstatus = StartStopStatus.Pause; StartStopChanged.Invoke(Logicstatus); }
IEnumerator Pause2Motion(Lerp2Target lerp) { Logicstatus = StartStopStatus.Transit; StartStopChanged.Invoke(Logicstatus); while (lerp.Percentage < 1) { lerp.Percentage += (1.0f / transitionTime) * Time.deltaTime; yield return(null); } lerp.Percentage = 1; CoR.SetActive(true); Logicstatus = StartStopStatus.Motion; StartStopChanged.Invoke(Logicstatus); }