# In-game Debug Console

## How to use

{% hint style="info" %}
To enable in-game debug console go to \_Loader scene and enable object "IngameDebugConsole" in heirarchy.
{% endhint %}

{% hint style="success" %}
It supports custom commands!
{% endhint %}

some examples of commands add from git documentation:

{% code title="Preffered method" %}

```csharp
void Start() {
    DebugLogConsole.AddCommand( "destroy", "Destroys " + name, Destroy );
    DebugLogConsole.AddCommand<Vector3>( "cube", 
        "Creates a cube at specified position", CreateCubeAt );
    DebugLogConsole.AddCommand<string, GameObject>( "child", 
        "Creates a new child object under " + name, AddChild );
}

void Destroy() {
    Destroy( gameObject );
}

public static void CreateCubeAt( Vector3 position ) {
    GameObject.CreatePrimitive( PrimitiveType.Cube ).transform.position = position;
}

private GameObject AddChild( string name ) {
    GameObject child = new GameObject( name );
    child.transform.SetParent( transform );
    return child;
}
```

{% endcode %}

More info in [**Documentation on GIT**](https://github.com/yasirkula/UnityIngameDebugConsole)
