void doAimCameraTransition()
    {
        aimCamera.GetComponent <CinemachineFreeLook>().m_XAxis = idleCamera.GetComponent <CinemachineFreeLook>().m_XAxis;
        aimCamera.GetComponent <CinemachineFreeLook>().m_YAxis = idleCamera.GetComponent <CinemachineFreeLook>().m_YAxis;

        aimCamera.Priority = 11;
    }
예제 #2
0
        void OnGameOver(GameOverEvent evt)
        {
            if (m_GameState == GameState.Play)
            {
                // Stop colliding the camera.
                var cinemachineCollider = m_FreeLookCamera.GetComponent <CinemachineCollider>();
                if (cinemachineCollider)
                {
                    cinemachineCollider.enabled = false;
                }

                // Set game state and handle the camera accordingly.
                if (evt.Win)
                {
                    m_GameOverSceneTime = Time.time + m_GameOverWinSceneDelay;

                    SetGameState(GameState.Win);

                    // Zoom in on the player.
                    StartCoroutine(ZoomInOnPlayer());
                }
                else
                {
                    m_GameOverSceneTime = Time.time + m_GameOverLoseSceneDelay;

                    SetGameState(GameState.Lose);

                    // Stop following the player.
                    m_FreeLookCamera.Follow = null;
                }
            }
        }
예제 #3
0
    private void Start()
    {
        //if (screenTargets.Count == 0)
        //{
        //    Target[] targets = FindObjectsOfType<Target>();
        //    foreach(var t in targets)
        //    {
        //        screenTargets.Add(t.transform);
        //    }
        //}

        input          = GetComponent <PlayerController>();
        Cursor.visible = false;

        anim = GetComponentInChildren <Animator>();

        impulse = cameraFreelock.GetComponent <CinemachineImpulseSource>();

        postVolume  = Camera.main.GetComponent <PostProcessVolume>();
        postProfile = postVolume.profile;

        swordOrigPos      = sword.localPosition;
        swordOrigRot      = sword.localEulerAngles;
        swordMesh         = sword.GetComponentInChildren <MeshRenderer>();
        swordMesh.enabled = false;

        cutplane.gameObject.SetActive(false);
    }
 public void ShakeCamera()
 {
     TPCamera.GetComponent <CinemachineImpulseSource>().GenerateImpulse();
     foreach (ParticleSystem p in particles)
     {
         p.Play();
     }
 }
예제 #5
0
 // Start is called before the first frame update
 void Start()
 {
     zoomOut         = thirdPersonCam.m_Lens.FieldOfView;
     originalZoom    = thirdPersonCam.m_Orbits[1].m_Radius;
     impulse         = thirdPersonCam.GetComponent <CinemachineImpulseSource>();
     fixedRotation.x = transform.rotation.x;
     comp            = thirdPersonCam.GetRig(1).GetCinemachineComponent <CinemachineComposer>();
     Cursor.visible  = false;
 }
예제 #6
0
    // Start is called before the first frame update
    void Start()
    {
        Cursor.visible = false;

        input             = GetComponent <MovementInput>();
        anim              = GetComponent <Animator>();
        impulse           = cameraFreeLook.GetComponent <CinemachineImpulseSource>();
        postVolume        = Camera.main.GetComponent <PostProcessVolume>();
        postProfile       = postVolume.profile;
        swordOrigRot      = sword.localEulerAngles;
        swordOrigPos      = sword.localPosition;
        swordMesh         = sword.GetComponentInChildren <MeshRenderer>();
        swordMesh.enabled = false;
    }
예제 #7
0
    // Start is called before the first frame update
    void Start()
    {
        anim         = GetComponent <Animator>();
        input        = GetComponent <MovementInput>();
        originalZoom = thirdPersonCam.m_Orbits[1].m_Radius;
        impulse      = thirdPersonCam.GetComponent <CinemachineImpulseSource>();
        postVolume   = Camera.main.GetComponent <PostProcessVolume>();
        postProfile  = postVolume.profile;
        colorG       = postProfile.GetSetting <ColorGrading>();

        gunIdlePos = gun.localPosition;
        gunIdleRot = gun.localEulerAngles;

        Cursor.visible = false;

        HorizontalOffset(originalOffsetAmount);
    }
예제 #8
0
        private void Awake()
        {
            Instance = this;

            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;

            screenTargets     = new HashSet <SkillTarget>();
            moveInput         = GetComponent <MovementInput>();
            anim              = GetComponent <Animator>();
            impulse           = cameraFreeLook.GetComponent <CinemachineImpulseSource>();
            mainCam           = Camera.main;   //2020 之后 camera.main 优化了   但是代码习惯
            postProfile       = postVolume.profile;
            swordOrigPos      = sword.localPosition;
            swordOrigRot      = sword.localEulerAngles;
            swordMesh         = sword.GetComponentInChildren <MeshRenderer>();
            swordMesh.enabled = false;
        }
        private void Start()
        {
            Cursor.visible   = true;
            Cursor.lockState = CursorLockMode.Locked;

            anim       = GetComponent <Animator>();
            cam        = Camera.main;
            controller = GetComponent <CharacterController>();

            normalFOV = cvCam.m_Lens.FieldOfView;
            composers = new CinemachineComposer[3];
            for (int i = 0; i < 3; i++)
            {
                composers[i] = cvCam.GetRig(i).GetCinemachineComponent <CinemachineComposer>();
            }

            impulse = cvCam.GetComponent <CinemachineImpulseSource>();

            normalOffset = composers[0].m_TrackedObjectOffset;
        }
예제 #10
0
        private void Awake()
        {
            instance = this;

            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;

            anim         = GetComponent <Animator>();
            input        = GetComponent <MovementInput>();
            originalZoom = thirdPersonCam.m_Orbits[1].m_Radius;
            impulse      = thirdPersonCam.GetComponent <CinemachineImpulseSource>();

            postProfile = postVolume.profile;
            postProfile.TryGet(out colorAdjustments);
            postProfile.TryGet(out chromaticAberration);
            postProfile.TryGet(out vignette);

            gunIdlePos = gun.localPosition;
            gunIdleRot = gun.localEulerAngles;

            HorizontalOffset(originalOffsetAmount);
        }
 void ShakeCamera()
 {
     cmCamera.GetComponent <CinemachineImpulseSource>().GenerateImpulse();
 }
예제 #12
0
 void Start()
 {
     input         = GetComponent <MovementInput>();
     impulseSource = freeLookCamera.GetComponent <CinemachineImpulseSource>();
 }
예제 #13
0
 public void FreezeCam()
 {
     cineCam.GetComponent <CinemachineFreeLook>().m_XAxis.m_MaxSpeed = 0;
     cineCam.GetComponent <CinemachineFreeLook>().m_YAxis.m_MaxSpeed = 0;
 }