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; } }
// 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(); } } } }