コード例 #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        StartStopLogic startstopswitch = (StartStopLogic)target;

        if (GUILayout.Button("Motion-->Pause"))
        {
            startstopswitch.OnClick_Motion2Pause();
        }

        if (GUILayout.Button("Pause-->Park"))
        {
            startstopswitch.OnClick_Pause2Park();
        }

        if (GUILayout.Button("Park-->Pause"))
        {
            startstopswitch.OnClick_Park2Pause();
        }

        if (GUILayout.Button("Pause-->Motion"))
        {
            startstopswitch.OnClick_Pause2Motion();
        }
    }
コード例 #2
0
    IEnumerator OrderlyReset()
    {
        eventtrigger.enabled = false;                                           //No need to press again. Don't interfere while OrderlyReset() is in progress

        image.color   = Color_Draining;
        TMP_Text.text = "Recovering Rig - Please Wait";

        while (startstoplogic.Logicstatus == StartStopStatus.Motion ||          //We don't wanna be in those phases, so...
               startstoplogic.Logicstatus == StartStopStatus.Transit)
        {
            startstoplogic.OnClick_Motion2Pause();                              //...get out of it!
            yield return(new WaitForSeconds(0.1f));                             //check every 100ms if plaform is in PAUSE or Park (out of MOTION or TRANSIT)
        }

        while (!All_ExcDaR_NoExcd())                                            //check for persisting Exceedances AFTER the recovery is done!!! Might even be a re-trigger!
        {
            image.color   = Color_Crashed;
            TMP_Text.text = "Crash STILL present! Reset Sim";
            yield return(new WaitForSeconds(0.1f));                              //check every 100ms if exceedances are gone
        }

        //--------------ALL IS GOOD----------------

        UnlatchAllExcDaR();                                                     //this should be safe. After all, we checked for exceedances just a few nanoseconds ago. The Plat_Motion will now freefloat to it's "MotionActive" position. Plat_Physical can join it, when StartStopLogic Lerps her over.
        crashdetector.OnCrashReset();                                           //so it can detect the next crash

        image.color = Color_Draining;
        for (int counter = SettleTime; counter > 0; counter--)
        {
            TMP_Text.text = "Draining Filters - please wait: " + counter.ToString();
            yield return(new WaitForSeconds(1));
        }

        image.color   = Color_Passive;
        TMP_Text.text = "READY!";
        yield return(new WaitForSeconds(2));                                     //Show the "READY" message for 2 seconds

        TMP_Text.text = "";
    }