Exemplo n.º 1
0
    void Awake() {
        maneuverPositionList = new Dictionary<string, Transform>();
        tanks = GameObject.FindGameObjectsWithTag("Tank");

        foreach(GameObject tank in tanks){ 
            if(tank.name == "CyberTank Leader"){ 
               leader = tank;
               coordinator = leader.GetComponent<TankCoordinator>();
            }
        }
    }
Exemplo n.º 2
0
    //Initialize the Finite state machine for the NPC tank
    protected override void Initialize()
    {
        coordinator = FindObjectOfType <TankCoordinator>();
        curState    = FSMState.Scouting;

        platoonDist = coordinator.platoonDist;

        bDead = false;

        //Get the turret of the tank
        turret           = gameObject.transform.GetChild(0).transform;
        bulletSpawnPoint = turret.GetChild(0).transform;

        agent       = GetComponent <NavMeshAgent>();
        agent.speed = curSpeed;
        timer       = scoutTimer;
    }