Ejemplo n.º 1
0
    /**
     *   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());
        }
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    /**
     *   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();
    }