コード例 #1
0
 public void ReplenishButton()
 {
     if (showingCrew == null)
     {
         replenishButton.SetActive(false);
     }
     else
     {
         if (showingCrew.membersCount == Crew.MAX_MEMBER_COUNT)
         {
             replenishButton.SetActive(false);
         }
         else
         {
             var   colony   = GameMaster.realMaster.colonyController;
             float hireCost = RecruitingCenter.REPLENISH_COST;
             if (colony.energyCrystalsCount >= hireCost)
             {
                 colony.GetEnergyCrystals(hireCost);
                 showingCrew.AddMember();
                 PrepareButtons();
             }
             else
             {
                 AnnouncementCanvasController.NotEnoughMoneyAnnounce();
             }
         }
     }
 }
コード例 #2
0
 public bool StartHiring()
 {
     if (finding)
     {
         return(true);
     }
     else
     {
         if (Crew.crewsList.Count < GetCrewsSlotsCount())
         {
             if (colony.energyCrystalsCount >= hireCost)
             {
                 colony.GetEnergyCrystals(hireCost);
                 finding = true;
                 return(true);
             }
             else
             {
                 AnnouncementCanvasController.NotEnoughMoneyAnnounce();
                 return(false);
             }
         }
         else
         {
             AnnouncementCanvasController.MakeImportantAnnounce(Localization.GetRefusalReason(RefusalReason.NotEnoughSlots));
             if (GameMaster.soundEnabled)
             {
                 GameMaster.audiomaster.Notify(NotificationSound.NotEnoughSlots);
             }
             return(false);
         }
     }
 }
コード例 #3
0
    public void Charge()
    {
        ColonyController colony = GameMaster.realMaster.colonyController;

        if (colony.energyCrystalsCount >= 1)
        {
            if (colony.energyStored != colony.totalEnergyCapacity)
            {
                colony.GetEnergyCrystals(1);
                colony.AddEnergy(GameConstants.ENERGY_IN_CRYSTAL);
                if (GameMaster.soundEnabled)
                {
                    GameMaster.audiomaster.Notify(NotificationSound.BatteryCharged);
                }
            }
        }
        else
        {
            AnnouncementCanvasController.NotEnoughMoneyAnnounce();
        }
    }