void Awake()
 {
     if (Globals.inputController != null && Globals.inputController != this)
     {
         Destroy(gameObject);
         return;
     }
     instance = this;
     GameObject cameraGO = GameObject.FindGameObjectWithTag("GUI Camera");
     if (cameraGO != null)
     {
         guiCamera = cameraGO.GetComponent<Camera>();
     }
 }
Пример #2
0
 protected void BaseInit()
 {
     DontDestroy(this.gameObject);
     inputController = gameObject.GetComponent<InputController>();
     if (inputController == null)
     {
         inputController = gameObject.AddComponent<InputController>();
     }
     Screen.orientation = ScreenOrientation.LandscapeLeft;
     Screen.sleepTimeout = (int)SleepTimeout.NeverSleep;
     GameObject roomGlobals = GameObject.FindGameObjectWithTag("Room Settings");
     if (roomGlobals != null)
     {
         roomSettings = roomGlobals.GetComponent<RoomSettings>();
     }
 }