/// <summary> /// 초기화 /// </summary> private void Awake() { if (_DialogueText != null) { _DialogueText.text = ""; } facepos = FACEPOS.LEFT; // 이벤트 등록 OnEvent_ClickButton += OnClickNumber; OnEvent_ChangeText += ChangeText; }
/// <summary> /// 다이얼로그 보여주기 /// </summary> /// <returns>다이얼로그 에셋</returns> public IEnumerator ShowDialogue() { float t; Sprite sp; is_Msg = true; is_nextmsg = true; temp2db = tempdb; temp2chicedb = tempchoicedb; if (_msgDialogueList.Count <= 0 || _msgtimer.Count <= 0) { //Debug.LogError(_msgDialogueList.Count +" " + _msgtimer.Count); try { //? 이벤트 실행 if (tempdb.subEvnet != null) { StartCoroutine(PlayEvent(0)); } //? 플레이메이커 이벤트 전송 if (tempdb._fsmFile != null) { tempdb._fsmFile.SendEvent(tempdb._fsmevent); } switch (tempdb.nextNODE._flow) { case FlowNode.FLOW.DIALOGUE: //? 다음 노드가 다이얼로그 인 경우 if (tempdb.nextNODE._NextNode != null) { LoadDialogue(tempdb.nextNODE._NextNode); StartCoroutine(ShowDialogue()); yield break; } break; case FlowNode.FLOW.CHOICEDIALOGUE: //? 다음 노드가 선택로그 인 경우 if (tempdb.nextNODE._ChoiceNode != null) { LoadChoiceDialogue(tempdb.nextNODE._ChoiceNode); StartCoroutine(ShowChoiceDialogue()); yield break; } break; } } catch (Exception e) { Debug.Log(e); } /* * if(tempdb.subEvnet.GetPersistentEventCount() > 0) * tempdb.subEvnet.Invoke(); */ is_keypad = true; is_Msg = false; is_nextmsg = false; HideDialogueObject(); //? 오브젝트 비활성화 yield break; } ShowDialogueObject(); //? 오브젝트 표시 BackGroundChange(); t = _msgtimer.Dequeue(); _m = _msgDialogueList.Dequeue(); _DialogueText.text = ""; _DialogueText.DOText(_m, t); sp = _msgSprite.Dequeue(); //? 이미지 표시 if (sp != null) { switch (facepos) { case FACEPOS.LEFT: _FaceLeft.sprite = sp; _FaceRight.sprite = _NullMask; facepos = FACEPOS.RIGHT; break; case FACEPOS.RIGHT: _FaceRight.sprite = sp; _FaceLeft.sprite = _NullMask; facepos = FACEPOS.LEFT; break; } } yield return(new WaitForSeconds(t + 0.7f)); _m = null; is_Msg = false; }