Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Ouya Unity Game Development

You're reading from  Ouya Unity Game Development

Product type Book
Published in Oct 2013
Publisher Packt
ISBN-13 9781783559701
Pages 118 pages
Edition 1st Edition
Languages
Author (1):
Gary Riches Gary Riches
Profile icon Gary Riches

Setting up your Scenes


You should now have a project panel with seven folders and a scene with Main Camera and OuyaGameObject that you have entered your developer ID into. We are going to use this scene as a setup scene that isn't displayed for long but instead adds all the required game objects. Normally in Unity, when loading a new scene, all objects are destroyed, and then the objects in the new scene are loaded. If it is needed to have an object persist between scenes then there is a method, DontDestroyOnLoad that you can pass an object to. If the object is a component or GameObject then its entire transform hierarchy will not be destroyed either. A side effect of this is that if the scene has the GameObject added to it in Unity and you load it multiple times (on a level select screen for example) then the GameObject will be cloned multiple times and, with a GameObject that handles controller input for example, this can result in multiple controller presses being triggered. We can avoid...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}