Ejemplo n.º 1
0
        public override float Run()
        {
            if (!isRunning)
            {
                isRunning = true;
                MainCamera mainCam = KickStarter.mainCamera;

                if (runtimeLinkedCamera && mainCam.attachedCamera != runtimeLinkedCamera)
                {
                    if (runtimeLinkedCamera is GameCameraThirdPerson)
                    {
                        GameCameraThirdPerson tpCam = (GameCameraThirdPerson)runtimeLinkedCamera;
                        tpCam.ResetRotation();
                    }
                    else if (runtimeLinkedCamera is GameCameraAnimated)
                    {
                        GameCameraAnimated animCam = (GameCameraAnimated)runtimeLinkedCamera;
                        animCam.PlayClip();
                    }

                    runtimeLinkedCamera.MoveCameraInstant();
                    mainCam.Crossfade(transitionTime, runtimeLinkedCamera, fadeCurve);

                    if (transitionTime > 0f && willWait)
                    {
                        return(transitionTime);
                    }
                }
            }
            else
            {
                isRunning = false;
            }

            return(0f);
        }