next level logic

This commit is contained in:
Crizomb 2025-01-28 04:11:53 +01:00
parent ee2a5fdf08
commit 37bed1fd33
16 changed files with 130 additions and 38 deletions

View file

@ -5,14 +5,23 @@ public class NeutralBehaviour : AbstractBehaviour
[SerializeField] private float distanceGoal = 0.0f;
protected override void MoveAction()
{
Unit.MovementHandler.UpdateNearest();
Vector3 targetPos = Unit.MovementHandler.TargetUnit.transform.position;
if (CurrentMinecraftUnit.IsTeamA)
{
if (GlobalsVariable.AliveUnitsTeamB.Count == 0) return;
}
else
{
if (GlobalsVariable.AliveUnitsTeamA.Count == 0) return;
}
CurrentMinecraftUnit.MovementHandler.UpdateNearest();
Vector3 targetPos = CurrentMinecraftUnit.MovementHandler.TargetUnit.transform.position;
Vector3 goalPos = targetPos + (transform.position - targetPos).normalized * distanceGoal;
Unit.MovementHandler.MoveTowards(goalPos);
CurrentMinecraftUnit.MovementHandler.MoveTowards(goalPos);
}
protected override void AttackAction()
{
//Unit.AttackHandler.Attack();
//CurrentMinecraftUnit.AttackHandler.Attack();
}
}