would it be possible with GUILayout? i’m talking a cheat console like the one in TES V: Skyrim. Possible? I know how to freeze time in the background, but i’m curious on if it’s possible to make a cheat console. maybe GUILayer? i have no idea please tell me if it is and please give some examples of code, too!
3 Answers
3Start by making something the player can type into
once you get that working, just take the input and match it to one your ‘cheat codes’. If you have something besides a design in mind, post code/specific question.
Please Check
Sorry for resurrecting an old thread but it still shows up on the Google front page so people mind find this useful to know:
I would recommend our new Developer Console asset for this: >Developer Console | GUI Tools | Unity Asset Store
It also allows you to turn any public, non-public, static or non-static method into a console command which you can invoke at runtime by simply typing it’s name. This also works with parameters and allows you to specify a gameobject as the target.
It also allows you to view all debug messages in builds, including stacktraces and timestamps, and allows you to collapse duplicates much like Unity’s console. It also allows you to specify a custom file to save all debug messages to in an easy to read format.
cool! i set the text field up like in the example using UnityEngine; using System.Collections; public class Example : MonoBehaviour { public string stringToEdit = "Hello World"; void OnGUI() { stringToEdit = GUI.TextField(new Rect(10, 10, 200, 20), stringToEdit, 25); } } but nothing happens when i type into the text field in-game... :(
– oc007061Try setting stringToEdit = "" and type into box
– getyour411ahh yes yes forgot to mention tried to do that already nothing happened :( makes me sad
– oc007061You are clicking your mouse into the box? I tested a scene I have setup to accept user input using this GUI.Label (new Rect(10,330, 500,35), "Name?"); pcName = GUI.TextField (new Rect (15, 355, 50, 35), pcName); and it works fine
– getyour411yeah i'm clicking the mouse in the box. i'll try your code now, though.
– oc007061