Exemplo n.º 1
0
 private void InitializeBackMostCamera()
 {
     if (GameObject.Find("BackMostCamera") == null)
     {
         GameObject cameraObject = new GameObject();
         Camera     camera       = cameraObject.AddComponent <Camera>();
         camera.name        = "BackMostCamera";
         camera.clearFlags  = CameraClearFlags.Nothing;
         camera.cullingMask = 0;
         camera.depth       = Single.MaxValue;
         endHanlder         = camera.gameObject.AddComponent <OnFrameEndHandler>();
         endHanlder.enabled = false;
         cameraObject.SetActive(true);
         DontDestroyOnLoad(cameraObject);
     }
 }
Exemplo n.º 2
0
 private void InitializeBackMostCamera()
 {
     if (GameObject.Find("BackMostCamera") == null) {
         GameObject cameraObject = new GameObject();
         Camera camera = cameraObject.AddComponent<Camera>();
         camera.name = "BackMostCamera";
         camera.clearFlags = CameraClearFlags.Nothing;
         camera.cullingMask = 0;
         camera.depth = Single.MaxValue;
         endHanlder = camera.gameObject.AddComponent<OnFrameEndHandler>();
         endHanlder.enabled = false;
         cameraObject.SetActive(true);
         DontDestroyOnLoad(cameraObject);
     }
 }