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); } }
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); } }