Customizing our shop selection
In this section, we are going to use scriptable objects to customize each selection. We have already used scriptable objects in Chapter 2, Adding and Manipulating Objects. This time, we will use a similar method but for our selection grid; hopefully, this will make you appreciate how scriptable objects can be expanded and used across the game.
As mentioned in Chapter 2, Adding and Manipulating Objects, I make a habit of initialing scriptable objects with an SO
prefix so that they're easy to identify. Let's create an SOShopSelection
script:
- In the Unity Editor, go to the Project window and navigate to
Assets/Script
. - Create a script (using the same method from Chapter 2, Adding and Manipulating Objects) and name it
SOShopSelection
.
This SOShopSelection
script will create a template of data types for our asset files (the same as with our player and enemy ships). These asset files will be attached to each of the player ship...