Now that we have developed the classes necessary for the InventoryMgr
, MissionMgr
, and InteractiveObj
systems, let's build a scene that illustrates their functionality.
To get started, let's continue from Chapter 1, Introduction to E-Learning and the Three Cs of 3D Games, where we left off. Load the scene and save a copy named
chapter2
.Add an instance of
InventoryMgr
to thePlayer
GameObject by dragging-and-dropping it from the Project tab to theplayer
object. Alternatively, click on Player and select Add component from the Inspector pane. Type in the nameInventoryMgr
and then click on it to add an instance.Click on Player and ensure that the Tag is set to Player. The
InteractiveObj
class will use this to make sure they can only be picked up by the player.Set Height and Width to 40 pixels to make the individual cells square shaped. Set the Yposition to 0.85 to indicate a y coordinate of 85 percent from the top of the screen.
Create a new empty GameObject and name...