private void EndDialogue(int inGroupId) { if (this.m_curUiForm != null) { ResGuideTipInfo dataByKey = GameDataMgr.guideTipDatabin.GetDataByKey((long)inGroupId); DebugHelper.Assert(dataByKey != null); if (dataByKey != null) { DialogueProcessor.SActorLineNode outNode = new DialogueProcessor.SActorLineNode(); this.TranslateNodeFromRaw(ref outNode, ref dataByKey); GameObject widget = this.m_curUiForm.GetWidget(outNode.DialogPos); if (widget != null) { widget.CustomSetActive(false); } this.m_currentOpenNode[outNode.DialogPos] = false; bool flag = true; for (int i = 0; i < this.m_currentOpenNode.Length; i++) { if (this.m_currentOpenNode[i]) { flag = false; break; } } if (flag) { Singleton <CUIManager> .GetInstance().CloseForm(this.m_curUiForm); this.m_curUiForm = null; } } } }
private void StartDialogue(int inGroupId) { ResGuideTipInfo dataByKey = GameDataMgr.guideTipDatabin.GetDataByKey((long)inGroupId); if (dataByKey != null) { this.TranslateNodeFromRaw(ref this.m_actorLines, ref dataByKey); DialogueProcessor.SActorLineNode actorLines = this.m_actorLines; this.QueryUiForm(actorLines.DialogStyle); if (this.m_curUiForm != null) { GameObject obj2 = this.ShowOneWidget((enGuideTipFormWidget)actorLines.DialogPos, true); DebugHelper.Assert(obj2 != null); obj2.transform.FindChild(this.m_contentGoName).gameObject.GetComponent <Text>().text = actorLines.DialogContent; obj2.transform.FindChild(this.m_nameGoName).gameObject.GetComponent <Text>().text = actorLines.DialogTitle; if (actorLines.PortraitImgPrefab.Object != null) { Transform transform = obj2.transform.FindChild(this.m_imgGoName); if (transform != null) { transform.gameObject.GetComponent <Image>().SetSprite(actorLines.PortraitImgPrefab.Object); } } if (!string.IsNullOrEmpty(actorLines.VoiceEvent)) { Singleton <CSoundManager> .GetInstance().PostEvent(actorLines.VoiceEvent, null); } DebugHelper.Assert(actorLines.DialogPos < this.m_currentOpenNode.Length); this.m_currentOpenNode[actorLines.DialogPos] = true; } } }
private void TranslateNodeFromRaw(ref DialogueProcessor.SActorLineNode outNode, ref ResGuideTipInfo inRecord) { outNode.DialogContent = StringHelper.UTF8BytesToString(ref inRecord.szTipContent); outNode.DialogTitle = StringHelper.UTF8BytesToString(ref inRecord.szTipTitle); outNode.DialogPos = inRecord.bTipPos; outNode.VoiceEvent = StringHelper.UTF8BytesToString(ref inRecord.szTipVoice); string fullPathInResources = StringHelper.UTF8BytesToString(ref inRecord.szImagePath); fullPathInResources = CUIUtility.s_Sprite_Dynamic_Dialog_Dir_Head + fullPathInResources; outNode.PortraitImgPrefab.Object = Singleton <CResourceManager> .GetInstance().GetResource(fullPathInResources, typeof(GameObject), enResourceType.UIPrefab, false, false).m_content as GameObject; if (outNode.PortraitImgPrefab.Object == null) { fullPathInResources = CUIUtility.s_Sprite_Dynamic_Dialog_Dir_Head + "0000"; outNode.PortraitImgPrefab.Object = Singleton <CResourceManager> .GetInstance().GetResource(fullPathInResources, typeof(GameObject), enResourceType.UIPrefab, false, false).m_content as GameObject; } }