handakim25 / ProjectTitan

0 stars 0 forks source link

DialogueManager UI가 Callback 설정 오류 #33

Closed handakim25 closed 7 months ago

handakim25 commented 7 months ago

증상

UI가 Callback을 FindUI에서만 호출하고 있기 때문에 Callback을 제대로 설정하고 있지 않는다.

  private void FindUI()
  {
      _dialogueUI = FindObjectOfType<DialogueUIController>(true);
      if(_dialogueUI != null)
      {
          _dialogueUI.OnNextDialogue += OnNextDialogueHandler;
          _dialogueUI.OnDialougeEnd += OnDialogueEndHandler;
          _dialogueUI.OnChoiceSelected += OnChoiceSelectedHandler;
      }
  }

해결 방법

DialogueUI를 Property로 변경하고 Property에 대입할 때 Callback을 등록하도록 수정. UI를 설정하는 부분이 StartDialogue에 있는 것도 안 맞는다. StartDialogue에서는 Dialogue 관련 로직만을 담을 것

handakim25 commented 7 months ago

bb8c1e2