コード例 #1
0
    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;
        }
        }
    }
コード例 #2
0
    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);
    }
コード例 #3
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;
        }
        }
    }
コード例 #4
0
    private void OnScoreUpdate(EventParam param)
    {
        int score = param.GetInt("score");

        SetScore(score);
    }
コード例 #5
0
    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;
            }
            }
        }
    }