public void FadeUI(bool show, float time, float delay) { Sequence seq = DOTween.Sequence().SetUpdate(true); seq.AppendInterval(delay); seq.Append(dialogueBox.DOFade(show? 1 : 0, time)); if (show) { seq.Join(dialogueBox.transform.DOScale(0, time * 2).From().SetEase(Ease.OutBack)); //start the story after the box fades in. seq.AppendCallback(() => ink.StartStory(currentNPC.inkJSON)); } }
public void StartDialog(bool _isStartDialog) /*string dialogToReproduce, string NPCName , string NPCstartAudio, string NPCfinalAudio, List<string> NPCAudio, Sprite portraitNPC)*/ { dialogTime = true; isCurrentDialogStart = _isStartDialog; //Si es startDialog cargo el dialogo de start y si no cargo el de end if (_isStartDialog) { SoundManager.Instance.StopMusic(); SoundManager.Instance.PlayMusic(AppMusic.DIALOG_MUSIC); if (isInterlude && SceneManager.GetActiveScene().name == interludeSceneName) { inkManRef.inkJSONAsset = interludeDialog; } else { inkManRef.inkJSONAsset = currentLevelStartDialog; } } else { inkManRef.inkJSONAsset = currentLevelEndDialog; LM.UIM.ActivateDialogHud(true); } inkManRef.StartStory(); inkManRef.story.ChoosePathString(dialogInitializer); inkManRef.RefreshView(); //dialogManRef.SetVariables(dialogToReproduce, portraitNPC); dialogManRef.OpenDialogWindow(); ///SoundManager.Instance.PlaySound(AppSounds.ENTERDIALOG_SFX); ///npcEndsound = npcData.finalAudio; }