//다이아몬드 초기화 private void OnGetDiamond(int num, bool isPlayAni) { if (isPlayAni) { int toNum = GM.GetInstance().Diamond; this.PlayGEMAni(delegate { this.txt_diamond.GetComponent <OverlayNumber>().setNum(toNum); Game2Manager.GetInstance()?.txt_gold.GetComponent <OverlayNumber>().setNum(toNum); Game1Manager.GetInstance()?.txt_gold.GetComponent <OverlayNumber>().setNum(toNum); FindObjectOfType <Shop>()?.txt_gold.GetComponent <OverlayNumber>().setNum(toNum); FindObjectOfType <G3BoardManager>()?.txt_gold.GetComponent <OverlayNumber>().setNum(toNum); FindObjectOfType <Achive>()?.txt_gold.GetComponent <OverlayNumber>().setNum(toNum); FindObjectOfType <Task>()?.txt_gold.GetComponent <OverlayNumber>().setNum(toNum); }, Item_Type.Boom); } else { this.txt_diamond.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); Game2Manager.GetInstance()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); Game1Manager.GetInstance()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); FindObjectOfType <Shop>()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); FindObjectOfType <G3BoardManager>()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); FindObjectOfType <Achive>()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); FindObjectOfType <Task>()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); } AudioManager.GetInstance().PlayEffect("sound_eff_coin"); }
private void Update() { Utils.BackListener(base.gameObject, delegate { switch (PlayerPrefs.GetInt("MyGame", 0)) { case 1: if (Game1DataLoader.GetInstance() != null) { if (!Game1DataLoader.GetInstance().IsPlaying) { switch (Game1DataLoader.GetInstance().CurPropId) { case 1: Debug.Log("아이템 1"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; case 2: Debug.Log("아이템 2"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; case 3: Debug.Log("아이템 3"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; } } } break; case 2: break; case 3: break; } if (GM.GetInstance().GameId != 0) { this.OnClickReturn(); return; } Action arg_39_0; if ((arg_39_0 = GameList.__c.__9__20_1) == null) { arg_39_0 = (GameList.__c.__9__20_1 = new Action(GameList.__c.__9._Update_b__20_1)); } Utils.ShowConfirmOrCancel(arg_39_0, null, "TXT_NO_50025", true); }); }
public void Shop_Return() { switch (PlayerPrefs.GetInt("MyGame", 0)) { case 1: if (Game1DataLoader.GetInstance() != null) { if (!Game1DataLoader.GetInstance().IsPlaying) { switch (Game1DataLoader.GetInstance().CurPropId) { case 1: Debug.Log("아이템 1"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; case 2: Debug.Log("아이템 2"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; case 3: Debug.Log("아이템 3"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; } } } break; case 2: break; case 3: break; } if (GM.GetInstance().GameId != 0) { FindObjectOfType <MainScene>().OnclickShop(); return; } Action arg_39_0; if ((arg_39_0 = GameList.__c.__9__20_1) == null) { arg_39_0 = (GameList.__c.__9__20_1 = new Action(GameList.__c.__9._Update_b__20_1)); } Utils.ShowConfirmOrCancel(arg_39_0, null, "TXT_NO_50025", true); }
private void OnConsumeGEM(int num) { this.txt_diamond.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); Game2Manager.GetInstance()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); Game1Manager.GetInstance()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); FindObjectOfType <Shop>()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); FindObjectOfType <G3BoardManager>()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); FindObjectOfType <Achive>()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); FindObjectOfType <Task>()?.txt_gold.GetComponent <OverlayNumber>().setNum(GM.GetInstance().Diamond); //AudioManager.GetInstance().PlayEffect("sound_eff_coin"); }
private void LoadExpUI() { this.txt_lv.GetComponent <Text>().text = GM.GetInstance().Lv.ToString(); if (Configs.TPlayers.ContainsKey(GM.GetInstance().Lv.ToString())) { TPlayer tPlayer = Configs.TPlayers[GM.GetInstance().Lv.ToString()]; this.img_exp.GetComponent <Image>().fillAmount = (((float)GM.GetInstance().Exp / (float)tPlayer.Exp >= 1f) ? 1f : ((float)GM.GetInstance().Exp / (float)tPlayer.Exp)); } Game2Manager.GetInstance()?.set_lv(); Game1Manager.GetInstance()?.set_lv(); G3BoardManager.GetInstance()?.set_lv(); FindObjectOfType <G3BoardManager>()?.set_lv(); }
private void OnAddExp(bool isLevelUp) { this.LoadExpUI(); if (Game1Manager.GetInstance() != null) { Game1Manager.GetInstance().LoadExpUI(); } if (!isLevelUp) { return; } if (GM.GetInstance().GameId == 2) { G2BoardGenerator.GetInstance().IsPuase = true; } this.ShowLevelUp(); }
public List <int> Use(int idx) { List <int> list = new List <int>(); Debug.Log("아이템" + this.CurPropId + " 사용"); switch (this.CurPropId) { case 1: FireBaseManager.Instance.LogEvent("Puzzle_Mix_Bomb"); DataManager.Instance.state_Player.item_Localdata.Boom -= 1; this.setNumber(idx, 0); list.Add(idx); AudioManager.GetInstance().PlayEffect("sound_eff_item_bomb"); break; case 2: { FireBaseManager.Instance.LogEvent("Puzzle_Mix_Cross_Hammer"); DataManager.Instance.state_Player.item_Localdata.Hammer -= 1; int row = this.GetRow(idx); int col = this.GetCol(idx); for (int i = 0; i < m_board_size; i++) { this.setNumber(row, i, 0); int index = this.GetIndex(row, i); if (!list.Contains(index)) { list.Add(index); } } for (int j = 0; j < m_board_size; j++) { this.setNumber(j, col, 0); int index2 = this.GetIndex(j, col); if (!list.Contains(index2)) { list.Add(index2); } } AudioManager.GetInstance().PlayEffect("sound_eff_item_hammer"); break; } case 3: { FireBaseManager.Instance.LogEvent("Puzzle_Mix_Color_Star"); DataManager.Instance.state_Player.item_Localdata.Star -= 1; int number = this.GetNumber(idx); for (int k = 0; k < m_board_size; k++) { for (int l = 0; l < m_board_size; l++) { if (this.GetNumber(l, k) == number) { this.setNumber(l, k, 0); list.Add(this.GetIndex(l, k)); } } } AudioManager.GetInstance().PlayEffect("sound_eff_item_star"); break; } } DataManager.Instance.Save_Player_Data(); Game1Manager.GetInstance().Set_Txt_Item(); AchiveData.GetInstance().Add(4, 1, true); this.SaveGame(); return(list); }
public void Ads_Reward() { FireBaseManager.Instance.LogEvent("Reward_End"); switch (reward_Type) { case Reward_Type.game1Finish: Debug.Log("첫번째 이어하기"); FireBaseManager.Instance.LogEvent("Puzzle_Mix_Continue_Ads"); GM.GetInstance().SetSavedGameID(GameID); Game1DataLoader.GetInstance().FillLife(false); Game1DataLoader.GetInstance().DoFillLife(); DialogManager.GetInstance().Close(null); break; case Reward_Type.game2Finish: Debug.Log("두번째 이어하기"); FireBaseManager.Instance.LogEvent("2048_Continue_Ads"); GM.GetInstance().SetSavedGameID(GameID); DialogManager.GetInstance().Close(null); Game2Manager.GetInstance().video(); break; case Reward_Type.again: break; case Reward_Type.block: Game1DataLoader.GetInstance().IsPlaying = true; Game1Manager.GetInstance().ControlPropsPannel(true); Game1Manager.GetInstance().UseProps(block); Game1Manager.GetInstance().m_markTips = true; break; case Reward_Type.skin: GM.GetInstance().SetSkinData(this.SkinID, 2); GM.GetInstance().SetSkinFreeTime(this.SkinID, DateTime.Now); //AppsflyerUtils.TrackBuySkin(this.SkinID, 1); Action <int> expr_38 = SkinUnLock.Instance.OnUnlockSuccess; if (expr_38 != null) { expr_38(this.SkinID); } DialogManager.GetInstance().Close(null); break; case Reward_Type.stimulate: int rans = UnityEngine.Random.Range(10, 100); GM.GetInstance().AddDiamond(rans); TaskData.GetInstance().Add(100105, 1, true); DateTime GiftTime = DateTime.Now.AddMinutes(10); DataManager.Instance.state_Player.LocalData_Main_Time = GiftTime.ToString(); DataManager.Instance.Save_Player_Data(); FindObjectOfType <MainScene>().Set_Timer(); DotManager.GetInstance().CheckAds(); break; case Reward_Type.Achive: if (!AchiveData.GetInstance().Finish(achive_type)) { return; } GM.GetInstance().AddDiamond(achive_val * 2, true); FindObjectOfType <Achive>().Set_BindDataToUI(); DialogManager.GetInstance().Close(null); break; case Reward_Type.Task: if (!TaskData.GetInstance().Finish(achive_type)) { return; } GM.GetInstance().AddDiamond(achive_val * 2, true); FindObjectOfType <Task>().Refresh(); DialogManager.GetInstance().Close(null); break; case Reward_Type.shop_ads: GiftTime = DateTime.Now.AddMinutes(10); DataManager.Instance.state_Player.LocalData_Shop_Time = GiftTime.ToString(); DataManager.Instance.Save_Player_Data(); FindObjectOfType <Shop>().ads_item.Set_Timer(); int ran = UnityEngine.Random.Range(10, 100); GM.GetInstance().AddDiamond(ran); FireBaseManager.Instance.LogEvent("Shop_Ads"); break; case Reward_Type.levelup: FindObjectOfType <LevelUp>().OnClickAds(); break; case Reward_Type.stage: FindObjectOfType <G3WinDialog>().Reward(); break; case Reward_Type.game: GiftTime = DateTime.Now.AddMinutes(10); DataManager.Instance.state_Player.LocalData_Game_Time = GiftTime.ToString(); DataManager.Instance.Save_Player_Data(); Game2Manager.GetInstance()?.Set_Timer(); Game1Manager.GetInstance()?.Set_Timer(); G3BoardManager.GetInstance()?.Set_Timer(); ran = UnityEngine.Random.Range(10, 100); GM.GetInstance().AddDiamond(ran); break; case Reward_Type.coin: ran = UnityEngine.Random.Range(10, 100); GM.GetInstance().AddDiamond(ran); break; case Reward_Type.Daily: FindObjectOfType <Activity>().OnClickAds(); break; case Reward_Type.gift: FindObjectOfType <RewardPopup>().Get_Gift(); break; default: break; } }
public void Close(Action callfunc = null) { AudioManager.GetInstance().PlayEffect("sound_eff_popup_close"); switch (PlayerPrefs.GetInt("MyGame", 0)) { case 1: if (Game1DataLoader.GetInstance() != null) { if (!Game1DataLoader.GetInstance().IsPlaying) { switch (Game1DataLoader.GetInstance().CurPropId) { case 1: Debug.Log("아이템 1"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; case 2: Debug.Log("아이템 2"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; case 3: Debug.Log("아이템 3"); Game1DataLoader.GetInstance().CurPropId = 0; Game1Manager.GetInstance().ControlPropsPannel(true); return; } } } break; case 0: if (G2BoardGenerator.GetInstance() != null) { G2BoardGenerator.GetInstance().CurPropId = 0; G2BoardGenerator.GetInstance().IsPuase = false; Game2Manager.GetInstance().ControlPropsPannel(true); } break; case 2: break; } if (this.m_childs.Count <= 0) { return; } Debug.Log(m_childs.Count); Debug.Log(m_childs.Peek().child.name); DialogManager.DialogData _dialogData = this.m_childs.Pop(); _dialogData.child.transform.DOLocalMove(new Vector3(0, -2000, 0), 0.3f).SetEase(Ease.InBack) .OnComplete( delegate { }); FindObjectOfType <MainScene>().Open_Icon(); UnityEngine.Object.Destroy(_dialogData.parent, 0.3f); if (callfunc != null) { callfunc(); } }
public void Buy(Dictionary <string, object> data) { Debug.Log((int)data["shop_type"]); switch ((Shop_itme_type)(int)data["shop_type"]) { case Shop_itme_type.ads: DataManager.Instance.state_Player.RemoveAds = true; transform.GetComponentsInChildren <ShopItem>(true)[0].gameObject.SetActive(false); AdsControl.Instance.BannerShow(); break; case Shop_itme_type.package: FindObjectOfType <MainScene>().PlayPackageAni(); for (int i = 0; i < 5; i++) { int item = (int)data["item_" + i]; if (item == 0) { continue; } switch ((Item_Type)i) { case Item_Type.Boom: DataManager.Instance.state_Player.item_Localdata.Boom += item; break; case Item_Type.Hammer: DataManager.Instance.state_Player.item_Localdata.Hammer += item; break; case Item_Type.Star: DataManager.Instance.state_Player.item_Localdata.Star += item; break; case Item_Type.Hint: DataManager.Instance.state_Player.item_Localdata.Hint += item; break; case Item_Type.coin: GM.GetInstance().AddDiamond(item); break; default: break; } } GameObject obj = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/shop_complet") as GameObject); obj.GetComponent <ShopComplete>().Set_Item(data); DialogManager.GetInstance().show(obj); break; case Shop_itme_type.gift: AdsControl.Instance.reward_Type = Reward_Type.shop_ads; AdsControl.Instance.ShowRewardedAd(); break; case Shop_itme_type.gold: Debug.Log("골드~~ " + (int)data["item_4"]); GM.GetInstance().AddDiamond((int)data["item_4"]); break; case Shop_itme_type.item: if (DataManager.Instance.state_Player.LocalData_Diamond >= (int)data["price"]) { GM.GetInstance().ConsumeGEM((int)data["price"]); for (int i = 0; i < 5; i++) { int item = (int)data["item_" + i]; if (item == 0) { continue; } FindObjectOfType <MainScene>().PlayitemAni((Item_Type)i); switch ((Item_Type)i) { case Item_Type.Boom: FireBaseManager.Instance.LogEvent("Shop_bomb"); DataManager.Instance.state_Player.item_Localdata.Boom += item; break; case Item_Type.Hammer: FireBaseManager.Instance.LogEvent("Shop_cross_hammer"); DataManager.Instance.state_Player.item_Localdata.Hammer += item; break; case Item_Type.Star: FireBaseManager.Instance.LogEvent("Shop_color_star"); DataManager.Instance.state_Player.item_Localdata.Star += item; break; case Item_Type.Hint: FireBaseManager.Instance.LogEvent("Shop_magnigier"); DataManager.Instance.state_Player.item_Localdata.Hint += item; break; case Item_Type.coin: GM.GetInstance().AddDiamond(item); break; default: break; } } obj = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/shop_complet") as GameObject); obj.GetComponent <ShopComplete>().Set_Item(data); DialogManager.GetInstance().show(obj); } break; default: break; } Game1Manager.GetInstance()?.Set_Txt_Item(); G3BoardManager.GetInstance()?.Set_Item_Txt(); DataManager.Instance.Save_Player_Data(); #if UNITY_ANDROID GoogleManager.Instance.isPopup = false; GoogleManager.Instance.Player_Data_Save(); #elif UNITY_IOS string jsonStr = JsonUtility.ToJson(DataManager.Instance.state_Player); string aes = AESCrypto.AESEncrypt128(jsonStr); CloudVariables.Player_Data = aes; Cloud.Storage.Save(); #endif }