Пример #1
0
 public void StartConstructing()
 {
     if (observingHangar.constructing)
     {
         observingHangar.StopConstruction();
         PrepareHangarWindow();
     }
     else
     {
         if (GameMaster.colonyController.energyCrystalsCount >= Shuttle.STANDART_COST)
         {
             ColonyController colony = GameMaster.colonyController;
             colony.GetEnergyCrystals(Shuttle.STANDART_COST);
             if (colony.storage.CheckBuildPossibilityAndCollectIfPossible(ResourcesCost.GetCost(ResourcesCost.SHUTTLE_BUILD_COST_ID)))
             {
                 observingHangar.StartConstruction();
                 PrepareHangarWindow();
             }
             else
             {
                 UIController.current.MakeAnnouncement(Localization.GetAnnouncementString(GameAnnouncements.NotEnoughResources));
             }
         }
         else
         {
             UIController.current.MakeAnnouncement(Localization.GetAnnouncementString(GameAnnouncements.NotEnoughEnergyCrystals));
             constructButton.GetComponent <Image>().overrideSprite = null;
         }
     }
 }