change: finished and cleaned all settings changes, code commented, smoothing and easing are now exponential
This commit is contained in:
@@ -9,32 +9,36 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
[Category("Reset")]
|
||||
[Description("Change Cinemachine camera settings for the player")]
|
||||
public class ChangeCameraSettings : ActionTask{
|
||||
[ParadoxNotion.Design.Header("Main Settings")]
|
||||
[ParadoxNotion.Design.Header("Main Settings"), Space(8)]
|
||||
public FloatValueGroup fieldOfView = new (newLabel: "FOV");
|
||||
|
||||
[ParadoxNotion.Design.Header("Orbit Follow Ring Settings"), Space (5)]
|
||||
|
||||
public Vector3ValueGroup orbitTargetOffset = new(newLabel: "Target Offset");
|
||||
[Space(5)]public Vector3ValueGroup orbitPositionDamping = new(newLabel: "Position Damping");
|
||||
|
||||
public OrbitalFollowValueGroup orbitFollowTop = new (newLabel: "Top");
|
||||
public OrbitalFollowValueGroup orbitFollowCenter = new (newLabel: "Center");
|
||||
public OrbitalFollowValueGroup orbitFollowBottom = new (newLabel: "Bottom");
|
||||
|
||||
[ParadoxNotion.Design.Header("Orbit Follow Ring Settings"), Space (5)]
|
||||
public OrbitalFollowValueGroup orbitFollowTop = new (newLabel: "Top Ring");
|
||||
public OrbitalFollowValueGroup orbitFollowCenter = new (newLabel: "Top Ring");
|
||||
[Space(8)]
|
||||
public OrbitalFollowValueGroup orbitFollowBottom = new (newLabel: "Top Ring");
|
||||
|
||||
public BoolValueGroup enableXAxis = new (newLabel: "Input Axis X Enabled");
|
||||
public BoolValueGroup enableYAxis = new (newLabel: "Input Axis Y Enabled");
|
||||
|
||||
public FloatValueGroup axisLookXGain = new (newLabel: "Look Orbit X Gain");
|
||||
public FloatValueGroup axisLookYGain = new (newLabel: "Look Orbit Y Gain");
|
||||
|
||||
[ParadoxNotion.Design.Header("Rotation Composer Settings")]
|
||||
[ParadoxNotion.Design.Header("Rotation Composer Settings"), Space(8)]
|
||||
public Vector2ValueGroup screenPosition = new (newLabel: "Screen Position");
|
||||
|
||||
[ParadoxNotion.Design.Header("Camera Offset Settings")]
|
||||
[ParadoxNotion.Design.Header("Camera Offset Settings"), Space(8)]
|
||||
public Vector3ValueGroup cameraOffset = new (newLabel: "Offset");
|
||||
|
||||
private CameraSettingsProcessor processor;
|
||||
|
||||
//Use for initialization. This is called only once in the lifetime of the task.
|
||||
//Return null if init was successfull. Return an error string otherwise
|
||||
protected override string OnInit(){
|
||||
processor = CameraSettingsProcessor.Instance;
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -42,29 +46,28 @@ namespace NodeCanvas.Tasks.Actions {
|
||||
//Call EndAction() to mark the action as finished, either in success or failure.
|
||||
//EndAction can be called from anywhere.
|
||||
protected override void OnExecute(){
|
||||
OrbitalFollowValueGroup.UpdateValue(orbitFollowTop, ref CameraSettingsProcessor.data.orbitFollowTopHeight.targetValue, ref CameraSettingsProcessor.original.orbitFollowTopRadius.targetValue);
|
||||
OrbitalFollowValueGroup.UpdateValue(orbitFollowCenter, ref CameraSettingsProcessor.data.orbitFollowCenterHeight.targetValue, ref CameraSettingsProcessor.original.orbitFollowCenterRadius.targetValue);
|
||||
OrbitalFollowValueGroup.UpdateValue(orbitFollowBottom, ref CameraSettingsProcessor.data.orbitFollowBottomHeight.targetValue, ref CameraSettingsProcessor.original.orbitFollowBottomRadius.targetValue);
|
||||
OrbitalFollowValueGroup.UpdateValue(orbitFollowTop, processor.data.orbitFollowTopHeight, processor.data.orbitFollowTopRadius);
|
||||
OrbitalFollowValueGroup.UpdateValue(orbitFollowCenter, processor.data.orbitFollowCenterHeight, processor.data.orbitFollowCenterRadius);
|
||||
OrbitalFollowValueGroup.UpdateValue(orbitFollowBottom, processor.data.orbitFollowBottomHeight, processor.data.orbitFollowBottomRadius);
|
||||
|
||||
Vector3ValueGroup.UpdateValue(cameraOffset, ref CameraSettingsProcessor.data.cameraOffsetOffset.targetValue, ref CameraSettingsProcessor.original.cameraOffsetOffset.targetValue);
|
||||
Vector3ValueGroup.UpdateValue(cameraOffset, processor.data.cameraOffsetOffset);
|
||||
|
||||
Vector3ValueGroup.UpdateValue(orbitPositionDamping, ref CameraSettingsProcessor.data.orbitPositionDamping.targetValue, ref CameraSettingsProcessor.original.cameraOffsetOffset.targetValue);
|
||||
Vector3ValueGroup.UpdateValue(orbitTargetOffset, ref CameraSettingsProcessor.data.orbitTargetOffset.targetValue, ref CameraSettingsProcessor.original.cameraOffsetOffset.targetValue);
|
||||
Vector3ValueGroup.UpdateValue(orbitPositionDamping, processor.data.orbitPositionDamping);
|
||||
Vector3ValueGroup.UpdateValue(orbitTargetOffset, processor.data.orbitTargetOffset);
|
||||
|
||||
Vector2ValueGroup.UpdateValue(screenPosition, ref CameraSettingsProcessor.data.rotationComposerScreenPos.targetValue, ref CameraSettingsProcessor.original.rotationComposerScreenPos.targetValue);
|
||||
FloatValueGroup.UpdateValue(fieldOfView, ref CameraSettingsProcessor.data.mainFieldOfView.targetValue, ref CameraSettingsProcessor.original.mainFieldOfView.targetValue);
|
||||
Vector2ValueGroup.UpdateValue(screenPosition, processor.data.rotationComposerScreenPos);
|
||||
|
||||
FloatValueGroup.UpdateValue(axisLookXGain, ref CameraSettingsProcessor.data.axisLookGainX.targetValue, ref CameraSettingsProcessor.original.axisLookGainX.targetValue);
|
||||
FloatValueGroup.UpdateValue(axisLookYGain, ref CameraSettingsProcessor.data.axisLookGainY.targetValue, ref CameraSettingsProcessor.original.axisLookGainY.targetValue);
|
||||
FloatValueGroup.UpdateValue(fieldOfView, processor.data.mainFieldOfView);
|
||||
|
||||
BoolValueGroup.UpdateValue(enableXAxis, ref CameraSettingsProcessor.data.axisLookEnabledX.targetValue, ref CameraSettingsProcessor.original.axisLookEnabledX.targetValue);
|
||||
BoolValueGroup.UpdateValue(enableYAxis, ref CameraSettingsProcessor.data.axisLookEnabledY.targetValue, ref CameraSettingsProcessor.original.axisLookEnabledY.targetValue);
|
||||
FloatValueGroup.UpdateValue(axisLookXGain, processor.data.axisLookGainX);
|
||||
FloatValueGroup.UpdateValue(axisLookYGain, processor.data.axisLookGainY);
|
||||
|
||||
BoolValueGroup.UpdateValue(enableXAxis, processor.data.axisLookEnabledX);
|
||||
BoolValueGroup.UpdateValue(enableYAxis, processor.data.axisLookEnabledY);
|
||||
|
||||
EndAction(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Called once per frame while the action is active.
|
||||
protected override void OnUpdate() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user