cringe bug fix im stupid

in HealthHandmer
This commit is contained in:
Crizomb 2025-01-28 11:58:43 +01:00
parent 37bed1fd33
commit f5acd70d85
11 changed files with 135 additions and 53 deletions

View file

@ -4,11 +4,20 @@ public class DefensiveBehaviour : AbstractBehaviour
{
protected override void MoveAction()
{
throw new System.NotImplementedException();
if (CurrentMinecraftUnit.IsTeamA)
{
if (GlobalsVariable.AliveUnitsTeamB.Count == 0) return;
CurrentMinecraftUnit.MovementHandler.UpdateNearestFrom(GlobalsVariable.QueenA.transform);
}
else
{
if (GlobalsVariable.AliveUnitsTeamA.Count == 0) return;
CurrentMinecraftUnit.MovementHandler.UpdateNearestFrom(GlobalsVariable.QueenB.transform);
}
Vector3 targetPos = CurrentMinecraftUnit.MovementHandler.TargetUnit.transform.position;
Vector3 goalPos = targetPos + (transform.position - targetPos).normalized * distanceGoal;
CurrentMinecraftUnit.MovementHandler.MoveTowards(goalPos);
}
protected override void AttackAction()
{
throw new System.NotImplementedException();
}
}