コード例 #1
0
        private IEnumerator FollowTarget(CameraFollowSetting setting)
        {
            if (clearShot == null)
            {
                yield break;
            }

            // Set up.
            clearShot.m_ActivateAfter        = setting.startDelay;
            clearShot.m_DefaultBlend.m_Time  = setting.moveToTargetDuration;
            clearShot.m_DefaultBlend.m_Style = setting.blendType;
            CinemachineVirtualCamera vcam = GetCurrentActiveCamera();

            setting.targetVcam.Priority = vcam.Priority + 1;

            #region Start delay, wait for seconds.
            if (setting.ignoreTimeScale)
            {
                yield return(new WaitForSecondsRealtime(setting.startDelay));
            }
            else
            {
                yield return(new WaitForSeconds(setting.startDelay));
            }
            #endregion

            // After start delay event.
            if (setting.followStartEvent != default)
            {
                setting.followStartEvent.Invoke();
            }

            #region Move duration and follow on duration, wait for seconds.
            float remainDuration = setting.moveToTargetDuration + setting.duration;
            if (setting.ignoreTimeScale)
            {
                yield return(new WaitForSecondsRealtime(remainDuration));
            }
            else
            {
                yield return(new WaitForSeconds(remainDuration));
            }
            #endregion

            setting.targetVcam.Priority = setting.originPriority;

            // Follow finished event.
            if (setting.followEndEvent != default)
            {
                setting.followEndEvent.Invoke();
            }

            // Go next camera follow setting.
            goNextTrigger = true;
        }
コード例 #2
0
    public override void CameraLockOn(float lockDuration)
    {
        var vcamIfrit   = CharacterVcamControl.Instance.ifrit.vcam;
        var vcamPlayer  = CharacterVcamControl.Instance.player.vcam;
        var styleIfrit  = Cinemachine.CinemachineBlendDefinition.Style.EaseIn;
        var stylePlayer = Cinemachine.CinemachineBlendDefinition.Style.EaseOut;

        CameraFollowSetting[] sets = new CameraFollowSetting[]
        {
            new CameraFollowSetting(vcamIfrit, styleIfrit, lockDuration, 0.5f, 0.2f, false, delegate { ImageEffectController.Instance.SetMotionBlur(1, 0.2f); }, ResetAiSwitchOn),
            new CameraFollowSetting(vcamPlayer, stylePlayer, 0f, 0.5f, 0f, false, null, ImageEffectController.Instance.DisableMotionBlur)
        };
        CameraControl.Follow.Instance.AddSet(sets);
    }