Comments

  • The navigator Singleton features two new variables: the private static variable--mThisInstance--and the public static property--ThisInstance.
  • The mThisInstance variable should always maintain a reference to the one and only currently activated instance of the navigator. All other instances are to be regarded as invalid and should be removed.
  • The only way to access and read the mThisInstance variable is through the ThisInstance property. The set method controls which values are written to mThisInstance and the get method controls which values are returned.
  • The Awake event, which is called when an instance is created and enabled, uses the set method for the ThisInstance property. This property validates the passed value (the current ...

Get Mastering Unity 2017 Game Development with C# - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.