Ejemplo n.º 1
0
 public void Initialize(Team team, bool isFinished = false)
 {
     HitPoints          = GetComponent <HitPoints>();
     HitPoints.OnDeath += DeathHandler;
     Team            = team;
     this.isFinished = isFinished;
     foreach (var renderer in renderers)
     {
         renderer.material.SetColor("_Color", team.teamColor);
     }
     HitPoints.Initialize(maxHP);
 }
Ejemplo n.º 2
0
 public void Initialize(Team team, Building buildingPrefab, MapTile tile, TileDirection direction)
 {
     HitPoints          = GetComponent <HitPoints>();
     HitPoints.OnDeath += DeathHandler;
     Tile     = tile;
     Team     = team;
     Building = Instantiate(buildingPrefab, transform.position, Quaternion.Euler(0, (int)direction * 90, 0), transform);
     Building.Initialize(team);
     buildingPoints = 0;
     progressBar.SetProgress(buildingPoints / Building.buildingPointsCost);
     resourcesLeftToCollect = new ResourceCollection(Building.cost);
     State      = ConstructionState.GatheringResources;
     deliveries = new List <Delivery>();
     HitPoints.Initialize(maxHP);
 }