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

Refactoring level 3

When level 2 signals level 3 to load (when the player pressed the level 3 pop up's Continue button), it signals for the _level2 Gameobject to be destroyed and the _level3 GameObject to be loaded from the LEVEL3 scene file. We must refactor the start up logic of _level3 so that we can find and connect some object references to GameObjects in the _global hierarchy. To accomplish this, perform the following steps:

  1. Create a new script named Level3Extras, and attach an instance of it to the _level3 GameObject. This script will be used to directly access certain GameObjects inside _level3 for enabling and disabling.
    Refactoring level 3
  2. Give the Level3Extras ...

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