Reviewing code
As you can see from the previous setup exercise and through testing, the Inventory service we imported already has the database wrapper attached. Let's review some of the script changes we imported and also get into details of the InventoryService script:
- Double-click on the
CatchSceneControllerlocated in theAssets/FoodyGo/Scripts/Controllersfolder in the Project window to open the script in the editor of your choice. The only thing that has thus far changed in the
CatchSceneControlleris a new Start method calling ourInventoryservice. Perform the following reviewing method:void Start() { var monster = InventoryService.Instance.CreateMonster(); print(monster); }- Inside the
Startmethod, theInventoryServiceis being called as a singleton using theInstanceproperty. Then, theCreateMonstermethod is called to generate a newmonsterobject. Finally, themonsterobject is printed to the Console...