private void DrawGeneralDebugMenu() { if (GUILayout.Button("Unlimited Oxygen")) { GameModeUtils.ToggleCheat(GameModeOption.NoOxygen); Player.main.oxygenMgr.AddOxygen(100); } if (GUILayout.Button("Full Food")) { Player.main.GetComponent <Survival>().food = 100; } if (GUILayout.Button("Full Water")) { Player.main.GetComponent <Survival>().water = 100; } if (GUILayout.Button("Full Health")) { Player.main.liveMixin.health = Player.main.liveMixin.maxHealth; } GUILayout.Space(10); if (GUILayout.Button("Components")) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out RaycastHit hit)) { foreach (Component c in hit.rigidbody.gameObject.GetComponents(typeof(Component))) { Log.Print("Base Component: " + c.ToString()); } foreach (Component c in hit.rigidbody.gameObject.GetComponentsInChildren(typeof(Component))) { Log.Print("Child " + c.gameObject + " Component: " + c.ToString()); } } } if (GUILayout.Button("Delete Object")) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out RaycastHit hit)) { Destroy(hit.rigidbody.gameObject); } } GUILayout.BeginHorizontal(); fmodAsset = GUILayout.TextField(fmodAsset); if (GUILayout.Button("Play Standard FMOD")) { FMODAsset[] fmods = Resources.FindObjectsOfTypeAll <FMODAsset>(); foreach (FMODAsset fmod in fmods) { if (fmod.name.ToLower().Equals(fmodAsset)) { Log.Print("Playing FMOD: " + fmod.name); Utils.PlayFMODAsset(fmod, MainCamera.camera.transform, 20f); } } } GUILayout.EndHorizontal(); if (GUILayout.Button("Get Render Queue")) { Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray4, out RaycastHit raycastHit4)) { foreach (MeshRenderer mr in raycastHit4.rigidbody.GetComponentsInChildren <MeshRenderer>()) { Log.Print("GO Name: " + mr.gameObject.name); Log.Print("GO Material Count: " + mr.materials.Length); foreach (Material m in mr.materials) { Log.Print("Material Name: " + m.name); Log.Print("Material Render Queue: " + m.renderQueue); } } } } if (GUILayout.Button("Teleport")) { Player.main.transform.position += new Vector3(2f, 0f, 0f); } if (GUILayout.Button("Get LiveMixin Data")) { Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray4, out RaycastHit raycastHit4)) { LiveMixin lm = raycastHit4.rigidbody.GetComponent <LiveMixin>(); if (lm == null) { Log.Print("No Live Mixin Found"); return; } lm.PrintAllLiveMixinDetails(); } } if (GUILayout.Button("Set Health to 300 and knifable")) { Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray4, out RaycastHit raycastHit4)) { LiveMixin lm = raycastHit4.rigidbody.GetComponent <LiveMixin>(); if (lm == null) { Log.Print("No Live Mixin Found"); return; } lm.health = 300; lm.data.knifeable = true; } } GUILayout.BeginHorizontal(); prefabAsset = GUILayout.TextField(prefabAsset); if (GUILayout.Button("Spawn prefab")) { GameObject[] prefabs = Resources.FindObjectsOfTypeAll <GameObject>(); foreach (GameObject prefab in prefabs) { if (prefab.name.ToLower().Equals(prefabAsset)) { GameObject newPrefab = Instantiate(prefab); newPrefab.transform.position = Camera.main.transform.position; newPrefab.transform.position += Camera.main.transform.forward * 3f; foreach (Component c in prefab.GetComponentsInChildren(typeof(Component))) { Log.Print("Component:" + c); } } } } GUILayout.EndHorizontal(); if (GUILayout.Button("MeleeAttack Count")) { MeleeAttack[] reaperMeleeAttacks = FindObjectsOfType <MeleeAttack>(); Log.Print("Found " + reaperMeleeAttacks.Length + " MeleeAttack"); foreach (MeleeAttack ma in reaperMeleeAttacks) { Log.Print("Found One on " + ma.name); } } if (GUILayout.Button("Spawn Singla")) { GameObject go = Instantiate(Resources.Load <GameObject>("VFX/xSignal"), Player.main.transform); Log.Print("Component Count: " + go.GetComponentsInChildren <Component>().Length); foreach (Component c in go.GetComponentsInChildren <Component>()) { Log.Print("Component " + c + " is on gameobject: " + c.gameObject); } } if (GUILayout.Button("Register Manta Ping")) { //SMLHelper.V2.Handlers.SpriteHandler.RegisterSprite(SpriteManager.Group.Pings, "Manta", $"./QMods/TheMantaMod/Assets/MantaPingIcon.png"); //SMLHelper.V2.Handlers.SpriteHandler.RegisterSprite(MantaMod.MANTA_TECH_TYPE, $"./QMods/TheMantaMod/Assets/MantaPingIcon.png"); //SMLHelper.V2.Handlers.SpriteHandler.RegisterSprite(SpriteManager.Group.Pings, "MantaPingggggg", Manta.Utilities.MantaAssetLoader.MANTA_PING_ICON); SpriteHandler.RegisterSprite(SpriteManager.Group.Pings, MantaMod.NAME, $"./QMods/TheMantaMod/Assets/MantaPingIcon.png"); Log.Print($"Registered {MantaMod.NAME}"); Log.Print($"File Exists {System.IO.File.Exists("./QMods/TheMantaMod/Assets/MantaPingIcon.png")}"); } if (GUILayout.Button("Manta Ping")) { //Atlas.Sprite sprite = SpriteManager.GetWithNoDefault(SpriteManager.Group.Pings, "Manta"); //Atlas.Sprite sprite = SpriteManager.GetWithNoDefault(MantaMod.MANTA_TECH_TYPE); Atlas.Sprite sprite = SpriteManager.GetWithNoDefault(SpriteManager.Group.Pings, MantaMod.NAME); System.Collections.Generic.Dictionary <string, Atlas.Sprite> t = SpriteManager.groups[SpriteManager.Group.Pings]; Log.Print($"Dict Count: {t.Count}"); foreach (string name in t.Keys) { Log.Print($"Contains Key: {name}"); } if (sprite == null) { Log.Print($"{MantaMod.NAME} sprite null."); } else { Log.Print($"Not Null Texture {sprite.texture.name}."); } } }
private void DrawGeneralDebugMenu() { if (GUILayout.Button("Unlimited Oxygen")) { GameModeUtils.ToggleCheat(GameModeOption.NoOxygen); Player.main.oxygenMgr.AddOxygen(100); } if (GUILayout.Button("Full Food")) { Player.main.GetComponent <Survival>().food = 100; } if (GUILayout.Button("Full Water")) { Player.main.GetComponent <Survival>().water = 100; } if (GUILayout.Button("Full Health")) { Player.main.liveMixin.health = Player.main.liveMixin.maxHealth; } GUILayout.Space(10); if (GUILayout.Button("Components")) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out RaycastHit hit)) { foreach (Component c in hit.rigidbody.gameObject.GetComponents(typeof(Component))) { Log.Print("Base Component: " + c.ToString()); } foreach (Component c in hit.rigidbody.gameObject.GetComponentsInChildren(typeof(Component))) { Log.Print("Child " + c.gameObject + " Component: " + c.ToString()); } } } if (GUILayout.Button("Delete Object")) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out RaycastHit hit)) { Destroy(hit.rigidbody.gameObject); } } GUILayout.BeginHorizontal(); fmodAsset = GUILayout.TextField(fmodAsset); if (GUILayout.Button("Play Standard FMOD")) { FMODAsset[] fmods = Resources.FindObjectsOfTypeAll <FMODAsset>(); foreach (FMODAsset fmod in fmods) { if (fmod.name.ToLower().Equals(fmodAsset)) { Log.Print("Playing FMOD: " + fmod.name); Utils.PlayFMODAsset(fmod, MainCamera.camera.transform, 20f); } } } GUILayout.EndHorizontal(); if (GUILayout.Button("Get Render Queue")) { Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray4, out RaycastHit raycastHit4)) { foreach (MeshRenderer mr in raycastHit4.rigidbody.GetComponentsInChildren <MeshRenderer>()) { Log.Print("GO Name: " + mr.gameObject.name); Log.Print("GO Material Count: " + mr.materials.Length); foreach (Material m in mr.materials) { Log.Print("Material Name: " + m.name); Log.Print("Material Render Queue: " + m.renderQueue); } } } } if (GUILayout.Button("Teleport")) { Player.main.transform.position += new Vector3(2f, 0f, 0f); } if (GUILayout.Button("Get LiveMixin Data")) { Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray4, out RaycastHit raycastHit4)) { LiveMixin lm = raycastHit4.rigidbody.GetComponent <LiveMixin>(); if (lm == null) { Log.Print("No Live Mixin Found"); return; } lm.PrintAllLiveMixinDetails(); } } if (GUILayout.Button("Set Health to 300 and knifable")) { Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray4, out RaycastHit raycastHit4)) { LiveMixin lm = raycastHit4.rigidbody.GetComponent <LiveMixin>(); if (lm == null) { Log.Print("No Live Mixin Found"); return; } lm.health = 300; lm.data.knifeable = true; } } GUILayout.BeginHorizontal(); prefabAsset = GUILayout.TextField(prefabAsset); if (GUILayout.Button("Spawn prefab")) { GameObject[] prefabs = Resources.FindObjectsOfTypeAll <GameObject>(); foreach (GameObject prefab in prefabs) { if (prefab.name.ToLower().Equals(prefabAsset)) { GameObject newPrefab = Instantiate(prefab); newPrefab.transform.position = Player.main.transform.position; newPrefab.transform.position += 5f * gameObject.transform.forward; foreach (Component c in prefab.GetComponentsInChildren(typeof(Component))) { Log.Print("Component:" + c); } } } } GUILayout.EndHorizontal(); }