public void StartChoiceDialogueMsg(Dialogue.ChoiceDialogue db) { if (_dialogueenum == DialoguePettonEnum.CHOICEMSG) { //! 대화중이면 이동 금지 HJ.Manager.DialogueManager.is_keypad = false; //! 대화내용 DB 로드 HJ.Manager.DialogueManager.Instance.LoadChoiceDialogue(db); //! 대화내용 DB 완료시 대화시작 StartCoroutine(HJ.Manager.DialogueManager.Instance.ShowChoiceDialogue()); } }
public void LoadChoiceDialogue(ChoiceDialogue db) { _choiceList.Clear(); _msgTitle = null; tempchoicedb = null; List <string> s = db.ChoiceMsgList; if (s.Count >= 1) { _msgTitle = db.dialogueTitle; for (int i = 0; i < s.Count; i++) { _choiceList.Add(s[i]); } tempchoicedb = db; } }
void OnClickNumber(int n) { FlowNode node = null; if (n == 1) { node = tempchoicedb._NextChoice1Node; } else if (n == 2) { node = tempchoicedb._NextChoice2Node; } else if (n == 3) { node = tempchoicedb._NextChoice3Node; } else { Debug.LogError("OnClickNumber Method Node null"); return; } //? 이벤트 실행 switch (n) { case 1: //? 이벤트 실행 if (tempchoicedb.subevent1 != null) { Debug.Log("PlayEvent 1"); StartCoroutine(PlayEvent(1)); } break; case 2: //? 이벤트 실행 if (tempchoicedb.subevent2 != null) { Debug.Log("PlayEvent 2"); StartCoroutine(PlayEvent(2)); } break; case 3: //? 이벤트 실행 if (tempchoicedb.subevent3 != null) { Debug.Log("PlayEvent 3"); StartCoroutine(PlayEvent(3)); } break; } switch (node._flow) { case FlowNode.FLOW.DIALOGUE: LoadDialogue(node._NextNode); tempchoicedb = null; StartCoroutine(ShowDialogue()); break; case FlowNode.FLOW.CHOICEDIALOGUE: LoadChoiceDialogue(node._ChoiceNode); StartCoroutine(ShowChoiceDialogue()); break; } is_Msg = false; is_choice = false; }
/// <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; }