Creating a debugging tool for the Editor
One of the easiest and fastest ways to test things while we are developing is by creating debugging tools to help us execute specific methods and trigger events so we can validate that our systems are working without having to play the game. This can be used for simple things such as adding more gold for the player or even spawning units and upgrading buildings.
Creating the Object Pool for the Warrior unit
Before we move to the actual debugging tool, let us first add the scripts we created so far to the Prefabs and GameObjects that will need them:
- Open the
Level01
scene. - Left-click on the + button in the top-left corner of the Hierarchy view, select Create Empty, and name it
ObjectPools
. In the Inspector view, in the Transform component, set X, Y, and Z to (0,
0, 0
). - Right-click on the new ObjectPools GameObject, select Create Empty, and name it
BasicWarriorObjectPool
. In the Inspector view, in the Transform component...