change: all movement separated into invidividual tasks, a lot of shuffling value groups and related stuff around

This commit is contained in:
Chris
2025-09-16 17:07:20 -04:00
parent 7a0499f36a
commit aad8b78c22
17 changed files with 1507 additions and 1036 deletions

View File

@@ -0,0 +1,67 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Reset.Core;
using UnityEngine;
namespace Reset.Units {
[Category("Reset/Movement")]
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;
//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() {
return null;
}
//This is called once each time the task is enabled.
//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);
}
EndAction(true);
}
//Called once per frame while the action is active.
protected override void OnUpdate() {
}
//Called when the task is disabled.
protected override void OnStop() {
}
//Called when the task is paused.
protected override void OnPause() {
}
}
}