public void OnClickProp(int type) { Debug.Log("클릭했다!!!"); this.m_markTips = true; if (Game1DataLoader.GetInstance().IsPlaying) { return; } if (Game1DataLoader.GetInstance().HeartIndex != -1) { return; } int value = Constant.COMMON_CONFIG_PROP[type - 1]; switch (type) { case 1: if (DataManager.Instance.state_Player.item_Localdata.Boom <= 0) { GameList.Instance.Shop_Return(); return; } break; case 2: if (DataManager.Instance.state_Player.item_Localdata.Hammer <= 0) { GameList.Instance.Shop_Return(); return; } break; case 3: if (DataManager.Instance.state_Player.item_Localdata.Star <= 0) { GameList.Instance.Shop_Return(); return; } break; default: break; } if (Game1DataLoader.GetInstance().CurPropId != 0) { Debug.Log("아이템 없어짐"); if (!Game1DataLoader.GetInstance().IsPlaying) { Game1DataLoader.GetInstance().CurPropId = 0; this.ControlPropsPannel(true); } return; } Debug.Log("아이템 생성"); Game1DataLoader.GetInstance().CurPropId = type; this.ControlPropsPannel(false); }
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; } }); }
private void GameOver() { if (Game1DataLoader.GetInstance().IsPlaying) { return; } if (Game1DataLoader.GetInstance().HeartIndex != -1) { return; } if (!Game1DataLoader.GetInstance().IsGameOver()) { return; } if (Game1DataLoader.GetInstance().FinishCount < 1000) { Game1DataLoader.GetInstance().FinishCount++; GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/finish") as GameObject); gameObject.GetComponent <Finish>().Load(1, Game1DataLoader.GetInstance().GetMapMaxNumber()); DialogManager.GetInstance().show(gameObject, true); } else { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(Resources.Load("Prefabs/G00102") as GameObject); gameObject2.GetComponent <G1UIManager>().Load(Game1DataLoader.GetInstance().Score, Game1DataLoader.GetInstance().MaxScore); DialogManager.GetInstance().show(gameObject2, true); } this.m_markTips = false; }
private void OnDragLife(GameObject obj, PointerEventData eventData) { if (obj != this.bloodList[0]) { return; } if (Game1DataLoader.GetInstance().IsPlaying) { return; } if (Game1DataLoader.GetInstance().HeartIndex != -1) { return; } this.m_markTips = false; obj.transform.DOKill(false); //obj.transform.DOScale(1f, 0.1f); if (this.m_guideStatus != 0 && obj.transform.parent != base.transform) { obj.transform.SetParent(base.transform); } Vector2 a; RectTransformUtility.ScreenPointToLocalPointInRectangle(base.transform.GetComponent <RectTransform>(), eventData.position, eventData.pressEventCamera, out a); obj.transform.localPosition = a + new Vector2(0f, 100f); }
private void OnRandomHeart() { DOTween.Kill(this.m_img_heart, false); this.m_img_heart.transform.DOKill(false); this.m_img_heart.SetActive(true); this.m_img_heart.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f); Sequence _sequence = DOTween.Sequence(); _sequence.Append(this.m_img_heart.transform.DOScale(1.1f, 0.5f)); _sequence.Append(this.m_img_heart.transform.DOScale(1f, 0.3f)); _sequence.OnComplete(delegate { Sequence _sequence2 = DOTween.Sequence(); _sequence2.Append(this.m_img_heart.transform.DOScale(1.1f, 0.5f)); _sequence2.Append(this.m_img_heart.transform.DOScale(1f, 0.5f)); _sequence2.SetLoops(-1); _sequence2.SetTarget(this.m_img_heart); }); _sequence.SetTarget(this.m_img_heart); int num = Game1DataLoader.GetInstance().HeartIndex / PlayerPrefs.GetInt("BoardSize", 5); int num2 = Game1DataLoader.GetInstance().HeartIndex % PlayerPrefs.GetInt("BoardSize", 5); float m_cell_width = 800f / (float)PlayerPrefs.GetInt("BoardSize", 5); Vector3 position = new Vector3((float)(num2 * m_cell_width + 60 - 300), (float)(num * m_cell_width + 60 - 300), 0f); this.m_img_heart.transform.position = this.gameBox.transform.TransformPoint(position); }
public void UseHeart(int idx) { DOTween.Kill(this.m_img_heart, false); int num = idx / PlayerPrefs.GetInt("BoardSize", 5); int num2 = idx % PlayerPrefs.GetInt("BoardSize", 5); float m_cell_width = 800f / (float)PlayerPrefs.GetInt("BoardSize", 5); Vector3 position = new Vector3((float)(num2 * m_cell_width + 60 - 300), (float)(num * m_cell_width + 60 - 300), 0f); Vector3 endValue = this.gameBox.transform.TransformPoint(position); this.m_img_heart.transform.localScale = new Vector3(1f, 1f, 1f); this.m_img_heart.transform.DOJump(endValue, 0.1f, 1, 0.5f, false).OnComplete(delegate { this.blocks[idx].setNum(Game1DataLoader.GetInstance().GetNumber(idx)); this.m_img_heart.SetActive(false); GameObject obj = UnityEngine.Object.Instantiate <GameObject>(this.blocks[idx].gameObject); G1Block _sequence3 = obj.GetComponent <G1Block>(); _sequence3.transform.DOScale(1.5f, 0.5f); _sequence3.FadeOut().OnComplete(delegate { Game1DataLoader.GetInstance().HeartIndex = -1; Game1DataLoader.GetInstance().AutoDelete(); UnityEngine.Object.Destroy(obj); }); obj.transform.SetParent(this.transform, false); obj.transform.position = this.blocks[idx].transform.position; AudioManager.GetInstance().PlayEffect("sound_eff_click_1"); this.GameOver(); }); }
public void UseProps(G1Block block) { this.PlayUseProp(block, Game1DataLoader.GetInstance().CurPropId, delegate { foreach (int current in Game1DataLoader.GetInstance().Use(block.Index)) { if (current < this.blocks.Count) { G1Block g = this.blocks[current]; if (!(g == null)) { ParticlesControl.GetInstance().PlayExplodeEffic(g.transform.position, g.GetCurrentColor()); Game1DataLoader.GetInstance().FreeBlock(g.gameObject); } } } Sequence _sequence = DOTween.Sequence(); _sequence.AppendInterval(0.5f); TweenCallback _tween; if ((_tween = Game1Manager.FindPathClass._callback) == null) { _tween = (Game1Manager.FindPathClass._callback = new TweenCallback(Game1Manager.FindPathClass._findPathFunc.UseProps)); } _sequence.AppendCallback(_tween); }); }
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(); }
public Tween DelayMove(int index, float time) { return(base.transform.DOLocalMove(this.GetToPosition(index), 0.1f, false).SetDelay(time).OnComplete(delegate { Game1DataLoader.GetInstance().FreeBlock(base.gameObject); })); }
private Vector3 GetToPosition(int _index) { int row = Game1DataLoader.GetInstance().GetRow(_index); int col = Game1DataLoader.GetInstance().GetCol(_index); return(this.GetToPosition(row, col)); }
public void OnClickReturn(GameList obj) { if (Game1DataLoader.GetInstance().IsPlaying) { return; } this.m_markTips = false; Utils.ShowPause(Game1DataLoader.GetInstance().Score, delegate { Game1DataLoader.GetInstance().Score = 0; GM.GetInstance().SaveScore(1, 0); GM.GetInstance().SetSavedGameID(0); GM.GetInstance().ResetToNewGame(); GM.GetInstance().ResetConsumeCount(); GlobalEventHandle.EmitDoGoHome(); GlobalEventHandle.EmitClickPageButtonHandle("main", 0); }, delegate { GM.GetInstance().SaveScore(1, 0); GM.GetInstance().SetSavedGameID(0); GM.GetInstance().ResetToNewGame(); GM.GetInstance().ResetConsumeCount(); Game1DataLoader.GetInstance().Score = 0; Game1DataLoader.GetInstance().StartNewGame(); this.m_tips_time = 0f; this.m_markTips = true; }, delegate { this.m_markTips = true; }); }
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); }); }
private Vector3 GetToPosition(int index) { transform.localScale = new Vector3(1.3f, 1.3f, 1.3f); int row = Game1DataLoader.GetInstance().GetRow(index); int col = Game1DataLoader.GetInstance().GetCol(index); return(this.GetToPosition(row, col)); }
public void OnClickAds() { AdsManager.GetInstance().Play(AdsManager.AdType.ResetLife, delegate { GM.GetInstance().SetSavedGameID(this.gameID); Game1DataLoader.GetInstance().FillLife(false); Game1DataLoader.GetInstance().DoFillLife(); DialogManager.GetInstance().Close(null); }, null, 5, null); }
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); }
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; } }
private void RefreshScore(bool isAni = true) { if (isAni) { this.txt_score.GetComponent <OverlayNumber>().setNum(Game1DataLoader.GetInstance().Score); return; } this.txt_score.GetComponent <OverlayNumber>().Reset(); this.txt_score.GetComponent <OverlayNumber>().setNum(Game1DataLoader.GetInstance().Score); this.txt_score.GetComponent <Text>().text = string.Format((Game1DataLoader.GetInstance().Score < 1000) ? "{0}" : "{0:0,00}", Game1DataLoader.GetInstance().Score); }
public void OnClickHome() { FireBaseManager.Instance.LogEvent("Puzzle_Mix_Result_Main"); AdsControl.Instance.ShowInterstitial(); Game1DataLoader.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 OnClickDiamond() { if (!GM.GetInstance().isFullGEM(Convert.ToInt32(this.m_needGEM))) { ToastManager.Show("TXT_NO_50001", true); return; } GM.GetInstance().SetSavedGameID(this.gameID); GM.GetInstance().ConsumeGEM(Convert.ToInt32(this.m_needGEM)); GM.GetInstance().AddConsumeCount(); Game1DataLoader.GetInstance().FillLife(false); Game1DataLoader.GetInstance().DoFillLife(); DialogManager.GetInstance().Close(null); }
private void Delete(List <int> list, int index) { AudioManager.GetInstance().PlayEffect("sound_eff_clear_1"); List <Game1Manager.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 (Game1Manager.PathRDM current in list2) { G1Block g = this.blocks[current.index]; g.ShowScore(); this.blocks[current.index] = null; int row = Game1DataLoader.GetInstance().GetRow(current.index); int col = Game1DataLoader.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 = Game1DataLoader.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.AppendInterval(0.1f); sequence.OnComplete(delegate { Debug.Log("새로 만들기 시작" + index); this.blocks[index].setNum(Game1DataLoader.GetInstance().GetNumber(index)); Debug.Log("새로 만들기 1" + this.blocks[index].name); this.AddNewLife(this.blocks[index]); Debug.Log("새로 만들기 2"); Game1DataLoader.GetInstance().Down(); Debug.Log("새로 만들기 3"); Check_Action(); Debug.Log("새로 만들기 완료"); }); Game1DataLoader.GetInstance().IsPlaying = true; this.RefreshScore(true); }
public void OnClickAgain() { FireBaseManager.Instance.LogEvent("Puzzle_Mix_Result_Retry"); AudioManager.GetInstance().PlayBgMusic("sound_ingame", true); PlayerPrefs.SetInt("conti", 0); GM.GetInstance().SaveScore(this.gameID, 0); GM.GetInstance().SetSavedGameID(0); GM.GetInstance().ResetToNewGame(); GM.GetInstance().ResetConsumeCount(); Game1DataLoader.GetInstance().Score = 0; Game1DataLoader.GetInstance().StartNewGame(); DialogManager.GetInstance().Close(null); }
private void InitEvent() { Game1DataLoader.GetInstance().DoRefreshHandle += new Action(this.RefreshMap); Game1DataLoader.GetInstance().DoDeleteHandle += new Action <List <int>, int>(this.Delete); Game1DataLoader.GetInstance().DoDropHandle += new Action <List <sDropData>, List <int> >(this.Drop); Game1DataLoader _data1 = Game1DataLoader.GetInstance(); _data1.DoClickBlock = (Action <G1Block>)Delegate.Combine(_data1.DoClickBlock, new Action <G1Block>(this.OnClickBlock)); Game1DataLoader _data2 = Game1DataLoader.GetInstance(); _data2.DoFillLife = (Action)Delegate.Combine(_data2.DoFillLife, new Action(this.InitLife)); Game1DataLoader.GetInstance().DoCompMaxNumber += new Action <int>(this.PlayNewNumber); Game1DataLoader.GetInstance().OnClickReturnHandle = new Action <GameList>(this.OnClickReturn); Game1DataLoader.GetInstance().OnRandomHeartHandle = new Action(this.OnRandomHeart); Game1DataLoader.GetInstance().OnUseHeartHandle = new Action <int>(this.UseHeart); }
private void OnDoUseProps(bool isDel, List <GameObject> objs) { this.panel_handle.SetActive(!isDel); if (isDel) { return; } using (List <GameObject> .Enumerator enumerator = objs.GetEnumerator()) { while (enumerator.MoveNext()) { enumerator.Current.transform.SetParent(this.panel_handle.transform, true); } } Transform transform = this.panel_handle.transform.Find("txt_tips"); Text component = transform.GetComponent <Text>(); if (transform == null) { return; } DOTween.Kill(transform, false); Sequence expr_86 = DOTween.Sequence(); expr_86.Append(component.DOFade(1f, 0f)); expr_86.Append(component.DOFade(0.5f, 1f)); expr_86.Append(component.DOFade(1f, 1f)); expr_86.SetLoops(-1); expr_86.SetTarget(transform); string[] array = new string[] { "TXT_NO_50039", "TXT_NO_50040", "TXT_NO_50041" }; if (GM.GetInstance().GameId == 1) { component.GetComponent <LanguageComponent>().SetText(array[Game1DataLoader.GetInstance().CurPropId - 1]); } if (GM.GetInstance().GameId == 2) { component.GetComponent <LanguageComponent>().SetText("TXT_NO_50041"); } }
private void onBegainDragLife(GameObject obj, PointerEventData eventData) { if (obj != this.bloodList[0]) { return; } if (Game1DataLoader.GetInstance().IsPlaying) { return; } if (Game1DataLoader.GetInstance().HeartIndex != -1) { return; } obj.transform.DOKill(false); //obj.transform.DOScale(1f, 0.1f); }
private void LoadBlock() { Debug.Log("m_board_size22222 " + PlayerPrefs.GetInt("BoardSize", 5)); Debug.Log("m_board 3333333 " + m_board_size); for (int i = 0; i < m_board_size; i++) { for (int j = 0; j < m_board_size; j++) { int number = Game1DataLoader.GetInstance().GetNumber(i, j); int index = Game1DataLoader.GetInstance().GetIndex(i, j); G1Block item = Game1DataLoader.GetInstance().CreateBlock(number, index, this.gameBox); this.blocks.Add(item); } } }
public void OnClick() { if (Game1DataLoader.GetInstance().IsPlaying) { return; } if (Game1DataLoader.GetInstance().HeartIndex != -1) { return; } if (Game1DataLoader.GetInstance().IsGameOver()) { return; } AudioManager.GetInstance().PlayEffect("sound_eff_click_1"); Game1DataLoader.GetInstance().DoClickBlock(this); }
private void OnClickBlock(G1Block block) { Debug.Log("OnClickBlock " + Game1DataLoader.GetInstance().CurPropId); if (Game1DataLoader.GetInstance().CurPropId != 0) { this.m_dobleTotal = 0; ParticlesControl.GetInstance().StopChooseAllEffic(); Game1DataLoader.GetInstance().IsPlaying = true; this.ControlPropsPannel(true); this.UseProps(block); } else { this.MoveBloodToMap(block); } this.BeginAllParticle(); }
private void Drop(List <sDropData> dropList, List <int> newList) { Sequence sequence = DOTween.Sequence(); foreach (sDropData current in dropList) { G1Block g = this.blocks[current.srcIdx]; this.blocks[current.srcIdx] = null; this.blocks[current.dstIdx] = g; g.Index = current.dstIdx; Tween t = g.Move(current.dstIdx); sequence.Insert(0f, t); } for (int i = 0; i < m_board_size; i++) { int num = 0; foreach (int current2 in newList) { int col = Game1DataLoader.GetInstance().GetCol(current2); if (i == col) { Game1DataLoader.GetInstance().GetRow(current2); int number = Game1DataLoader.GetInstance().GetNumber(current2); G1Block g2 = Game1DataLoader.GetInstance().CreateBlock(number, current2, this.gameBox); g2.SetPosition(m_board_size + num, i); this.blocks[current2] = g2; Tween t2 = g2.Move(current2); sequence.Insert(0f, t2); num++; } } } sequence.AppendInterval(0.2f); sequence.OnComplete(delegate { Game1DataLoader.GetInstance().IsPlaying = false; Game1DataLoader.GetInstance().AutoDelete(); this.GameOver(); }); Game1DataLoader.GetInstance().IsPlaying = true; }
private void AddNewLife(G1Block block) { int num = Game1DataLoader.GetInstance().AddLife(); if (num == -1) { return; } int number = Game1DataLoader.GetInstance().BloodList[num]; G1BlockEvent _even = this.CreateNewLife(number, this.bloodBox, num); _even.transform.position = this.bloodPosList[num].transform.position; _even.transform.localScale = num == 0 ? new Vector3(1.3f, 1.3f, 1.3f) : new Vector3(1f, 1f, 1f); _even.transform.DOScale(this.bloodPosList[num].transform.localScale, 0.3f); }
private void InitLife() { for (int i = 0; i < 5; i++) { int num = Game1DataLoader.GetInstance().BloodList[i]; if (num != 0) { G1BlockEvent g = this.CreateNewLife(num, this.bloodBox, i); g.transform.localPosition = this.bloodPosList[i].transform.localPosition; g.transform.localScale = this.bloodPosList[i].transform.localScale; if (i == 0) { g.DisableDrag = false; } } } Check_Action(); this.m_markTips = true; }