O'Reilly logo

Creating E-Learning Games with Unity by David Horachek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting it all together

Let's test our DecisionMgr class by integrating these custom conditions and responses into an NPC instance.

  1. Find the NPC instance from earlier, and select the npcScript class.
  2. Note that the DecisonMgr reference is embedded in the class (instead of waiting for a reference to the GameObject). Click on the triangle, and notice that you can see the public interactions list that this class contains. By setting the size member variable, we can design and tailor the interactions for this NPC's DecisionMgr to perfectly match our gameplay needs.
  3. Click on the size field of the interactions list, and set it to 2. We will have two interactions on this NPC.
  4. Click on the Element 0 field. Make sure its active checkbox is set to true; this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required