示例#1
0
        private void OnGUI()
        {
            if (_playerController == null || _playerForceDetector == null)
            {
                this._playerForceDetector = Locator.GetPlayerForceDetector();
                this._playerController    = Locator.GetPlayerController();
                if (_playerController == null || _playerForceDetector == null)
                {
                    return;
                }
            }
            float num = 400f;

            if (GUIMode.IsHiddenMode() || PlayerState.UsingShipComputer())
            {
                return;
            }
            if (inputHUD == 1)
            {
                GUI.Label(new Rect(10f + num, 10f, 200f, 20f), "Time Scale: " + Mathf.Round(Time.timeScale * 100f) / 100f);
                GUI.Label(new Rect(10f + num, 25f, 200f, 20f), string.Concat(new object[]
                {
                    "Time Remaining: ",
                    Mathf.Floor(TimeLoop.GetSecondsRemaining() / 60f),
                    ":",
                    Mathf.Round(TimeLoop.GetSecondsRemaining() % 60f * 100f / 100f)
                }));
                GUI.Label(new Rect(10f + num, 40f, 200f, 20f), "Loop Count: " + TimeLoop.GetLoopCount());
                GUI.Label(new Rect(10f + num, 55f, 90f, 40f), "PauseFlags: ");
                GUI.Label(new Rect(100f + num, 55f, 50f, 40f), "MENU\n" + ((!OWTime.IsPaused(OWTime.PauseType.Menu)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(150f + num, 55f, 50f, 40f), "LOAD\n" + ((!OWTime.IsPaused(OWTime.PauseType.Loading)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(200f + num, 55f, 50f, 40f), "READ\n" + ((!OWTime.IsPaused(OWTime.PauseType.Reading)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(250f + num, 55f, 50f, 40f), "SLP\n" + ((!OWTime.IsPaused(OWTime.PauseType.Sleeping)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(300f + num, 55f, 50f, 40f), "INIT\n" + ((!OWTime.IsPaused(OWTime.PauseType.Initializing)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(350f + num, 55f, 50f, 40f), "STRM\n" + ((!OWTime.IsPaused(OWTime.PauseType.Streaming)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(400f + num, 55f, 50f, 40f), "SYS\n" + ((!OWTime.IsPaused(OWTime.PauseType.System)) ? "FALSE" : "TRUE "));
                GUI.Label(new Rect(10f + num, 85f, 200f, 20f), "Input Mode: " + OWInput.GetInputMode().ToString());
                this._inputModeArray = OWInput.GetInputModeStack();
                GUI.Label(new Rect(10f + num, 100f, 200f, 20f), "Input Mode Stack: ");
                int num2 = 150;
                int num3 = 0;
                while (num3 < this._inputModeArray.Length && this._inputModeArray[num3] != InputMode.None)
                {
                    GUI.Label(new Rect((float)num2 + num, 100f, 200f, 20f), this._inputModeArray[num3].ToString());
                    num2 += 75;
                    num3++;
                }
                GUI.Label(new Rect(10f + num, 115f, 300f, 20f), "Net Force Accel: " + Mathf.Round(this._playerForceDetector.GetForceAcceleration().magnitude * 100f) / 100f);
                GUI.Label(new Rect(210f + num, 115f, 300f, 20f), "G-Force: " + Mathf.Round(this._gForce * 100f) / 100f);
                GUI.Label(new Rect(10f + num, 130f, 200f, 20f), "Load Time: " + LoadTimeTracker.GetLatestLoadTime());
                if (DynamicResolutionManager.isEnabled)
                {
                    GUI.Label(new Rect(10f + num, 145f, 200f, 20f), "Resolution Scale: " + DynamicResolutionManager.currentResolutionScale);
                }
                GUI.Label(new Rect(10f + num, 160f, 200f, 20f), "Player Speed: " + (Locator.GetCenterOfTheUniverse().GetOffsetVelocity() + Locator.GetPlayerBody().GetVelocity()).magnitude.ToString());
                GUI.Label(new Rect(210f + num, 160f, 200f, 20f), "Player Accel: " + Locator.GetPlayerBody().GetAcceleration().magnitude.ToString());
                if (Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>())
                {
                    GUI.Label(new Rect(10f + num, 175f, 200f, 20f), string.Concat(new object[]
                    {
                        "Jetpack Max Accel: ",
                        Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>().GetMaxTranslationalThrust().ToString(),
                        "/",
                        Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>().GetBoostMaxThrust().ToString()
                    }));
                }
                if (Locator.GetShipBody().GetComponent <ShipThrusterModel>())
                {
                    GUI.Label(new Rect(210f + num, 175f, 200f, 20f), "Ship Max Accel: " + Locator.GetShipBody().GetComponent <ShipThrusterModel>().GetMaxTranslationalThrust().ToString());
                }
                GUI.Label(new Rect(10f + num, 190f, 400f, 20f), string.Concat(new object[]
                {
                    "Inspector layer: ",
                    rayMask,
                    " ",
                    LayerMask.LayerToName(rayMask)
                }));
                if (GetWarpOWRigidbody())
                {
                    GUI.Label(new Rect(10f + num, 205f, 400f, 20f), string.Concat(new string[]
                    {
                        "Warp Body: ",
                        GetWarpOWRigidbody().gameObject.name,
                        " layer: ",
                        GetWarpOWRigidbody().gameObject.layer.ToString(),
                        " ",
                        LayerMask.LayerToName(GetWarpOWRigidbody().gameObject.layer)
                    }));
                }
                if (hit.collider)
                {
                    GUI.Label(new Rect(10f + num, 220f, 400f, 20f), string.Concat(new string[]
                    {
                        "Latest hit layer: ",
                        hit.collider.gameObject.layer.ToString(),
                        " ",
                        LayerMask.LayerToName(hit.collider.gameObject.layer)
                    }));
                    GUI.Label(new Rect(10f + num, 235f, 600f, 20f), "Name: " + hit.collider.gameObject.name + " Distance: " + (hit.point - Locator.GetPlayerBody().transform.position).magnitude.ToString());
                }

                /*if (PadEZ.PadManager.GetActiveController()!=null)
                 *              {
                 *                      GUI.Label(new Rect(10f + num, 250f, 600f, 20f), PadEZ.PadManager.GetActiveController().GetIndex().ToString() + " " + PadEZ.PadManager.GetActiveController().GetPadType().ToString() +" "+ UnityEngine.Input.GetJoystickNames()[PadEZ.PadManager.GetActiveController().GetIndex()]);
                 *              }*/
            }
            if (inputHUD == 2)
            {
                GUI.Label(new Rect(10f, 10f, 300f, 2500f), ReadInputManager.ReadCommandInputs(false));
            }
            if (inputHUD == 3)
            {
                GUI.Label(new Rect(0f, 0f, 300f, 2500f), ReadInputManager.ReadCommandInputs(false));
                GUI.Label(new Rect(300f, 0f, 300f, 2500f), ReadInputManager.ReadCommandInputs(true));
            }
            if (inputHUD == 4)
            {
                GUI.Label(new Rect(0f, 0f, 500f, 2500f), ReadInputManager.ReadInputAxes());
                GUI.Label(new Rect(500f, 0f, 500f, 2500f), ReadInputManager.ReadRawInputManagerButtons());
            }
        }