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 tag 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/Resources/Script.
- Create a script (using the same method as in 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...