For API documentation: https://github.com/JoshuaLim007/InGameConsole
created by Joshua Lim
Make sure you have TMPro installed and imported into your project! If not, Unity will freeze when you open the InGameConsole Manager.
If you are using a custom assembly definition, make sure you reference Lim.InGameConsole.Core assembly.
Copy this git URL:
and paste it into Unity's UPM "Add package from git URL". https://docs.unity3d.com/Manual/upm-ui-giturl.html
OR
Download this onto your computer. And install it via local drive. https://docs.unity3d.com/Manual/upm-ui-local.html
Go to the top of the Unity window and navigate to InGameConsole -> InGameConsoleManager Here you will have access to the console settings. Press Toggle Preview to edit these settings. Make sure to press Save before exiting.
The console will be automatically created when you enter play mode; there is no need to create the prefab of the console. Every scene in build settings will have a console after the project is built.
Make sure all the assemblies with your console commands are checked in the settings! This will allow the program to find your console commands in the assemblies.
- "Tab" Autofill the command
- "Up/Down arrow keys" Navigate through the console history
- "F3" Default key to open console
Namespace: To access the api you will need to according namespace:
using namespace Lim.InGameConsole;
Creating Custom Commands: Use [ConsoleCommand] method attribute:
public class TestScript{
[ConsoleCommand]
public static void method_number(){
//your code
}
}
Requirements
- Method must be static
- Parameters must be a primative type
Calling Commands via IGC: Commands will be formatted in class to method name hiearchy.
For:
public class className{
[ConsoleCommand]
public static void methodName(int amount, string name){
//your code
}
}
You will type:
className.methodName(int32, string)
GameConsole.OnConsoleVisibilityChange
public static OnTrigger OnConsoleVisibilityChange
Delegate triggered when the console visibility is changed.
GameConsole.IsActive
public static bool IsActive
Returns console visibility state.
GameConsole.SetActive
public static void SetActive(bool state)
Sets console visibility.
GameConsole.Print
public static void Print(object message)
Prints to console.
GameConsole.GetFamiliarCommands
public static List<string>GetFamiliarCommands(string className, string methodName)
Gets class name and method name of the custom command and returns all similar commands.
GameConsole.CallCommand
public static void GetFamiliarCommands(string className, string methodName, object[] arg)
Calls command with class name and method name and its parameters.
GameConsole.History
public static Queue<CommandHistory> History
Contains all previous command prints
GameConsole.Commands
public static Dictionary<string, Dictionary<string, MethodInfo>> Commands
Contains all commands grouped by command class name then command method name.
No as of now, you cannot change the looks except for the field sizes.
Yes of course. It will be automatically created.
Created by Joshua Lim