private void OnPlayAudio(EventParam param) { string tag = param.GetString("tag"); switch (tag) { case "play_one": { PlayAudio(param.GetInt(tag)); break; } case "play_loop": { PlayLoop(param.GetInt(tag)); break; } } }
private void OnSkinChanged(EventParam param) { string tag = param.GetString("tag"); int skinIndex = param.GetInt(tag); GameSetting.Instance.currentCardSkin = skinIndex; StartCoroutine(ChangeCardSkin(skinIndex)); AppController.Instance.SaveSetting(); //Utilities.Instance.DispatchEvent(Solitaire.Event.SaveData, "save_data", 0); }
private void ShowPopup(EventParam param) { string tag = param.GetString("tag"); switch (tag) { case "game_over": { int score = param.GetInt(tag); OnGameOver(score); break; } case "tutorial": { m_ScorePanel.gameObject.SetActive(true); m_TutorialPanel.SetActive(true); break; } } }
private void OnScoreUpdate(EventParam param) { int score = param.GetInt("score"); SetScore(score); }
private void ShowPopup(EventParam param) { string tag = param.GetString("tag"); if (!String.IsNullOrEmpty(tag)) { switch (tag) { case "option": { if (m_PopupList.ContainsKey(tag)) { m_PopupList[tag].SetActive(true); } else { m_PopupList.Add(tag, Instantiate(m_OptionMenuPrefab, Vector3.zero, Quaternion.identity)); } break; } case "new_game": { if (m_PopupList.ContainsKey(tag)) { m_PopupList[tag].SetActive(true); } else { m_PopupList.Add(tag, Instantiate(m_NewGamePopupPrefab, Vector3.zero, Quaternion.identity)); } break; } case "game_result": { int result = param.GetInt(tag); if (m_PopupList.ContainsKey(tag)) { m_PopupList[tag].SetActive(true); } else { m_PopupList.Add(tag, Instantiate(m_GameResultPopupPrefab, Vector3.zero, Quaternion.identity)); } m_PopupList[tag].GetComponent <ResultPopup>().IsWin = result == 1 ? true : false; break; } case "how_to_play": { if (m_PopupList.ContainsKey(tag)) { m_PopupList[tag].SetActive(true); } else { m_PopupList.Add(tag, Instantiate(m_HowToPlayPopupPrefab, Vector3.zero, Quaternion.identity)); m_PopupList[tag].GetComponent <HowToPlayPopup>().SetData(); } break; } case "card_skin": { if (m_PopupList.ContainsKey(tag)) { m_PopupList[tag].SetActive(true); } else { m_PopupList.Add(tag, Instantiate(m_CardSkinPopupPrefab, Vector3.zero, Quaternion.identity)); } break; } } } }