public void OnClickProp(int type) { if (G2BoardGenerator.GetInstance().IsPlaying) { return; } if (!G2BoardGenerator.GetInstance().IsStart) { return; } int value = Constant.COMMON_CONFIG_PROP[type - 1]; if (!GM.GetInstance().isFullGEM(value)) { ToastManager.Show("TXT_NO_50001", true); return; } if (G2BoardGenerator.GetInstance().CurPropId != 0) { G2BoardGenerator.GetInstance().CurPropId = 0; G2BoardGenerator.GetInstance().IsPuase = false; this.ControlPropsPannel(true); return; } G2BoardGenerator.GetInstance().CurPropId = type; G2BoardGenerator.GetInstance().IsPuase = true; this.ControlPropsPannel(false); }
private Vector3 GetToPosition(int index) { int row = G2BoardGenerator.GetInstance().GetRow(index); int col = G2BoardGenerator.GetInstance().GetCol(index); return(this.GetToPosition(row, col)); }
public void OnClickReturn(GameList obj) { if (G2BoardGenerator.GetInstance().IsPlaying&& G2BoardGenerator.GetInstance().IsPuase) { return; } G2BoardGenerator.GetInstance().IsPuase = true; int arg_79_0 = G2BoardGenerator.GetInstance().Score; Action arg_79_1 = delegate { G2BoardGenerator.GetInstance().Score = 0; GM.GetInstance().SaveScore(2, 0); GM.GetInstance().SetSavedGameID(0); GM.GetInstance().ResetToNewGame(); GM.GetInstance().ResetConsumeCount(); GlobalEventHandle.EmitDoGoHome(); GlobalEventHandle.EmitClickPageButtonHandle("main", 0); //obj.HideTopBtn(); }; Action arg_79_2; if ((arg_79_2 = Game2Manager.CommonClass._action_1) == null) { arg_79_2 = (Game2Manager.CommonClass._action_1 = new Action(Game2Manager.CommonClass._commonClass.OnClickReturn1)); } Action arg_79_3; if ((arg_79_3 = Game2Manager.CommonClass._action_2) == null) { arg_79_3 = (Game2Manager.CommonClass._action_2 = new Action(Game2Manager.CommonClass._commonClass.OnClickReturn2)); } Utils.ShowPause(arg_79_0, arg_79_1, arg_79_2, arg_79_3); }
private void ShowGuide() { if (G2BoardGenerator.GetInstance().IsFinishGuide) { return; } this.m_txt_tips.gameObject.SetActive(true); this.m_txt_tips.GetComponent <LanguageComponent>().SetText(this.m_data_tiptxts[this.m_step]); switch (this.m_step) { case 1: break; case 2: this.m_saveFingerPos += new Vector3(110f, 0f, 0f); return; case 3: { Vector3 vector = this.bloodPosList[this.bloodPosList.Count - 1].transform.position; vector = base.transform.InverseTransformPoint(vector); this.m_saveFingerPos = vector + new Vector3(70f, -70f, 0f); break; } default: return; } }
public Tween DelayMove(int index, float time) { return(base.transform.DOLocalMove(this.GetToPosition(index), 0.1f, false).SetDelay(time).OnComplete(delegate { G2BoardGenerator.GetInstance().FreeBlock(base.gameObject); })); }
public void OnClickCoin() { if (!GM.GetInstance().isFullGEM(100)) { ToastManager.Show("TXT_NO_50001", true); return; } int gameID = this.GameID; if (gameID == 1) { GM.GetInstance().SetSavedGameID(this.GameID); Game1DataLoader.GetInstance().FillLife(false); Game1DataLoader.GetInstance().DoFillLife(); DialogManager.GetInstance().Close(null); return; } if (gameID != 2) { return; } GM.GetInstance().SetSavedGameID(this.GameID); DialogManager.GetInstance().Close(null); Action expr_85 = G2BoardGenerator.GetInstance().DoVedioRefresh; if (expr_85 == null) { return; } expr_85(); }
private void ShowFinish() { Debug.Log("끝났을때"); DialogManager.GetInstance().Close(delegate { int gameID = this.GameID; if (gameID == 1) { FireBaseManager.Instance.LogEvent("Puzzle_Mix_Continue_No"); CloudOnceManager.Instance.Repart_LeaderBoard(Game1DataLoader.GetInstance().Score, 1); GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/G00102") as GameObject); gameObject.GetComponent <G1UIManager>().Load(Game1DataLoader.GetInstance().Score, Game1DataLoader.GetInstance().MaxScore); DialogManager.GetInstance().show(gameObject, true); return; } if (gameID == 2) { FireBaseManager.Instance.LogEvent("2048_Continue_No"); CloudOnceManager.Instance.Repart_LeaderBoard(G2BoardGenerator.GetInstance().Score, 2); GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/G00203") as GameObject); gameObject2.GetComponent <G2UIManager>().Load(G2BoardGenerator.GetInstance().Score, G2BoardGenerator.GetInstance().MaxScore); DialogManager.GetInstance().show(gameObject2, true); return; } }); }
public void OnclickShop() { switch (PlayerPrefs.GetInt("MyGame", 0)) { case 1: break; case 0: if (G2BoardGenerator.GetInstance() != null) { G2BoardGenerator.GetInstance().IsPuase = true; } break; case 2: break; } GameObject obj = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/shop") as GameObject); DialogManager.GetInstance().show(obj, false); }
public void OnTouchStartBox(BaseEventData eventData) { if (G2BoardGenerator.GetInstance().IsPuase) { return; } if (G2BoardGenerator.GetInstance().IsPlaying) { return; } PointerEventData pointerEventData = (PointerEventData)eventData; int num = -1; for (int i = 0; i < this.bloodPosList.Count; i++) { GameObject expr_33 = this.bloodPosList[i]; Vector2 point; RectTransformUtility.ScreenPointToLocalPointInRectangle(expr_33.GetComponent <RectTransform>(), pointerEventData.pressPosition, pointerEventData.pressEventCamera, out point); if (expr_33.GetComponent <RectTransform>().rect.Contains(point)) { num = i; break; } } //this.bloodList[2].GetComponent<G2Block>().img_panel.SetActive(true); this.bloodList[2].transform.SetParent(this.bloodPosList[num].transform, false); this.bloodList[2].transform.localPosition = Vector3.zero; if (num == -1) { return; } }
internal void OnClickReturn1() { GM.GetInstance().SaveScore(2, 0); GM.GetInstance().SetSavedGameID(0); GM.GetInstance().ResetToNewGame(); GM.GetInstance().ResetConsumeCount(); G2BoardGenerator.GetInstance().Score = 0; G2BoardGenerator.GetInstance().StartNewGame(); }
private void RefreshScore(bool isAni = true) { if (isAni) { this.txt_score.GetComponent <OverlayNumber>().setNum(G2BoardGenerator.GetInstance().Score); return; } this.txt_score.GetComponent <OverlayNumber>().Reset(); this.txt_score.GetComponent <OverlayNumber>().setNum(G2BoardGenerator.GetInstance().Score); }
private G2Block CreateNewLife(int number, GameObject parent, int idx) { G2Block g = G2BoardGenerator.GetInstance().CreateBlock(number, 0, parent); this.bloodList[idx] = g.gameObject; g.GetComponent <G2Block>().img_panel.SetActive(false); return(g); }
private void InitLife() { for (int i = 0; i < 5; i++) { int num = G2BoardGenerator.GetInstance().BloodList[i]; if (num != 0) { this.CreateNewLife(num, this.bloodPosList[i], i).transform.position = start_pos.position; } } }
public void OnClickReturn() { if (GM.GetInstance().GameId == 0) { GlobalEventHandle.EmitDoGoHome(); GlobalEventHandle.EmitClickPageButtonHandle("main", 0); return; } if (FindObjectOfType <Pause>() != null) { return; } switch (GM.GetInstance().GameId) { case 1: { Action <GameList> expr_36 = Game1DataLoader.GetInstance().OnClickReturnHandle; if (expr_36 == null) { return; } expr_36(this); return; } case 2: { Action <GameList> expr_4C = G2BoardGenerator.GetInstance().OnClickReturnHandle; if (expr_4C == null) { return; } expr_4C(this); return; } case 3: { Action <GameList> expr_62 = G3BoardGenerator.GetInstance().OnClickReturnHandle; if (expr_62 == null) { return; } expr_62(this); return; } default: return; } }
public void OnClickAgain() { FireBaseManager.Instance.LogEvent("2048_Result_Retry"); PlayerPrefs.SetInt("conti", 0); AudioManager.GetInstance().PlayBgMusic("sound_ingame", true); GM.GetInstance().SetSavedGameID(this.gameID); G2BoardGenerator.GetInstance().StartNewGame(); DialogManager.GetInstance().Close(null); }
private void OnRandomCoin() { if (G2BoardGenerator.GetInstance().CoinIndex > 0) { int num = G2BoardGenerator.GetInstance().CoinIndex / 5; int num2 = G2BoardGenerator.GetInstance().CoinIndex % 5; this.m_img_coin.transform.localPosition = new Vector3((float)num2 * 160f + 55f - 375f, (float)num * 160f + 55f - 440f, 0f); this.m_img_coin.gameObject.SetActive(true); return; } this.m_img_coin.gameObject.SetActive(false); }
public void OnClick() { if (G2BoardGenerator.GetInstance().IsPlaying) { return; } if (!G2BoardGenerator.GetInstance().IsPuase) { return; } AudioManager.GetInstance().PlayEffect("sound_eff_click_1"); G2BoardGenerator.GetInstance().DoClickBlock(this); }
public void OnClickAds() { AdsManager.GetInstance().Play(AdsManager.AdType.UseProp, delegate { GM.GetInstance().SetSavedGameID(this.gameID); DialogManager.GetInstance().Close(null); Action _action = G2BoardGenerator.GetInstance().DoVedioRefresh; if (_action == null) { return; } _action(); }, null, 5, null); }
public void OnClickHome() { FireBaseManager.Instance.LogEvent("2048_Result_Main"); AdsControl.Instance.ShowInterstitial(); G2BoardGenerator.GetInstance().Score = 0; GM.GetInstance().SaveScore(this.gameID, 0); GM.GetInstance().SetSavedGameID(0); GM.GetInstance().ResetToNewGame(); GM.GetInstance().ResetConsumeCount(); DialogManager.GetInstance().Close(null); GlobalEventHandle.EmitClickPageButtonHandle("main", 0); }
public void OnClickAds() { FireBaseManager.Instance.LogEvent("Level_Up_Ads"); if (Configs.TPlayers.ContainsKey(GM.GetInstance().Lv.ToString())) { TPlayer tPlayer = Configs.TPlayers[GM.GetInstance().Lv.ToString()]; GM.GetInstance().AddDiamond(tPlayer.Item * 2, true); } if (GM.GetInstance().GameId == 2) { G2BoardGenerator.GetInstance().IsPuase = false; } DialogManager.GetInstance().Close(null); }
private void PlayFingerAni() { if (G2BoardGenerator.GetInstance().IsFinishGuide) { return; } this.m_img_finger.gameObject.SetActive(true); this.m_img_finger.transform.localPosition = this.m_saveFingerPos; DOTween.Kill(this.m_img_finger, false); Sequence expr_46 = DOTween.Sequence(); expr_46.Append(this.m_img_finger.transform.DOBlendableLocalMoveBy(new Vector3(0f, -10f, 0f), 0.5f, false)); expr_46.Append(this.m_img_finger.transform.DOBlendableLocalMoveBy(new Vector3(0f, 10f, 0f), 0.3f, false)); expr_46.SetLoops(-1); expr_46.SetTarget(this.m_img_finger); }
private void InitEvent() { G2BoardGenerator.GetInstance().DoRefreshHandle += new Action(this.RefreshMap); G2BoardGenerator.GetInstance().DoDeleteHandle += new Action <List <int>, int>(this.Delete); G2BoardGenerator.GetInstance().DoDropHandle += new Action <List <sDropData>, List <int> >(this.Drop); G2BoardGenerator expr_47 = G2BoardGenerator.GetInstance(); expr_47.DoClickBlock = (Action <G2Block>)Delegate.Combine(expr_47.DoClickBlock, new Action <G2Block>(this.OnClickBlock)); G2BoardGenerator.GetInstance().DoNullDelete += new Action(this.OnNullDelete); G2BoardGenerator.GetInstance().DoCompMaxNumber += new Action <int>(this.PlayNewNumber); G2BoardGenerator expr_99 = G2BoardGenerator.GetInstance(); expr_99.DoVedioRefresh = (Action)Delegate.Combine(expr_99.DoVedioRefresh, new Action(this.UseVedioRefresh)); G2BoardGenerator.GetInstance().OnClickReturnHandle = new Action <GameList>(this.OnClickReturn); G2BoardGenerator.GetInstance().OnRandomCoinHandle = new Action(this.OnRandomCoin); }
public void video() { Debug.Log("광고 봤음"); bool flag = false; if (this.m_mask.transform.localPosition.y <= 0f) { flag = true; } if (!flag) { float num = this.m_objEndPos.transform.position.y + 0.55f; int idx = 0; for (int i = 0; i < this.blocks.Count; i++) { G2Block g = this.blocks[i]; if (!(g == null) && g.transform.position.y <= num) { flag = true; idx = i; break; } } if (!flag) { return; } foreach (int current in G2BoardGenerator.GetInstance().Use(idx, 2)) { if (current < this.blocks.Count) { G2Block g2 = this.blocks[current]; this.blocks[current] = null; if (!(g2 == null)) { Debug.Log("name :" + g2.transform.position + " " + g2.GetCurrentColor()); ParticlesControl.GetInstance().PlayExplodeEffic(g2.transform.position, g2.GetCurrentColor()); G2BoardGenerator.GetInstance().FreeBlock(g2.gameObject); } } } this.BackMap(3); G2BoardGenerator.GetInstance().IsStart = true; G2BoardGenerator.GetInstance().IsGameOver = false; } }
private void GameOver() { if (G2BoardGenerator.GetInstance().IsPlaying) { return; } bool flag = false; if (this.m_mask.transform.localPosition.y <= 0f) { flag = true; } if (!flag) { float num = this.m_objEndPos.transform.position.y + 0.55f; foreach (G2Block current in this.blocks) { if (!(current == null) && current.transform.position.y <= num) { flag = true; break; } } } if (!flag) { return; } G2BoardGenerator.GetInstance().IsStart = false; G2BoardGenerator.GetInstance().IsGameOver = true; if (G2BoardGenerator.GetInstance().FinishCount < 1000) { Debug.Log("피니쉬~~~ " + G2BoardGenerator.GetInstance().FinishCount); G2BoardGenerator.GetInstance().FinishCount++; GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/finish") as GameObject); gameObject.GetComponent <Finish>().Load(2, G2BoardGenerator.GetInstance().GetMapMaxNumber()); DialogManager.GetInstance().show(gameObject, true); return; } GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/G00203") as GameObject); gameObject2.GetComponent <G2UIManager>().Load(G2BoardGenerator.GetInstance().Score, G2BoardGenerator.GetInstance().MaxScore); DialogManager.GetInstance().show(gameObject2, true); }
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(); }
private void LoadUI() { this.RefreshScore(false); this.InitLife(); this.ShowTxtTips(); RectTransform component = this.m_map.GetComponent <RectTransform>(); RectTransform arg_5E_0 = this.m_mask.GetComponent <RectTransform>(); component.anchoredPosition = GM.GetInstance().GetSavedPos(); arg_5E_0.anchoredPosition = GM.GetInstance().GetSavedPos() + new Vector2(0f, component.sizeDelta.y); this.m_saveFingerPos = this.m_img_finger.transform.localPosition; if (!G2BoardGenerator.GetInstance().IsFinishGuide) { this.PlayFingerAni(); this.m_txt_tips.GetComponent <LanguageComponent>().SetText(this.m_data_tiptxts[this.m_step]); } Set_Timer(); set_lv(); txt_gold.GetComponent <OverlayNumber>().SetStartNumber(DataManager.Instance.state_Player.LocalData_Diamond); }
private void Update() { TimeSpan LateTime = GiftTime - DateTime.Now; if (LateTime.TotalSeconds <= 0) { btn_ads.interactable = true; txt_timer.GetComponent <LanguageComponent>().SetText("TXT_NO_50139"); } else { btn_ads.interactable = false; int diffMiniute = LateTime.Minutes; //30 int diffSecond = LateTime.Seconds; //0 txt_timer.text = string.Format("{0:00}:{1:00}", diffMiniute, diffSecond); } if (!G2BoardGenerator.GetInstance().IsStart) { return; } if (G2BoardGenerator.GetInstance().IsPuase) { return; } if (G2BoardGenerator.GetInstance().IsGameOver) { return; } if (!G2BoardGenerator.GetInstance().IsFinishGuide) { return; } if (this.m_isBack) { return; } this.DownMap(); }
private void Delete(List <int> list, int index) { AudioManager.GetInstance().PlayEffect("sound_eff_clear_2"); List <Game2Manager.PathRDM> list2 = this.FindPath(list, index); if (list2.Count < 0) { return; } this.m_dobleTotal++; int count = list2[0].paths.Count; Sequence sequence = DOTween.Sequence(); foreach (Game2Manager.PathRDM current in list2) { G2Block g = this.blocks[current.index]; g.ShowScore(); this.blocks[current.index] = null; int row = G2BoardGenerator.GetInstance().GetRow(current.index); int col = G2BoardGenerator.GetInstance().GetCol(current.index); if (current.paths.Count >= 2) { Vector2 b = new Vector2((float)current.paths[0].x, (float)current.paths[0].y); Vector2 vector = new Vector2((float)current.paths[1].x, (float)current.paths[1].y) - b; int index2 = G2BoardGenerator.GetInstance().GetIndex(row + (int)vector.y, col + (int)vector.x); Tween t = g.DelayMove(index2, (float)(count - current.paths.Count) * 0.1f); sequence.Insert(0f, t); } } sequence.OnComplete(delegate { //this.PlayDoubleAni(); this.BackMap(2); this.blocks[index].setNum(G2BoardGenerator.GetInstance().GetNumber(index)); G2BoardGenerator.GetInstance().Down(); }); G2BoardGenerator.GetInstance().IsPlaying = true; this.RefreshScore(true); }
private void LoadBlock() { for (int i = 0; i < 7; i++) { for (int j = 0; j < 5; j++) { int number = G2BoardGenerator.GetInstance().GetNumber(i, j); if (number == 0) { this.blocks.Add(null); } else { int index = G2BoardGenerator.GetInstance().GetIndex(i, j); G2Block item = G2BoardGenerator.GetInstance().CreateBlock(number, index, this.m_map); item.img_panel.SetActive(true); this.blocks.Add(item); } } } }
private void RefreshMap() { foreach (G2Block current in this.blocks) { if (!(current == null)) { G2BoardGenerator.GetInstance().FreeBlock(current.gameObject); } } this.blocks.Clear(); for (int i = 0; i < this.bloodList.Count; i++) { GameObject gameObject = this.bloodList[i]; if (!(gameObject == null)) { this.bloodList[i] = null; G2BoardGenerator.GetInstance().FreeBlock(gameObject); } } this.LoadBlock(); this.LoadUI(); this.OnRandomCoin(); }