protected virtual void Awake() { instance = this; nGUICamera = null; scenes = new Dictionary <string, GameObject> (); menus = new Dictionary <string, GameObject> (); popups = new Stack <string> (); screens = new Stack <string> (); shields = new List <GameObject> (); gCamera = new GameObject("Cameras"); scene = new GameObject("Scenes"); shield = new GameObject("Shields"); gCamera.transform.parent = instance.transform; gCamera.transform.localPosition = Vector3.zero; scene.transform.parent = instance.transform; scene.transform.localPosition = Vector3.zero; shield.transform.parent = instance.transform; shield.transform.localPosition = Vector3.zero; DontDestroyOnLoad(instance.gameObject); #if !UNITY_5_3_OR_NEWER DontDestroyOnLoad(gCamera); DontDestroyOnLoad(scene); DontDestroyOnLoad(shield); #endif solidCamera = Instantiate(Resources.Load("HellgateSolidCamera")) as GameObject; solidCamera.name = "SolidCamera"; solidCamera.transform.parent = gCamera.transform; solidCamera.transform.position = Vector3.zero; FirstSceneLoad(); }
protected virtual void Awake() { instance = this; nGUICamera = null; scenes = new Dictionary<string, GameObject> (); menus = new Dictionary<string, GameObject> (); popups = new Stack<string> (); screens = new Stack<string> (); shields = new List<GameObject> (); gCamera = new GameObject ("Cameras"); scene = new GameObject ("Scenes"); shield = new GameObject ("Shields"); gCamera.transform.parent = instance.transform; gCamera.transform.localPosition = Vector3.zero; scene.transform.parent = instance.transform; scene.transform.localPosition = Vector3.zero; shield.transform.parent = instance.transform; shield.transform.localPosition = Vector3.zero; DontDestroyOnLoad (instance.gameObject); #if !UNITY_5_3 && !UNITY_5_4 DontDestroyOnLoad (gCamera); DontDestroyOnLoad (scene); DontDestroyOnLoad (shield); #endif solidCamera = Instantiate (Resources.Load ("HellgateSolidCamera")) as GameObject; solidCamera.name = "SolidCamera"; solidCamera.transform.parent = gCamera.transform; solidCamera.transform.position = Vector3.zero; FirstSceneLoad (); }