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; } }
public static void SetObtainMoney(int id) { Item obtainMoney = items.Find(item => item.id == id || item.id.Equals(id)); if (obtainMoney != null) { // 수정 if (obtainMoney.id > 9000 && obtainMoney.id < 9010) { SaveSystem.AddUserCrystal(obtainMoney.count); } // 에너지 else if (obtainMoney.id > 9010 && obtainMoney.id < 9020) { SaveSystem.AddUserEnergy(obtainMoney.count); } // 주문서 else if (obtainMoney.id > 9020 && obtainMoney.id < 9030) { SetObtainItem(8001, obtainMoney.count); } SaveSystem.SavePlayer(); } else { Debugging.LogError("획득할 재화를 찾지못함 >> " + id); } }
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(); }