示例#1
0
    private void OnSettingValueChanged(EventParam param)
    {
        string tag = param.GetString("tag");

        switch (tag)
        {
        case "audio":
        {
            GameSetting.Instance.enableAudio = param.GetBoolean(tag);
            break;
        }

        case "enable_ads":
        {
            GameSetting.Instance.enableAds = param.GetBoolean(tag);
            break;
        }
        }

        Utilities.Instance.DispatchEvent(Solitaire.Event.OnSettingChanged, "setting_changed", 0);
        AppController.Instance.SaveSetting();
        //Utilities.Instance.DispatchEvent(Solitaire.Event.SaveData, "save_data", 0);
    }
    private void OnNewGame(EventParam param)
    {
        bool isPlayAgain = param.GetBoolean("new_game");

        if (isPlayAgain)
        {
            OnReset();
        }

        m_IsStart = true;
        m_Score   = 0;
        m_Bird.gameObject.SetActive(true);

        m_TimeBlock = Time.time;
        m_TimeCloud = Time.time;
        StartCoroutine(CheckCollision());
    }
示例#3
0
    private void OnUndoPutback(EventParam param)
    {
        string tag = param.GetString("tag");

        if (tag.Equals("undo_putback"))
        {
            m_IsEmpty         = param.GetBoolean(tag);
            m_Renderer.sprite = m_Empty;
            return;
        }

        if (tag.Equals("undo_draw"))
        {
            m_IsEmpty         = false;
            m_Renderer.sprite = m_Back;
            return;
        }
    }
示例#4
0
    private void OnBtnUndoChanged(EventParam param)
    {
        string tag = param.GetString("tag");

        if (tag.Equals("undo"))
        {
            m_BtnUndo.interactable = param.GetBoolean(tag);

            if (m_BtnUndo.IsInteractable())
            {
                m_UndoColor.a = 1.0f;
            }
            else
            {
                m_UndoColor.a = 0.5f;
            }

            m_UndoIcon.color = m_UndoColor;
            m_UndoText.color = m_UndoColor;
        }
    }