浏览代码

Fix Dialogue UI and Cutscene with the new changes

/main
uChema 4 年前
当前提交
28237f05
共有 2 个文件被更改,包括 11 次插入7 次删除
  1. 1
      UOP1_Project/Assets/Scripts/Cutscenes/CutsceneManager.cs
  2. 17
      UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs

1
UOP1_Project/Assets/Scripts/Cutscenes/CutsceneManager.cs


_activePlayableDirector.stopped -= HandleDirectorStopped;
_inputReader.EnableGameplayInput();
_dialogueManager.DialogueEnded();
}
private void HandleDirectorStopped(PlayableDirector director) => CutsceneEnded();

17
UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs


// [SerializeField] private ChoiceBox _choiceBox; // TODO: Demonstration purpose only. Remove or adjust later.
[SerializeField] private InputReader _inputReader = default;
public DialogueLineChannelSO OpenUIDialogueEvent;
public VoidEventChannelSO CloseUIDialogueEvent;
private DialogueDataSO _currentDialogueDataSO;
private int _counter;
private bool _reachedEndOfDialogue { get => _counter >= _currentDialogueDataSO.DialogueLines.Count; }

/// <param name="dialogueLine"></param>
public void DisplayDialogueLine(DialogueLineSO dialogueLine, ActorSO actor)
{
//TODO: Interface with a UIManager to allow displayal of the line of dialogue in the UI
Debug.Log("A line of dialogue has been spoken: \"" + dialogueLine.Sentence + "\" by " +actor.ActorName );
}
if(OpenUIDialogueEvent!=null)
{
OpenUIDialogueEvent.RaiseEvent(dialogueLine, actor);
}
}
private void OnAdvance()
{

public void DialogueEnded()
{
// TODO: Disable dialogue box.
Debug.Log("Dialogue Ended");
if(CloseUIDialogueEvent!=null)
CloseUIDialogueEvent.RaiseEvent();
_inputReader.advanceDialogueEvent -= OnAdvance;
_inputReader.EnableGameplayInput();
}

正在加载...
取消
保存