Book Image

Creating E-Learning Games with Unity

By : David Horachek
Book Image

Creating E-Learning Games with Unity

By: David Horachek

Overview of this book

Table of Contents (17 chapters)
Creating E-Learning Games with Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Putting it all together


Now that we have developed the classes necessary for the InventoryMgr, MissionMgr, and InteractiveObj systems, let's build a scene that illustrates their functionality.

  1. 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.

  2. Add an instance of InventoryMgr to the Player GameObject by dragging-and-dropping it from the Project tab to the player object. Alternatively, click on Player and select Add component from the Inspector pane. Type in the name InventoryMgr and then click on it to add an instance.

  3. 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.

  4. 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.

  5. Create a new empty GameObject and name...