Beispiel #1
0
 public void Raze()
 {
     if (playerBuildingConfig)
     {
         foreach (BuildingEffectConfig buildingEffectConfig in playerBuildingConfig.GetEffects())
         {
             system.GetComponent <Effects>().RemoveEffects(buildingEffectConfig);
         }
         playerBuildingConfig = null;
     }
 }
Beispiel #2
0
 private void OnDestroy()
 {
     if (playerBuildingConfig)
     {
         foreach (BuildingEffectConfig buildingEffectConfig in playerBuildingConfig.GetEffects())
         {
             if (!buildingEffectConfig.isEmpireWide())
             {
                 system.GetComponent <Effects>().RemoveEffects(buildingEffectConfig);
             }
             else
             {
                 Empire empire = system.GetEmpire();
                 if (empire)
                 {
                     empire.GetComponent <Effects>().RemoveEffects(buildingEffectConfig);
                 }
             }
         }
         playerBuildingConfig = null;
     }
 }
    public bool BuildPlayerBuilding(PlayerBuildingConfig playerBuildingConfig, Player player, int buildingNumber)
    {
        if (!playerSpyNetworks.ContainsKey(player))
        {
            return(false);
        }

        if (playerBuildings[player].Count >= maxPlayerBuildings)
        {
            return(false);
        }



        PlayerBuilding playerBuilding = Instantiate(playerBuildingGameObject, transform.Find("PlayerBuildings")).GetComponent <PlayerBuilding>();

        playerBuilding.SetConfig(playerBuildingConfig);
        playerBuilding.SetSystem(GetComponent <SolarSystem>());
        playerBuilding.Build(buildingNumber);
        playerBuildings[player].Add(playerBuilding);

        return(true);
    }
Beispiel #4
0
 public void SetBuildingConfig(PlayerBuildingConfig playerBuildingConfig)
 {
     this.playerBuildingConfig = playerBuildingConfig;
     iconImage.sprite          = playerBuildingConfig.GetBuildingImage();
 }
Beispiel #5
0
 public void SetConfig(PlayerBuildingConfig playerBuildingConfig)
 {
     this.playerBuildingConfig = playerBuildingConfig;
 }
Beispiel #6
0
 public void SelectBuilding(PlayerBuildingConfig playerBuildingConfig)
 {
     currentSystem.GetComponent <PlayerBuildingController>().BuildPlayerBuilding(playerBuildingConfig, currentPlayer, buildingNumber);
     systemUI.UpdateSystem(currentSystem);
     Deactivate();
 }