/// <summary> /// Sets up the spaceship to be ready for launch. /// </summary> private void PrepareJump() { OnPreparingJump?.Invoke(this, null); UISystem.Hide(); SetJumpState(true); // Set thrusters to zero Spaceship.Thrusters.ThrustPower = 0.0f; Spaceship.Thrusters.SpeedLinesVelocity = Spaceship.Thrusters.SpeedLimit * 2; Spaceship.Thrusters.StopAllRotation(true); OnJumpPrepared?.Invoke(this, null); }
//ensures that the currently displaying UI is the lowest ranked UI requesting to be shown private void CheckForNewUIToShow() { UISystem NewUIToShow = null; int NewUIRank = CurrentlyShownUIRank; //Debug.Log ("Checking for New UI to show"); foreach (UISystem UI in WantsToBeShown.Keys) { //Debug.Log ("Checking " + UI.name + ", Instance ID: " + UI.GetInstanceID()); if (WantsToBeShown [UI]) { int outRank = int.MaxValue; if ((UIRanks.TryGetValue(UI, out outRank)) && outRank < NewUIRank) //found different UI to display { NewUIToShow = UI; NewUIRank = UIRanks [UI]; } } //Debug.Log ("Check for New UI has made it to step 2"); if (NewUIToShow != null && NewUIToShow != CurrentlyShownUI) { if (CurrentlyShownUI != null) { CurrentlyShownUI.Hide(); } CurrentlyShownUI = NewUIToShow; CurrentlyShownUIRank = NewUIRank; CurrentlyShownUI.ShowRequestAccepted(); } } }
private void OnPlayed() { _uiSystem.Hide(); }