# Debug Game UI

{% file src="<https://1613353771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fygjewtla1W7kzTTIpGWq%2Fuploads%2FTe9dydrwXJm318aEgfkv%2FDebug%20Game%20UI.unitypackage?alt=media&token=0ca80776-d7e8-4f41-bb3a-b0ac58e98972>" %}
Package
{% endfile %}

## How to use

Replace UI\_Debugger.prefab in "\_Loader" scene.\
If you need disable Debug Game UI -> remove or disable UI\_Debugger in \_Loader.

Nearly visible transparent button in bottom right corner will toggle Debug Game UI window.

<figure><img src="https://1613353771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fygjewtla1W7kzTTIpGWq%2Fuploads%2FE94TU2nkqaQHlW9hYffn%2Fimage.png?alt=media&#x26;token=8137e4df-cc59-47d7-9a36-6469056a87bf" alt=""><figcaption><p>Button in the bottom right corner to activate window</p></figcaption></figure>

When you click button, you will see this:

<figure><img src="https://1613353771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fygjewtla1W7kzTTIpGWq%2Fuploads%2F8p60S2fxW5c2rQooyOec%2Fimage.png?alt=media&#x26;token=e1ca8c6f-ffd3-47cb-90c3-7266add8f7bf" alt=""><figcaption><p>Built-in buttons on window active</p></figcaption></figure>

* UI button will hide game UI, but interactions still will be
* Cash button adds currency to player (default value 5000)
* Time scale changes by arrows

## Built-in features

* Time speed control (TimeSpeedChangeCheat.cs)
* Add currency (CashCheatButton.cs)
* Toggle game UI on/off (Inside UiDebugger.cs)

{% hint style="danger" %}
Toggle game UI on/off button is specific.&#x20;

If you want to change it's position -> move UI and ToggleUI\_invisibleBack objects in prefab simultaniously. UI object is for button position visibility and invisible for button itself.
{% endhint %}

## How add new features

1. Open UI\_Debugger.prefab. All features are located in DebugContent object:

<figure><img src="https://1613353771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fygjewtla1W7kzTTIpGWq%2Fuploads%2F6bfp72eH5MJgbbvhabw7%2Fimage.png?alt=media&#x26;token=b2980459-9745-4c13-8544-99ec655f03d3" alt=""><figcaption><p>DebugContent where all features</p></figcaption></figure>

2. Add new button or what you need under DebugContent object in prefab and attach your custom script on added object. You can see CashCheatButton.cs for reference.
