Debug System

Hey there all, I am back with a new system, The Debug System.
Suppose you are in the Beach, and want to go to the Forest and with all the things with you have with you, which is not persistent inbetween plays. The first way is to just unplay, open the forest and play again (if you don’t want to persist thing with you). The second way is to walk all along to the forest.

Both ways are somewhat time wasting.

So I programmed a new System called Debug System. It allows you to open up a DebugMenu, in which there is a list of all the locations (currently 10, I guess), and if you click on one, you will be quickly spawned to that location.
Thanks.

@cirocontinisio , Now I will explain the working behind it. If you press the backquote key (the key just below escape and just above tab), the script UIManager.cs listens on the input reader for that input. It then activates the DebugMenu Gameobject. (i just duplicates the settingsMenu prefab as an starting point).
Then in the UIDebug script, I have a reference to DebugConfigSO, which is a SO containing list of all the locations and a bool to check if it is debug mode.
UIDebug loops over the array of locations, and Instantiates a Prefab called Location Item. It is a button with textmeshpro setup. Then I add an OnClick listener to each button with an extra parameter, the index of the location. The I just raise an sceneLoadEvent with that LocationSO, showLoadingScreen false, fade true.

And this works as expected.

Now this will also work in the build, i.e, the released game, and we don’t want that. To tackle this, I set the isDebugMode bool to true in the EditorColdStartup, if it is. And discard any input in the InputReader, if isDebugMode is false.

Thanks.

Now to prevent isDebugMode to be checked accidentally and ruin the builded game, I have used this.

Note that I have exposed the bool to inspector to just allow is to see it in play mode.
Thanks

Now if you allow @cirocontinisio , shall I open a PR?

Here is the PR, please evaluate it @cirocontinisio .

Thanks

Hey Ciro, no need to fix conflicts. I fixed all of them when I realized that I am able to do so on the Github’s Web UI.

Debug loading locations done. Now working on debug walk / run. Will push it as soon as it’s done.

Hey @cirocontinisio , consider evaluating and merging my pull request. Debug Walk/Run will be on next pull request due to being on a new branch.

Thanks.