Example #1
0
    IEnumerator ToHide(CameraPathAnimator cpa, GameObject boat)
    {
        yield return(new WaitForSeconds(20));

        cpa.Stop();
        GameObject.Destroy(boat);
        GameObject.Destroy(cpa.gameObject);
    }
 public void StartFPS()
 {
     playerFPSController.SetActive(true);
     animator.Stop();
     animator.gameObject.SetActive(false);
     playerModel.SetActive(false);
     fpsCamera.enabled   = true;
     introCamera.enabled = false;
     playerFPSController.GetComponent <CPEMouseLook>().enabled = true;
 }
Example #3
0
    //=====================================================

    private void OnPostCutsceneFadeOutCompleteEvent()
    {
        ScreenManager.FadeOutCompleteEvent -= OnPostCutsceneFadeOutCompleteEvent;

        _isFadeCompelete = true;

        // Stop and clear cameraPathAnimator reference
        if (_cameraPathAnimator)
        {
            _cameraPathAnimator.Stop();
            _cameraPathAnimator = null;
        }

        // Returning to same scene - fade-in
        if (_currentCutscene == eCutsceneType.CRAWL_DOOR ||
            _currentCutscene == eCutsceneType.OBLIVION_PORTAL ||
            _currentCutscene == eCutsceneType.SWITCH_OPENS_DOOR_BOLT_01 ||
            _currentCutscene == eCutsceneType.SWITCH_OPENS_DOOR_BOLT_02 ||
            _currentCutscene == eCutsceneType.SWITCH_OPENS_DOOR_BOLT_03 ||
            _currentCutscene == eCutsceneType.SWITCH_OPENS_DOOR ||
            _currentCutscene == eCutsceneType.SWITCH_ACTIVATES_PLATFORM ||
            _currentCutscene == eCutsceneType.OPEN_CHEST ||
            _currentCutscene == eCutsceneType.DEATH_RESPAWN ||
            _currentCutscene == eCutsceneType.FLY_THRU ||
            _currentCutscene == eCutsceneType.BOSS_ROOM_START)
        {
            // Switch cameras
            _camera.GetComponent <AudioListener>().enabled = false;
            _camera.enabled = false;
            _mainCamera.GetComponent <AudioListener>().enabled = true;
            _mainCamera.enabled = true;
            _mainCamera.transform.FindChild("CameraInGameGui").GetComponent <Camera>().enabled = true;
            _mainCamera.GetComponent <CameraMovement>().InitWithPlayer(false);

            // Fade in - include short pause if necessary for fairy aniamtions
            var delay = (_currentCutscene == eCutsceneType.CRAWL_DOOR ||
                         _currentCutscene == eCutsceneType.OBLIVION_PORTAL) ? 0.3f : 0.0f;
            StartCoroutine(DelayPostCutsceneFadeIn(delay));
        }

        // Reset for next cutscene
        _currentCutscene = eCutsceneType.NULL;
        _cutsceneObject  = null;

        if (CutsceneCompleteEvent != null)
        {
            CutsceneCompleteEvent();
        }

        // Un-block player input
        if (InputManager.Instance != null)
        {
            InputManager.Instance.OnBlockInput(false);
        }
    }
Example #4
0
    private void Update()
    {
        if (Input.GetKeyUp(playBind))
        {
            pathAnimator.Play();
        }

        if (Input.GetKeyUp(pauseBind))
        {
            pathAnimator.Pause();
        }

        if (Input.GetKeyUp(stopBind))
        {
            pathAnimator.Stop();
        }

        if (Input.GetKeyUp(reverseBind))
        {
            if (pathAnimator.animationMode == CameraPathAnimator.animationModes.once)
            {
                pathAnimator.animationMode = CameraPathAnimator.animationModes.reverse;
            }
            else
            {
                pathAnimator.animationMode = CameraPathAnimator.animationModes.once;
            }
        }

        if (aniamtedCam != null)
        {
            if (Input.GetKey(zoomOutBind))
            {
                aniamtedCam.fieldOfView++;
            }

            if (Input.GetKey(zoomInBind))
            {
                aniamtedCam.fieldOfView--;
            }
        }

        if (Input.GetKey(speedUpBind))
        {
            pathAnimator.pathSpeed += Time.deltaTime;
        }

        if (Input.GetKey(slowDownBind))
        {
            pathAnimator.pathSpeed += -Time.deltaTime;
        }
    }
