Пример #1
0
        public override void OnEnter()
        {
            AcquireCamera();
            if (targetCamera == null ||
                targetView == null)
            {
                Continue();
                return;
            }

            CameraController cameraController = CameraController.GetInstance();

            if (waitUntilFinished)
            {
                cameraController.waiting = true;
            }

            if (fadeTexture)
            {
                cameraController.screenFadeTexture = fadeTexture;
            }
            else
            {
                cameraController.screenFadeTexture = CameraController.CreateColorTexture(fadeColor, 32, 32);
            }

            cameraController.FadeToView(targetCamera, targetView, duration, fadeOut, delegate {
                if (waitUntilFinished)
                {
                    cameraController.waiting = false;
                    Continue();
                }
            });

            if (!waitUntilFinished)
            {
                Continue();
            }
        }