Пример #1
0
    void OnClick()
    {
        switch (this.gameObject.name)
        {
        case "2.BGSound":
            if (AudioScirpt.bgmFlag)
            {
                BGM.spriteName      = "btn_bgsound_off";
                AudioScirpt.bgmFlag = false;
            }
            else
            {
                BGM.spriteName      = "btn_bgsound_on";
                AudioScirpt.bgmFlag = true;
            }
            break;

        case "3.EffectSound":
            if (AudioScirpt.effectFlag)
            {
                Effect.spriteName      = "btn_sound_off";
                AudioScirpt.effectFlag = false;
            }
            else
            {
                Effect.spriteName      = "btn_sound_on";
                AudioScirpt.effectFlag = true;
            }
            break;

        case "4.DeleteData":
            panel3.alpha = 0.5f;
            warningPopup.SetActive(true);

            break;

        case "5.Exit":
            panel1.alpha = 1.0f;
            panel2.alpha = 1.0f;
            option.SetActive(false);
            break;

        case "3.Yes Button":
            csUserSaveNLoad.loadFlag = true;
            userInfo.InitTest();

            warningPopup.SetActive(false);
            panel3.alpha = 1.0f;
            break;

        case "4.No Button":
            warningPopup.SetActive(false);
            panel3.alpha = 1.0f;
            break;
        }
    }
Пример #2
0
    void OnClick()
    {
        Debug.Log(this.gameObject.name);

        switch (this.gameObject.name)
        {
        case "2.Sprite (btn_start)":

            if (EncryptedPlayerPrefs.GetInt("DataExist", 0) == 1)
            {
                csUserSaveNLoad.loadFlag = true;

                inventory.SetActive(true);
                stageScene.SetActive(true);
                break;
            }
            else
            {
                csUserSaveNLoad.loadFlag = true;

                userInfo.InitTest();
                inventory.SetActive(true);
                stageScene.SetActive(true);
                break;
            }

        case "4.Sprite (btn_load)":
            if (EncryptedPlayerPrefs.GetInt("DataExist", 0) == 1)
            {
                csUserSaveNLoad.loadFlag = true;
                main.SetActive(false);
                inventory.SetActive(true);
                inventory_Character.SetActive(true);

                Main.currentSceneNumber = 2;
            }
            break;

        case "3.Yes Button":
            Main.currentSceneNumber  = 2;
            csUserSaveNLoad.loadFlag = true;
            userInfo.InitTest();

            warningPopup.SetActive(false);
            main.SetActive(false);
            inventory.SetActive(true);
            inventory_Character.SetActive(true);

            panel1.alpha = 1.0f;
            panel2.alpha = 1.0f;
            break;

        case "4.No Button":
            warningPopup.SetActive(false);
            panel1.alpha = 1.0f;
            panel2.alpha = 1.0f;
            break;

        case "4.Sprite (btn_option)":
            panel1.alpha = 0.5f;
            panel2.alpha = 0.5f;
            Option.SetActive(true);
            break;

        case "8.Sprite (btn_help)":
            panel1.alpha = 0.5f;
            panel2.alpha = 0.5f;
            HelpObj.SetActive(true);
            break;
        }
    }