| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is a simple in-game console for Unity games. It allows you to easily add commands and execute them at runtime.
You can change console settings in Edit > Project Settings > In-game Console.
There are some example commands: help, log and clear in Examples/Commands folder. Here's an example command that prints specified text to the console:
using InGameConsole;
public class LogCommand : Command
{
public override string Name => "log";
public override string Description => "Writes a specified text message in the console";
public override void Execute(string[] args)
{
if (args.Length == 0)
{
Console.Write("No arguments given.");
return;
}
Console.Write(string.Join(" ", args));
}
}Here's an example console opener for default input system:
private void Update()
{
if (Input.GetKeyDown(KeyCode.F3))
{
Console.OpenOrClose();
}
}Here's an example console opener for Unity Input System:
private void Awake()
{
inputs.Game.Console.performed += _ => Console.OpenOrClose();
}Note: to use the Console class you must use InGameConsole namespace:
using InGameConsole;| Back | FazBrowse Home | New Git URL |