Documentation

Getting started

About The Development Console

The product possesses an impressive selection of professional-level concepts and features aimed at pushing the boundaries of your game and development process.

The Development Console is developed by a developer with years of professional experience in tools development and interactive entertainment production and brings these years of experience and creativity into your hands, we know you’ll enjoy using The Development Console.

Feedback

The Development Console is a tool that will forever thrive on providing users what they want, we live and die by our users and if you need something from us, we’d love to hear from you!

You can contact us at any time through one of our many channels.

Adding The Development Console

The development console is easy to use, no setup needed.

  1. Simply drag the Quick Start Prefab DebugConsoleLoader.prefab into any scene and the Development Console will load and initialise itself.
  2. You can now use the development Console by pressing the ~ key in game.

Taking it further

When you use the Development Console, you’ll see that we’ve provided you with a number of useful commands.

  • Device ID
  • Console Size
  • Clear
  • You’ll see that we’ve also provided you with a single Filter (DevelopmentConsole), this functionality is great, however the Dev Console is fully extendable, we'll show you how to add your own commands!

Custom log filtering

We provide you with one single Filter - Development Console. The following steps will walk you through adding your own, custom filter.

  1. Open DebugLog.cs
  2. Add your own filter to the enum Filter.
  3. When you call Debug.Log / Debug.LogWarning / Debug.LogError, you’ll be able to add your own custom filter as the first parameter. For example:

    
    Debug.Log(DebugLog.Filter.YourCustomFilter, "Loading Development Console");
                            

Now, when you open up the Filter window inside the Development Console, you’ll see that you have access to your new filter.

Custom development commands

We provide you with a number of basic Console Commands, however this is completely customisable. You can look at the file SampleCommands.cs to see an example of custom commands in use, or follow this step by step guide, that will show you how to add custom commands.

Suppose you have the following simple class and you’d like to expose the ModifyHealth(int amount) method


public class Hero
{
    public int Health
    {
        get;
        set; 
    }
  
    public static Hero Instance
    {
        get;
        set; 
    }
  
    public Hero()
    {
        Instance = this;
    }
    private void ModifyHealth(int amount)
    {
        Health += amount;
    } 
}
  1. Add the ConsoleCommand Attribute to the ModifyHealth method, which will look something like this:

    
    [ConsoleCommand]
    private void ModifyHealth(int amount)
    {
        Health += amount;
    }
                          
  2. You must now register your object with the Development Console, open CommandRegistration.cs, and add a register and unregister call to the appropriate register / unregister methods, which should look something like this.
  3. 
    public static class CommandRegistration
    {
        public static void RegisterCommandsOnConsoleStartup()
        {
            DevelopmentCommands.Register(Hero.Instance);
        }
        public static void UnRegisterCommandsOnConsoleExit()
        {
            DevelopmentCommands.Unregister(Hero.Instance);
        } 
    }
                          

Your console command has now been successfully added!


Additional functionality provided by console command

You can add a console command simply with the ConsoleCommand attribute, you can also provide the attribute with some useful information. For example


[ConsoleCommand(Name = "DeviceID", Description = "Outputs the device's ID")]
                    

Console Command also allows you to specify some useful properties.

  • Name - This is the actual command that the user will run, for example, your method could be called DoDamageAndPlayDamageAnimation, but the Name could be ApplyDamage, the user would then call a method called ApplyDamage
  • Description - This description is a useful piece of text that will be displayed in the All Commands window, so the user has a better understanding of what the method does.

Customising autocomplete suggestions

When you are trying to call a method from the Development Console, it is sometimes useful to provide concrete suggestions for the user. You can see this in action, if you look in SampleCommands.cs at the ConsoleSize Method.

In this example, we want the user to see nice readable values, but the method can actually accept anything.

You have a method already exposed to the Development Console, but you want to provide the user with custom suggestions, in this example, we want to provide the user with fixed values for consoleSize:


[ConsoleCommand]
public static void ConsoleSize(int consoleSize)
{
  // Some Logic
}
  1. You will need to create a new class that implements ISuggestion, this interface provides the contract that your class must adhere to in order to implement custom suggestions
    
    class ConsoleSizeSuggestion : ISuggestion
    {
    }
    
  2. You must implement the Suggestion method, this method must return an IEnumerable that should contain all your suggestions. You will also be passed an IEnumerable of previous arguments, this might be useful in some cases.
    
    class ConsoleSizeSuggestion : ISuggestion
    {
        public IEnumerable Suggestion(IEnumerable previousArguments)
        { 
            return new [] { "-150", "-100", "-50", "+50", "+100", "+150" };
        }
    }
    
  3. You must add the suggestion attribute to the method parameter, that you’d like to provide suggestions for.
    
    public static void ConsoleSize([Suggestion(typeof(ConsoleSizeSuggestion))]int consoleSize)
    
  4. Your Dev Console now provides you with custom suggestions, that should look something like this.

Skinning

It is possible to completely reskin the dev console. We currently provide just one skin, called NightShade, which you can find in the resources folder.

WellFired/developmentconsole/Uncompiled/Runtime/Resources/NightShade

If you’d like to create a new skin, you can duplicate this one, then modify it to your hearts content.

To use your custom skin, open DebugConsoleLoader.cs and modify the Load method.

DevelopmentConsole.Load("NightShade");

The first parameter to this method should be the name of your new skin.