Example #5
0
    void OnGUI()
    {
        if (pathAnimator == null)
        {
            return;
        }

        GUILayout.BeginVertical("Box", GUILayout.Width(250));

        GUILayout.BeginHorizontal();

        if (!pathAnimator.isPlaying)
        {
            if (GUILayout.Button("REPLAY", GUILayout.Width(70)))
            {
                if (pathAnimator.animationMode != CameraPathAnimator.animationModes.reverse)
                {
                    pathAnimator.Seek(0);
                }
                else
                {
                    pathAnimator.Seek(1);
                }
                pathAnimator.Play();
            }
        }
        else
        {
            if (GUILayout.Button("START", GUILayout.Width(70)))
            {
                pathAnimator.Play();
            }
            if (GUILayout.Button("PAUSE", GUILayout.Width(70)))
            {
                pathAnimator.Pause();
            }
            if (GUILayout.Button("STOP", GUILayout.Width(60)))
            {
                pathAnimator.Stop();
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Current Animation Percentage " + (pathAnimator.percentage * 100).ToString("F1") + "%", GUILayout.Width(150));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Path: " + pathAnimator.gameObject.name);
        if (GUILayout.Button("SWITCH", GUILayout.Width(70)))
        {
            pathAnimator.Stop();
            if (pathAnimator == pathAnimatorA)
            {
                pathAnimator = pathAnimatorB;
            }
            else
            {
                pathAnimator = pathAnimatorA;
            }
            pathAnimator.Play();
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Seek to Percent " + (seekTo * 100).ToString("F1") + "%", GUILayout.Width(150));
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        seekTo = GUILayout.HorizontalSlider(seekTo, 0, 1);
        if (GUILayout.Button("Seek", GUILayout.Width(40)))
        {
            pathAnimator.Stop();
            pathAnimator.Seek(seekTo);
            pathAnimator.Play();
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        GUILayout.Label("Animation Mode:");
        GUILayout.Label(pathAnimator.animationMode.ToString());
        GUILayout.EndVertical();

        GUILayout.BeginVertical();
        GUILayout.Label("Orientation Mode:");
        GUILayout.Label(pathAnimator.orientationMode.ToString());
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();


        GUILayout.BeginHorizontal();

        GUILayout.BeginVertical();
        if (GUILayout.Button("Forward"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.once;
        }
        if (GUILayout.Button("Reverse"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.reverse;
        }
        if (GUILayout.Button("Loop"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.loop;
        }
        if (GUILayout.Button("Reverse Loop"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.reverseLoop;
        }
        if (GUILayout.Button("Ping Pong"))
        {
            pathAnimator.animationMode = CameraPathAnimator.animationModes.pingPong;
        }
        GUILayout.EndVertical();

        GUILayout.BeginVertical();
        if (GUILayout.Button("Custom"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.custom;
        }
        if (GUILayout.Button("Mouse look"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.mouselook;
        }
        if (GUILayout.Button("Follow Path"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.followpath;
        }
        if (GUILayout.Button("Reverse Follor Path"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.reverseFollowpath;
        }
        if (GUILayout.Button("CameraPathOnRailsTarget"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.target;
        }
        if (GUILayout.Button("Follow Transform"))
        {
            pathAnimator.orientationMode = CameraPathAnimator.orientationModes.followTransform;
        }
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();

        GUILayout.EndVertical();
    }
Example #6
0
 public void ResetPath()
 {
     CameraPath.Stop();
     CameraPath.Seek(0f);
     PathPosition = 0f;
 }