Beispiel #1
0
    void HandleButtonUp()
    {
        if (buttonSprite != null)
        {
            buttonSprite.sprite = spriteReleased;
        }
        if (buttonPressAudio)
        {
            thisAudioSource.PlayOneShot(buttonPressAudio);
        }


        if (buttonType == OtherSettEnum.DialogSpeed)
        {
            if (currentDialogSpeed >= maxDialogSpeed)
            {
                currentDialogSpeed = 0.01f;
            }
            if (currentDialogSpeed < 0.1f)
            {
                currentDialogSpeed += 0.01f;
            }

            currentDialogSpeed = Mathf.Clamp(currentDialogSpeed, 0.01f, 0.1f);

            PlayerPrefs.SetFloat("keyDialogSpeed", currentDialogSpeed);
        }
        else if (buttonType == OtherSettEnum.SetFullscreen)
        {
            Screen.fullScreen = !Screen.fullScreen;

            VNK_DialogManager.SaveBool("keyIsFullscreen", Screen.fullScreen);
        }
        else if (buttonType == OtherSettEnum.ResetData)
        {
            PlayerPrefs.DeleteAll();
        }
        else if (buttonType == OtherSettEnum.AutoDialogSpeed)
        {
            if (currentAutoDialogSpeed >= maxAutoDialog)
            {
                currentAutoDialogSpeed = minAutoDialog;
            }
            if (currentAutoDialogSpeed < maxAutoDialog)
            {
                currentAutoDialogSpeed += 0.5f;
            }

            PlayerPrefs.SetFloat("keyAutoDialogSpeed", currentAutoDialogSpeed);
        }
    }
    void HandleButtonUp()
    {
        if (buttonSprite != null)
        {
            buttonSprite.sprite = spriteReleased;
        }
        if (buttonPressAudio)
        {
            thisAudioSource.PlayOneShot(buttonPressAudio);
        }


        if (buttonType == OtherSettEnum.DialogSpeed)
        {
            if (VNK_DialogManager.dialogSpeed >= VNK_DialogManager.staticMaxDialogSpeed)
            {
                VNK_DialogManager.dialogSpeed = 0.01f;
            }
            if (VNK_DialogManager.dialogSpeed < 0.1f)
            {
                VNK_DialogManager.dialogSpeed += 0.01f;
            }

            VNK_DialogManager.dialogSpeed = Mathf.Clamp(VNK_DialogManager.dialogSpeed, 0.01f, 0.1f);

            PlayerPrefs.SetFloat("keyDialogSpeed", VNK_DialogManager.dialogSpeed);
        }
        else if (buttonType == OtherSettEnum.SetFullscreen)
        {
            Screen.fullScreen = !Screen.fullScreen;

            VNK_DialogManager.SaveBool("keyIsFullscreen", Screen.fullScreen);
        }
        else if (buttonType == OtherSettEnum.AutoDialogSpeed)
        {
            if (VNK_DialogManager.currentAutoDialogSpeed >= VNK_DialogManager.staticMaxAutoDialogSpeed)
            {
                VNK_DialogManager.currentAutoDialogSpeed = VNK_DialogManager.staticMinAutoDialogSpeed;
            }
            if (VNK_DialogManager.currentAutoDialogSpeed < VNK_DialogManager.staticMaxAutoDialogSpeed)
            {
                VNK_DialogManager.currentAutoDialogSpeed += 0.5f;
            }

            PlayerPrefs.SetFloat("keyAutoDialogSpeed", VNK_DialogManager.currentAutoDialogSpeed);
        }
    }