This project is possible because of the effort of amazing people at Cranium Software this project is based of SmartConsole https://github.com/CraniumSoftware/SmartConsole
BeastConsole is evolution (hopefully) of SmartConsole,
- Backend is created by folks at CraniumSoftware.
- Use attributes to bind members
- Register your own arbitrary commands/methods for any object(non monob as well) and provide parameters
- Autocomplete
- Both commands and variables support any number of subscribers, modify all objects at once.
- Multiline
- Suggestions
- History
- ConsoleUtility class containing methods to draw tables. (You can actually use ConsoleUtility pretty much by itself instead of Console class).
setup: Drop Console prefab in scene, change parameters to your liking.
Attributes:
Console uses reflection to find attributes, to speed up the whole process we should mark any class that has uses console
attributes with [ConsoleParse] attribute.
[ConsoleParse]publicclassAttributeTest:MonoBehaviour{[ConsoleVariable("testvar","")]publicfloatTestVariable=5f;[ConsoleVariable("testproperty","")]publicboolTestPropertyVariable{set{Console.WriteLine("testproperty was set to: "+value);}}[ConsoleCommand("testMethod","")]voidTestMethod(){BeastConsole.Console.WriteLine("test method works");}[ConsoleCommand("testMethodWithParams","")]publicvoidTestMethodWithParams(floatparam1){BeastConsole.Console.WriteLine("works :"+param1.ToString());}[ConsoleCommand("testMethodWith2Params","")]publicvoidTestMethodWith2Params(floatparam1,intparam2){BeastConsole.Console.WriteLine("works :"+(param1+param2).ToString());}}Manual:
publicfloatVolume=1f;Console.RegisterVariable<float>("Volume","", x =>Volume=x,this);Console.RegisterCommand("MoveUp","",this,MoveUp);privatevoidMoveUp(string[]val){transform.position+=newVector3(0,System.Convert.ToSingle(val[1]),0);}Manual method requires you to unregister commands and variables when done with an object.
See Example folder for more examples.
