SoldierWrapper
The Soldier Wrapper class is the Base class that your bot class will inherit from. This class contains essential movements such as moving and interacting.
void SetName(string soldierName)
Your bot class should call this method upon Awake. soldierName is the name your bots will be given.
Vector3 enemySpawnLocation
enemySpawnLocation is the center of the spawn box for the enemy team. It is also the location of the enemy flag if it is untouched.
Vector3 spawnLocation
spawnLocation is the center of the spawn box for the team of this bot. It is also the location of the team flag if it is untouched.
List<IAgent> soldierInSight
soldierInSight is a list that is dynamically populated with any Agents within the view of our bot, whether they be on the enemy team or not.
Warning: The list is not sorted based on any properties.
List<IGrabable> flagsInSight
flagsInSight is a list that is dynamically populated with any flags within the view of our bot, whether they belong to the enemy team or not.
All flags are grabbed automatically as long as they are visible, belong to the enemy team, and are within range.
Warning: The list is not sorted based on any properties.
List<SoldierWrapper> GetTeamSoldiers()
Returns a list of soldiers on your team.
RaycastHit Raycast(Vector3 direction)
RaycastHit Raycast(Vector3 direction, float length)
RaycastHit Raycast(Vector3 direction, float length, LayerMask layerMask)
Casts a ray in the direction from the soldier. Returns a RaycastHit.transform null if the direction is out of the view cone, or if no object is hit.
if(Raycast(Vector3.forward).transform)
void Shoot()
Calls the shoot method on the weapon class on the gun object.
bool LookAt(Vector3 position)
position is the position the soldier will look at.
bool response is true if we are within 0.5 degrees of the position. Useful for checking if we are aiming at the enemy we spotted or not.
void Move(Vector3 direction)
Changes velocity to match the direction. The Vector3 will not be oriented to the bot, a direction with z = 1 will move the bot on the z axis no matter it's rotation.
void MoveTowards(Vector3 position)
Calls the Move method and subtracts the position by the transform.position to get a direction.
void GrabFlag(IGrabable flag)
Happen to have a reference to a flag? Flags are automatically grabbed so this is not necessary for many cases.
virtual DamageCallback(Vector3 location)
location is the location of the soldier who hit you was when the bullet was fired.
Your bot class can override the method and use the location to its advantage.
public override void DamageCallback(Vector3 location) { }
virtual FlagStatusChangedCallback(IGrabable flag)
flag is the flag that was affected.
This callback is called whether the flag is on your team or the other team and is called when the flag's state has been changed, such as being dropped or grabbed.
Your bot class can override the method and access the flag's interface.
public override void FlagStatusChangedCallback(IGrabable flag) { }
virtual SoldierDiedCallback(IAgent agent)
agent is the agent that was affected.
This callback is called whether the agent is on your team or the other team.
Your bot class can override the method and access the agent's interface.
public override void SoldierDiedCallback(IAgent agent) { }
Version 1.0