Exemple #1
0
    // Como hereda de player, ya tiene un FSM y un Steering

    protected override void Start()
    {
        base.Start();

        // Agregar los estados de este agente, chaser
        PrepareToPlay prepare = new PrepareToPlay(this);
        Nada          nada    = new Nada(this);
        ChaseBall     chase   = new ChaseBall(this);
        SearchGoal    search  = new SearchGoal(this);
        // EscortTeammate escort = new EscortTeammate(this);
        ChaseRival   rival     = new ChaseRival(this);
        Distancia    distancia = new Distancia(this);
        TakePosition take      = new TakePosition(this);

        fsm.AddState(ChaserStateID.nada, nada);
        fsm.AddState(ChaserStateID.PrepareToPlay, prepare);
        fsm.AddState(ChaserStateID.ChaseBall, chase);
        fsm.AddState(ChaserStateID.TakePosition, take);
        fsm.AddState(ChaserStateID.SearchGoal, search);
        // fsm.AddState(ChaserStateID.EscortTeammate, escort);
        fsm.AddState(ChaserStateID.ChaseRival, rival);
        fsm.AddState(GlobalStateID.Distancia, distancia);

        fsm.ChangeState(ChaserStateID.PrepareToPlay);
    }
Exemple #2
0
    // Como hereda de player, ya tiene un FSM y un Steering

    protected override void Start()
    {
        base.Start();

        // Agregar los estados de este agente, chaser
        PrepareToPlay  prepare = new PrepareToPlay(this);
        ChaseBall      chase   = new ChaseBall(this);
        SearchGoal     search  = new SearchGoal(this);
        EscortTeammate escort  = new EscortTeammate(this);
        ChaseRival     rival   = new ChaseRival(this);

        fsm.AddState(ChaserStateID.PrepareToPlay, prepare);
        fsm.AddState(ChaserStateID.ChaseBall, chase);
        fsm.AddState(ChaserStateID.SearchGoal, search);
        fsm.AddState(ChaserStateID.EscortTeammate, escort);
        fsm.AddState(ChaserStateID.ChaseRival, rival);

        fsm.ChangeState(ChaserStateID.PrepareToPlay);
    }
Exemple #3
0
    protected override void Start()
    {
        base.Start();
        posicionInicial  = transform.position;
        enemigosCercanos = new List <Transform>();
        // Agregar los estados de este agente, chaser
        ChaseBall  chase  = new ChaseBall(this);
        SearchGoal search = new SearchGoal(this);
        Support    supp   = new Support(this);
        Defense    def    = new Defense(this);
        Wait       w      = new Wait(this);

        fsm.AddState(ChaserStateID.ChaseBall, chase);
        fsm.AddState(ChaserStateID.SearchGoal, search);
        fsm.AddState(ChaserStateID.Support, supp);
        fsm.AddState(ChaserStateID.Defense, def);
        fsm.AddState(ChaserStateID.Wait, w);


        fsm.ChangeState(ChaserStateID.ChaseBall);
    }