This commit is contained in:
MrTorex committed 2026-02-17 17:28:32 +03:00
1 parent fd3a472348
commit 8302032c9f
10 files changed
+2191 -2

No files matched your search

+7 -1
View File
@@ -19,7 +19,13 @@ namespace Code.Base
Steering = new Steering();
}
public void SetSteering(Steering steering) => Steering = steering;
public void SetSteering(Steering steering) => SetSteering(steering, 1.0f);
public void SetSteering(Steering steering, float weight)
{
Steering.Linear += weight * steering.Linear;
Steering.Angular += weight * steering.Angular;
}
public virtual void Update()
{
+2 -1
View File
@@ -4,6 +4,7 @@ namespace Code.Base
{
public class AgentBehaviour : MonoBehaviour
{
public float weight = 1.0f;
public GameObject target;
protected Agent Agent;
@@ -14,7 +15,7 @@ namespace Code.Base
public virtual void Update()
{
Agent.SetSteering(GetSteering());
Agent.SetSteering(GetSteering(), weight);
}
public virtual Steering GetSteering()