/** * this is the updated fucntion for the state */ public override void Excute(GameObject CallingObject) { Team TeamScript = CallingObject.GetComponent <Team>(); //if both teams in position, start the game if (TeamScript.AllPlayersAtHome() && TeamScript.Opponents.AllPlayersAtHome()) { TeamScript.ChangeState(CallingObject, Defending.Instance()); } }
public void Init(Region Pitch, List <GameObject> NewPlayers) { Players = new List <Player>(); PitchRef = Pitch; SetUpPlayers(NewPlayers); CurrentState = Defending.Instance(); PreviousState = Defending.Instance(); CurrentState.Enter(gameObject); }
/** * this is the updated fucntion for the state */ public override void Excute(GameObject CallingObject) { Team TeamScript = CallingObject.GetComponent <Team>(); if (!TeamScript.InControl()) { TeamScript.ChangeState(CallingObject, Defending.Instance()); return; } TeamScript.DetermineBestSupportingPosition(); }