change: finished and cleaned all settings changes, code commented, smoothing and easing are now exponential
This commit is contained in:
@@ -10,15 +10,9 @@ namespace Reset.Units {
|
||||
public class ChangeDirectionSettings : ActionTask<UnitMovementHandler> {
|
||||
// Direction
|
||||
[Space(5)]
|
||||
public Vector3ValueGroup feedNewDirection = new Vector3ValueGroup("Feed New Direction");
|
||||
public float newDirectionStrength;
|
||||
[Space(5)]
|
||||
public Vector2 addDirectionFromInput;
|
||||
public float addInputStrength;
|
||||
[SliderField(0,1)]
|
||||
public float addInputPriorty;
|
||||
|
||||
public FloatValueGroup directionSmoothing = new FloatValueGroup("Direction Smoothing");
|
||||
public FloatValueGroup directionChangingSoftness = new FloatValueGroup("Direction Changing Softness");
|
||||
public FloatValueGroup directionSpinningHardness = new FloatValueGroup("Direction Spinning Hardness");
|
||||
public FloatValueGroup directionSpinningSpeed = new FloatValueGroup("Direction Spinning Speed");
|
||||
|
||||
//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
|
||||
@@ -30,23 +24,9 @@ namespace Reset.Units {
|
||||
//Call EndAction() to mark the action as finished, either in success or failure.
|
||||
//EndAction can be called from anywhere.
|
||||
protected override void OnExecute() {
|
||||
// Direction from value
|
||||
// Check that feedDir is not changed
|
||||
// UpdateVector3Value(feedNewDirection, ref feedDir, ref feedDir);
|
||||
//
|
||||
// Vector3ValueGroup.ResolvedValue(feedNewDirection, ref feedDir, ref feedDir);
|
||||
//
|
||||
// // If there's a direciton add it to the player for a frame
|
||||
// if (feedDir != Vector3.zero) {
|
||||
// agent.AddToCurrentDirection(agent.transform.rotation * feedDir.normalized, newDirectionStrength);
|
||||
// // Reset the fed direction after it's added so future runs don't have
|
||||
// feedDir = Vector3.zero;
|
||||
// }
|
||||
|
||||
// Direction from controller input
|
||||
if (addDirectionFromInput != Vector2.zero){
|
||||
agent.OverwriteDirectionFromInput(new Vector3(addDirectionFromInput.x, addDirectionFromInput.y), addInputPriorty, addInputStrength);
|
||||
}
|
||||
FloatValueGroup.UpdateValue(directionChangingSoftness, agent.data.directionChangingSoftness);
|
||||
FloatValueGroup.UpdateValue(directionSpinningHardness, agent.data.directionSpinningHardness);
|
||||
FloatValueGroup.UpdateValue(directionSpinningSpeed, agent.data.directionSpinningSpeed);
|
||||
|
||||
EndAction(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user