Game Development Reference
In-Depth Information
As you can see, we cannot currently edit the Enemy Profile tab from the editor (as this re-
quires a custom inspector, which will be covered in Chapter 11 , Onward Wary Traveler ).
Hence, we are doing it through the code. You can use a scriptable object asset and assign
it to the tab, and I've already shown you how to do this. Feel free to change it later if you
wish.
Setting up the enemy profile in the code
Returning back to the BattleManager script, the area where we push our Goblins into
action is in the SpawnEnemies coroutine. Now, instead of just throwing sprites at the
screen, we can add some real danger to the mix for our humble player and his itty-bitty
sword using the following code:
IEnumerator SpawnEnemies()
{
Search WWH ::




Custom Search