Exemplo n.º 1
0
 void Start()
 {
     terrain = GetComponent <TerrainReasoning>();
     Waypoint[,] waypoints = terrain.GetWaypoints();
     foreach (Waypoint wp in waypoints)
     {
         GameObject obj = Instantiate(waypointPrefab, wp.position, Quaternion.identity);
         obj.transform.Translate(0.0f, 0.01f, 0.0f);
         WaypointRepresentation wpr = obj.GetComponent <WaypointRepresentation>();
         wpr.SetCellSize(terrain.GetGridStep());
         objects.Add(wp, wpr);
     }
 }
Exemplo n.º 2
0
        public void Init()
        {
            if (_isInited)
            {
                return;
            }

            _world      = WorldState.GetInstance();
            _navigation = GetComponent <Navigation>();
            _shooting   = GetComponent <Shooting>();
            _terrain    = GetComponent <TerrainReasoning>();

            _controller = GetComponent <SoldierController>();
            _agentState = _controller.GetState();
            _enemyState = _agentState.enemyState;
        }