Ejemplo n.º 1
0
    void HandleButtonUp()
    {
        if (buttonSprite != null && buttonType != ButtonTypeEnum.Auto)
        {
            buttonSprite.sprite = spriteReleased;
        }
        if (buttonPressAudio)
        {
            thisAudioSource.PlayOneShot(buttonPressAudio);
        }

        if (buttonType == ButtonTypeEnum.Save)
        {
            VNK_DialogManager.SaveSavedata();
            PlayerPrefs.SetString("keyLastDialog", VNK_DialogManager.currentDialog.name);
            if (saveLevelToo)
            {
                PlayerPrefs.SetString("keyLastLevel", levelName);
            }
        }
        else if (buttonType == ButtonTypeEnum.Load)
        {
            VNK_DialogManager.LoadSavedata();
        }
        else if (buttonType == ButtonTypeEnum.Auto)
        {
            VNK_DialogManager.autoGoToNextScreen = !VNK_DialogManager.autoGoToNextScreen;
        }
    }
Ejemplo n.º 2
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);
        }
    }
Ejemplo n.º 3
0
    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);
        }
    }
Ejemplo n.º 4
0
    // This is called when we move to another dialog
    void GoToNextScreen()
    {
        StopCoroutine("AutoNextScreen");
        StopCoroutine("ShowDialog");
        isShowingDialog       = false;
        canGoOnNextScreen     = false;
        playedBgFxClip        = false;
        playedCharaVoiceClip  = false;
        playedGameplayFxClip  = false;
        autoMovedToNextScreen = false;


        VNK_DialogManager.staticBgFX.Stop();
        VNK_DialogManager.staticCharaVoice.Stop();
        VNK_DialogManager.staticGameplayFX.Stop();


        if (changeBackground)         //Background02 is over Background01
        {
            if (fadeChanging)
            {
                if (VNK_DialogManager.staticBackground01.color.a != 0.0f && VNK_DialogManager.staticBackground02.color.a == 0.0f && !canFadeBack02)
                {
                    FadeBackground02(newBackground);
                }
                else if (VNK_DialogManager.staticBackground01.color.a == 0.0f && VNK_DialogManager.staticBackground02.color.a != 0.0f && !canFadeBack01)
                {
                    FadeBackground01(newBackground);
                }
            }
            else
            {
                if (VNK_DialogManager.staticBackground01.color.a != 0.0f && VNK_DialogManager.staticBackground02.color.a == 0.0f)
                {
                    VNK_DialogManager.staticBackground01.sprite = newBackground;
                }
                else if (VNK_DialogManager.staticBackground01.color.a == 0.0f && VNK_DialogManager.staticBackground02.color.a != 0.0f)
                {
                    VNK_DialogManager.staticBackground02.sprite = newBackground;
                }
            }
        }

        if (saveState)
        {
            VNK_DialogManager.SaveSavedata();
            PlayerPrefs.SetString("keyLastDialog", this.gameObject.name);

            if (saveCurrentLevel)
            {
                PlayerPrefs.SetString("keyLastLevel", levelName);
            }
        }
        if (!isLastOne)
        {
            if (wantToDestroyObj)
            {
                Destroy(objToDestroy);
            }
            if (wantToSendMessageToObj)
            {
                objToSendMessage.SendMessage(messageToSend);
            }
            VNK_DialogManager.privateID = moveToID;
        }
        if (isLastOne)
        {
            VNK_DialogManager.staticDialogText.text = "";

            if (colorReset)
            {
                VNK_DialogManager.staticDialogText.color = resetColor;
            }
            if (wantToDestroyObj)
            {
                Destroy(objToDestroy);
            }
            if (wantToSendMessageToObj)
            {
                objToSendMessage.SendMessage(messageToSend);
            }

            if (switchDialog)
            {
                if (destroyOnEnd)
                {
                    this.gameObject.GetComponent <VNK_DialogCreator>().Stop();
                    newDialog.SetActive(true);
                    VNK_DialogManager.currentDialog = newDialog;
                    newDialog.GetComponent <VNK_DialogCreator>().Play();
                    Destroy(gameObject);
                }
                if (!destroyOnEnd)
                {
                    this.gameObject.GetComponent <VNK_DialogCreator>().Stop();
                    newDialog.SetActive(true);
                    VNK_DialogManager.currentDialog = newDialog;
                    newDialog.GetComponent <VNK_DialogCreator>().Play();
                    this.gameObject.SetActive(false);
                }
            }
            if (!switchDialog)
            {
                if (destroyOnEnd)
                {
                    EndDialog e = null;//만약 챕터의 마지막 일 경우
                    e = this.gameObject.GetComponent <EndDialog>();
                    if (e != null)
                    {
                        e.callAnything();
                    }
                    Stop();
                    Destroy(gameObject);
                }
                if (!destroyOnEnd)
                {
                    EndDialog e = null;//만약 챕터의 마지막 일 경우
                    e = this.gameObject.GetComponent <EndDialog>();
                    if (e != null)
                    {
                        e.callAnything();
                    }
                    Stop();
                }
            }
        }
    }