update scripts
This commit is contained in:
@ -51,6 +51,20 @@ public class GameManager : MonoBehaviour
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsEnemyNearby(Vector3 currentTransform, Team team)
|
||||
{
|
||||
SimpleMultiAgentGroup agentGroup;
|
||||
if (team == Team.Attackers)
|
||||
agentGroup = AttackersTeam;
|
||||
else
|
||||
agentGroup = DefendersTeam;
|
||||
|
||||
foreach (var agent in agentGroup.GetRegisteredAgents())
|
||||
if ((currentTransform - agent.transform.position).magnitude < SettingsReader.Instance.GetSettings.ViewDistance)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsCloserToFlagFromNextNavPoint(NavPoint navPoint, Vector3 currentTransform)
|
||||
=> navPoint.FlagDistance < (currentTransform - GameObject.FindGameObjectWithTag("Flag").transform.position).magnitude;
|
||||
|
||||
|
Reference in New Issue
Block a user