Example #1
0
 private void InitializeFrontMostCamera()
 {
     if (GameObject.Find("FrontMostCamera") == null)
     {
         GameObject cameraObject = new GameObject();
         Camera     camera       = cameraObject.AddComponent <Camera>();
         camera.name          = "FrontMostCamera";
         camera.clearFlags    = CameraClearFlags.Nothing;
         camera.cullingMask   = 0;
         camera.depth         = Single.MinValue;
         beginHanlder         = camera.gameObject.AddComponent <OnFrameBeginHandler>();
         beginHanlder.enabled = false;
         cameraObject.SetActive(true);
         DontDestroyOnLoad(cameraObject);
     }
 }
 private void InitializeFrontMostCamera()
 {
     if (GameObject.Find("FrontMostCamera") == null) {
         GameObject cameraObject = new GameObject();
         Camera camera = cameraObject.AddComponent<Camera>();
         camera.name = "FrontMostCamera";
         camera.clearFlags = CameraClearFlags.Nothing;
         camera.cullingMask = 0;
         camera.depth = Single.MinValue;
         beginHanlder = camera.gameObject.AddComponent<OnFrameBeginHandler>();
         beginHanlder.enabled = false;
         cameraObject.SetActive(true);
         DontDestroyOnLoad(cameraObject);
     }
 }