Skip to content

Getting Started

Cronyx edited this page Feb 26, 2021 · 7 revisions

Getting started

Installation

Before you install, make sure your project has:

  1. Unity 2020.2 or greater!
  2. TextMeshPro package version 3.0.1 or greater! This should already ship with Unity 2020.2+.

Then, follow one of the guides below to install the DeveloperConsole:

After installing, make sure to import the TextMeshPro Essential Resources by going to Window > TextMeshPro > Import TMP Essential Resources if you haven't already done so!

You can refer back to these pages for instructions on how to update the package to a new version, as well.

Using the console

By default, you can open the in-game console by pressing the backquote key (`) (or tilde, ~, on QWERTY keyboards). This will open the console UI and allow you to start entering commands. For your first command, try printing the working directory:

~ $ pwd
C:\Users\MyUser\AppData\LocalLow\DefaultCompany\DeveloperConsole
~ $ █

Just like in a Bash console, past inputs can be cycled through using the up and down arrow keys. For a list of all commands that can be called, enter $ help.

Customizing the console

To customize the console's settings, go to Window > DeveloperConsole > Settings. This will create a ConsoleSettings asset in your projects directory. Hover over any of the settings to get a description of what that feature does. For a more detailed description of the console's settings, see the settings documentation.

Adding commands to the console

The DeveloperConsole package was created with the intention that you would extend its functionality by creating console commands specific to your own project. Creating a console command can be as simple as tagging a static method with a CommandAttribute:

[Command("cmd")]
public static void MyCommand (Vector3 v)
{
    // Your command's code
}

and calling it like so:

~ $ cmd (1 2 3)
~ $ █

or as complicated as creating a custom class that manually parses command-line arguments. See the documentation on console commands for more information on creating your own commands.