public ActionCameraDirector(ActionCameraConfig pluginSettings, PluginCameraHelper helper, ref TimerHelper timerHelper) { this.player = new LivPlayerEntity(helper, ref timerHelper); this.timerHelper = timerHelper; this.cameraHelper = helper; this.pluginSettings = pluginSettings; randomizer = new System.Random(); player.SetOffsets(pluginSettings.forwardHorizontalOffset, pluginSettings.forwardVerticalOffset, pluginSettings.forwardDistance); OverShoulderCamera = new ShoulderActionCamera(pluginSettings); FullBodyActionCamera = new FullBodyActionCamera(pluginSettings); FPSCamera = new FPSCamera(pluginSettings, 0.2f); TacticalCamera = new TopDownActionCamera(pluginSettings, 0.6f, 6f); SetCamera(OverShoulderCamera); }
private void SetCamera(ActionCamera camera, bool saveLast = true, float timerOverride = 0) { if (currentCamera != camera) { if (saveLast) { lastCamera = currentCamera; } currentCamera = camera; isCameraStatic = false; timerHelper.ResetGlobalCameraTimer(); timerHelper.ResetCameraActionTimer(); if (timerOverride > 0) { timerHelper.SetGlobalTimer(timerOverride); } inGunMode = false; } }
public void SnapCamera(ActionCamera camera, bool revert = false) { PluginLog.Log("ActionCameraDirector", "SNAP "); camera.ApplyBehavior(ref cameraPositionTarget, ref cameraLookAtTarget, player, isCameraStatic); if (revert) { cameraLookAtVelocity = cameraLastLookAtVelocity; cameraVelocity = cameraLastVelocity; } else { cameraLastLookAtVelocity = cameraLookAt; cameraLastVelocity = cameraVelocity; cameraLookAtVelocity = Vector3.zero; cameraVelocity = Vector3.zero; } cameraPosition = cameraPositionTarget; cameraLookAt = cameraLookAtTarget; }
public FPSCamera(ActionCameraConfig settings, float timeBetweenChange) : base(settings, timeBetweenChange, Vector3.zero, true, false) { sightsCamera = new ScopeActionCamera(settings); ironSightsEnabled = false; }