public void SetSlowMotionKill(ConfigCameraSlowMotionKill config, float distTarget, float distCamera) { if (this.followState.slowMotionKillState.active) { this.followState.slowMotionKillState.SetSlowMotionKill(config, distTarget, distCamera); } else { this.followState.TryRemoveShortState(); this.followState.slowMotionKillState.SetSlowMotionKill(config, distTarget, distCamera); this.followState.AddShortState(this.followState.slowMotionKillState); } }
private void ShowLastKillCameraEffect(BaseMonoMonster monster) { BaseMonoAvatar avatar = Singleton <AvatarManager> .Instance.TryGetLocalAvatar(); Vector3 vector = monster.XZPosition - avatar.XZPosition; float magnitude = vector.magnitude; string filePath = (Singleton <MonsterManager> .Instance.LivingMonsterCount() != 0) ? "SlowMotionKill/Normal" : "SlowMotionKill/LastKill"; ConfigCameraSlowMotionKill config = ConfigUtil.LoadConfig <ConfigCameraSlowMotionKill>(filePath); MonoMainCamera mainCamera = Singleton <CameraManager> .Instance.GetMainCamera(); Vector3 vector2 = mainCamera.XZPosition - avatar.XZPosition; float distCamera = vector2.magnitude; mainCamera.SetSlowMotionKill(config, magnitude, distCamera); }
public void Set(ConfigCameraSlowMotionKill config, float distTarget, float distCamera) { this.outParams = new OutParams(); this._duration = config.Duration; this._timeScaleCurve = config.TimeScaleCurve; this._cameraSpeedCurve = config.CameraSpeedCurve; this._cameraRadiusOffsetCurve = config.CameraRadiusOffsetCurve; this._minCameraRotateAngle = config.MinCameraRotateAngle; this._maxCameraRotateAngle = config.MaxCameraRotateAngle; this._minCameraElevationOffset = config.MinCameraElevationOffset; this._maxCameraElevationOffset = config.MaxCameraElevationOffset; this._minCameraRadiusOffset = config.MinCameraRadiusOffset; this._maxCameraRadiusOffset = config.MaxCameraRadiusOffset; this._distanceAttenuationFactorsForRotateAngle = config.DistanceAttenuationFactorsForRotateAngle; this._distanceAttenuationFactorsForElevationOffset = config.DistanceAttenuationFactorsForElevationOffset; this._distTarget = distTarget; this._nearCase = distTarget < config.DistanceThreshold; this._cameraNearCase = distCamera < config.CameraDistanceThreshold; this._cameraSpeedCurveIntegral = CalcCurveIntegral01(this._cameraSpeedCurve); this._cameraElevationCurve = AnimationCurve.EaseInOut(0f, 0f, 0.5f, 1f); this._cameraElevationCurve.postWrapMode = WrapMode.PingPong; }