示例#1
0
    private void GetReward()
    {
        if (rewardItems != RewardItems.None)
        {
            switch (rewardItems)
            {
            case RewardItems.Coin:
                SaveSystem.AddUserCoin(rewardAmount);
                break;

            case RewardItems.Crystal:
                SaveSystem.AddUserCrystal(rewardAmount);
                break;

            case RewardItems.Energy:
                SaveSystem.AddUserEnergy(rewardAmount);
                break;

            case RewardItems.SpeicalGachaOne:
                UI_Manager.instance.PopupGetGacha(GachaSystem.GachaType.SpecialOne);
                break;
            }
            rewardItems = RewardItems.None;
        }
    }
示例#2
0
 void SellItemProcessing()
 {
     if (SellAbleCheck(ref sellItemId))
     {
         int value = ItemSystem.GetUserItemByCustomId(sellItemId).value;
         OnButtonEffectSound();
         if (ItemSystem.UseItem(sellItemId, 1))
         {
             SaveSystem.AddUserCoin(value);
             GoogleSignManager.SaveData();
             UI_Manager.instance.ShowGetAlert("Items/coin", string.Format("<color='yellow'>{0}</color> {1}{2}", Common.GetThousandCommaText(value), LocalizationManager.GetText("Coin"), LocalizationManager.GetText("alertGetMessage1")));
             if (callBackScript != null)
             {
                 callBackScript.GetComponent <UI_Manager_InventoryTab>().RefreshUI(Common.OrderByType.NAME);
             }
         }
         else
         {
             Item item = ItemSystem.GetUserItemByCustomId(sellItemId);
             if (item != null)
             {
                 UI_Manager.instance.ShowAlert(item.image, string.Format("<color='yellow'>{0}</color> {1} \r\n <color='grey'><size='20'>{2}</size></color>", ItemSystem.GetItemName(item.id), LocalizationManager.GetText("alertUnableSellMessage"), LocalizationManager.GetText("alertSellText")));
             }
         }
     }
     else
     {
         Item item = ItemSystem.GetUserItemByCustomId(sellItemId);
         if (item != null)
         {
             UI_Manager.instance.ShowAlert(item.image, string.Format("<color='yellow'>{0}</color> {1} \r\n <color='grey'><size='20'>{2}</size></color>", ItemSystem.GetItemName(item.id), LocalizationManager.GetText("alertUnableSellMessage"), LocalizationManager.GetText("alertUnableSellMessage2")));
         }
     }
 }
示例#3
0
    public IEnumerator StageClearing()
    {
        isStartGame = false;
        isEndGame   = true;
        HeroSystem.SaveHeros(Common.FindAlly());
        MapSystem.MapClear(stageInfo.mapNumber, stageInfo.stageClearPoint);
        MissionSystem.AddClearPoint(MissionSystem.ClearType.StageClear);
        MissionSystem.AddClearPoint(MissionSystem.ClearType.TotalStageCount);
        MissionSystem.PointSave();
        SaveSystem.AddUserCoin(stageInfo.stageCoin);
        stageInfo.stageExp = Common.GetUserExp(stageInfo.stageNumber);
        SaveSystem.ExpUp(stageInfo.stageExp);
        var getItems = GetStageItems();

        for (var i = 0; i < getItems.Count; i++)
        {
            ItemSystem.SetObtainItem(getItems[i].id);
        }
        GoogleSignManager.SaveData();
        UI_Manager.instance.OpenEndGamePanel(true);
        if (UnityEngine.Random.Range(0, 10) < 2)
        {
            GoogleAdMobManager.instance.OnBtnViewAdClicked();
        }
        yield return(null);
    }
示例#4
0
 void SellItemProcessing()
 {
     if (SellAbleCheck())
     {
         SoundManager.instance.EffectSourcePlay(AudioClipManager.instance.coinGet);
         for (int i = 0; i < sellItemList.Count; i++)
         {
             Debugging.Log("#1 >>" + sellItemList[i].name + "#" + sellItemList[i].customId + "#" + sellItemList[i].id);
             ItemSystem.UseItem(sellItemList[i].customId, 1);
         }
         SaveSystem.AddUserCoin(totalValue);
         UI_Manager.instance.ShowGetAlert("Items/coin", string.Format("<color='yellow'>{0}</color> {1} {2}", totalValue, LocalizationManager.GetText("Coin"), LocalizationManager.GetText("alertGetMessage1")));
         EnableUI();
     }
     else
     {
         UI_Manager.instance.ShowAlert("", string.Format("<color='yellow'></color> 은(는) 현재 판매할 수 없습니다. \r\n <color='grey'><size='20'>판매</size></color>"));
     }
 }
示例#5
0
    public void OnClickRewardButton(int id)
    {
        Mission mission = MissionSystem.GetUserMission(id);

        if (mission != null && mission.enable && !mission.clear)
        {
            MissionSystem.ClearMission(id);
            MissionSystem.RewardType rewardType = (MissionSystem.RewardType)mission.rewardType;

            switch (rewardType)
            {
            case MissionSystem.RewardType.coin:
                SaveSystem.AddUserCoin(mission.rewardItemCount);
                UI_Manager.instance.ShowGetAlert(Common.GetCoinCrystalEnergyImagePath(0), string.Format("<color='yellow'>{0}</color> {1} {2}", LocalizationManager.GetText("Coin"), mission.rewardItemCount, LocalizationManager.GetText("alertGetMessage4")));
                break;

            case MissionSystem.RewardType.crystal:
                SaveSystem.AddUserCrystal(mission.rewardItemCount);
                UI_Manager.instance.ShowGetAlert(Common.GetCoinCrystalEnergyImagePath(1), string.Format("<color='yellow'>{0}</color> {1} {2}", LocalizationManager.GetText("Crystal"), mission.rewardItemCount, LocalizationManager.GetText("alertGetMessage4")));
                break;

            case MissionSystem.RewardType.energy:
                SaveSystem.AddUserEnergy(mission.rewardItemCount);
                UI_Manager.instance.ShowGetAlert(Common.GetCoinCrystalEnergyImagePath(2), string.Format("<color='yellow'>{0}</color> {1} {2}", LocalizationManager.GetText("Energy"), mission.rewardItemCount, LocalizationManager.GetText("alertGetMessage4")));
                break;

            case MissionSystem.RewardType.scroll:
                ItemSystem.SetObtainItem(mission.rewardItemId, mission.rewardItemCount);
                Item rewardItem = ItemSystem.GetItem(mission.rewardItemId);
                UI_Manager.instance.ShowGetAlert(rewardItem.image, string.Format("<color='yellow'>{0}</color> {1}", rewardItem.name, LocalizationManager.GetText("alertGetMessage3")));
                break;
            }
        }
        else
        {
            Debugging.Log(id + " 의 미션클리어 실패");
        }
        RefreshUI();
    }