void IStoreListener.OnInitialized(IStoreController controller, IExtensionProvider extensions) { storeController = controller; if (PlayerPrefs.HasKey("RestoreIAP")) { } else { Debug.Log("재설치 복원시작"); bool check = PlayerData.isRemoveAd; extensions.GetExtension <IAppleExtensions>().RestoreTransactions(result => { if (result) { if (check != PlayerData.isRemoveAd) { GameSystemManager.ShowAlertMessage(new AlertMessage(1, LocalizationManager.GetText("Alert_RestoreIAPSuccess"), null, null, null)); } } else { // Restoration failed. } }); PlayerPrefs.SetInt("RestoreIAP", 1); } Debug.Log("결제 기능 초기화"); }
public void OnClickButton() { if (!PlayerData.isRemoveAd) { GameSystemManager.ShowAlertMessage(new AlertMessage(0, string.Format("{0}", LocalizationManager.GetText("Alert_BuyRemoveAd")), alertSprite, null, PurchaseRemoveAd)); } }
public void OnClickSelectItemYes() { if (selectItem > 0) { SoundManager.PlaySound(SoundManager.Sound.AlertYes); Item item = shopItemList[selectItem - 1]; if (PlayerData.goldCube >= item.value) { PlayerData.UseGoldCube(item.value); if (item.type == 0) { ItemManager.Instance.ItemUseableBuy(item); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("`{0}`{1}", LocalizationManager.GetText("ItemName" + item.number), LocalizationManager.GetText("Alert_BuySuccess")), item.sprite, null, null)); } else if (item.type == 1) { PlayerData.AddCharacter(item.number); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("`{0}`{1}", LocalizationManager.GetText("ItemName" + item.number), LocalizationManager.GetText("Alert_BuySuccess")), null, item.prefab, null)); } ItemSelectCheckPanelTransform.gameObject.SetActive(false); shopItemSlotList[selectItem].GetChild(3).gameObject.SetActive(false); RefreshShopItemUI(); } selectItem = 0; } }
public void GameUndo() { if (!isUndo && !isRestart && IsPlaying) { if (PlayerData.undoCount > 0) { StartCoroutine("UndoDelay"); if (playingRecords.Count == 0) { Debug.Log("원지점입니다."); GameSystemManager.ShowAlertMessage(new AlertMessage(2, LocalizationManager.GetText("Alert_WarningUndoStart"), null, null, null)); } else { PlayingRecord record = playingRecords.Pop(); controller.UndoMove(record); PlayerData.UseUndoCount(); UpdateUI(); } } else { GameSystemManager.ShowAlertMessage(new AlertMessage(2, LocalizationManager.GetText("Alert_WarningUndo"), null, null, null)); } } }
public void PurchaseRemoveAd() { PlayerData.isRemoveAd = true; PlayerDataSystem.Save(); PlayerData.AddCharacter(16); AdMobManager.Instance.HideBanner(); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_BuyRemoveAdYes")), null, GameAssetsManager.instance.CharacterAssets[16].asset, null)); StartManager.Instance.AddCharToGrid(16); Debug.Log("광고 구매완료"); }
void AttendanceCheck() { if (PlayerData.currentStage > 0) { DateTime nowTime = DateTime.Now; if (PlayerPrefs.HasKey("AttendanceDay")) { if (nowTime.Day != PlayerPrefs.GetInt("AttendanceDay")) { Debug.Log(nowTime.Day + " 출석!"); PlayerPrefs.SetInt("AttendanceDay", nowTime.Day); PlayerData.AddGoldCube(1); GameSystemManager.ShowAlertMessage(new AlertMessage(1, LocalizationManager.GetText("Alert_AttendanceContinue"), GameAssetsManager.instance.SpriteAssets.Find(x => x.name == "GoldCube").sprite, null, null)); } } else { Debug.Log(nowTime.Day + " 새로운 출석 기록!"); PlayerPrefs.SetInt("AttendanceDay", nowTime.Day); PlayerData.AddGoldCube(2); GameSystemManager.ShowAlertMessage(new AlertMessage(1, LocalizationManager.GetText("Alert_Attendance"), GameAssetsManager.instance.SpriteAssets.Find(x => x.name == "GoldCube").sprite, null, null)); } } }
public void PurchaseGoldCube() { PlayerData.AddGoldCube(10); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_BuyGoldcubeYes")), GameAssetsManager.instance.SpriteAssets[0].sprite, null, null)); Debug.Log("황금 큐브 구매완료"); }
void OnTransactionsRestored(bool success) { GameSystemManager.ShowAlertMessage(new AlertMessage(1, success.ToString(), null, null, null)); Debug.Log("Transactions restored: " + success); }
public void OnClickButton() { GameSystemManager.ShowAlertMessage(new AlertMessage(0, string.Format("{0}", LocalizationManager.GetText("Alert_BuyGoldcube")), alertSprite, null, PurchaseGoldCube)); }
void CheckGetSpecialCharacter() { List <CharacterAssets> charList = GameAssetsManager.instance.CharacterAssets.FindAll(x => ItemManager.Instance.IsSpecialCharacter(x.id) && !PlayerData.IsHavingCharacter(x.id)); foreach (var chr in charList) { switch (chr.id) { case 17: if (PlayerData.currentStage >= 85) { PlayerData.AddCharacter(17); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter17")), null, GameAssetsManager.instance.CharacterAssets[17].asset, null)); AddCharToGrid(17); } break; case 18: if (hobookGamesClickCount >= 10) { GooglePlayManager.Instance.OnAddAchievement(6); PlayerData.AddCharacter(18); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter18")), null, GameAssetsManager.instance.CharacterAssets[18].asset, null)); AddCharToGrid(18); } break; case 19: if (PlayerData.totalPlayTime >= 180) // 플레이 타임 3시간 { PlayerData.AddCharacter(19); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter19")), null, GameAssetsManager.instance.CharacterAssets[19].asset, null)); AddCharToGrid(19); } break; case 20: if (PlayerData.undoTryCount >= 100 && PlayerData.retryCount >= 100) //취소100번,다시하기100번 { GooglePlayManager.Instance.OnAddAchievement(5); PlayerData.AddCharacter(20); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter20")), null, GameAssetsManager.instance.CharacterAssets[20].asset, null)); AddCharToGrid(20); } break; case 21: if (PlayerData.goldCube > 99) { PlayerData.AddCharacter(21); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter21")), null, GameAssetsManager.instance.CharacterAssets[21].asset, null)); AddCharToGrid(21); } break; case 22: if (PlayerData.currentStage == 100) { GooglePlayManager.Instance.OnAddAchievement(1); PlayerData.AddCharacter(22); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter22")), null, GameAssetsManager.instance.CharacterAssets[22].asset, null)); AddCharToGrid(22); } break; case 23: if (PlayerData.currentStage == 100) { int cnt = 0; for (int i = 0; i < 100; i++) { if (PlayerData.clearStageInfoList[i + 1].totalMove == int.Parse(MapDataManager.GetMapClearCount(i + 1))) { cnt++; } } if (cnt == 100) { GooglePlayManager.Instance.OnAddAchievement(4); PlayerData.AddCharacter(23); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter23")), null, GameAssetsManager.instance.CharacterAssets[23].asset, null)); AddCharToGrid(23); } } break; case 24: if (charList.Count == 1) { GooglePlayManager.Instance.OnAddAchievement(3); PlayerData.AddCharacter(24); GameSystemManager.ShowAlertMessage(new AlertMessage(1, string.Format("{0}", LocalizationManager.GetText("Alert_GetSpecialCharacter24")), null, GameAssetsManager.instance.CharacterAssets[24].asset, null)); AddCharToGrid(24); } break; } } }