private void ShowDialogueModel(DDialogue db) { DActor actorDB = null; if (db.Actor == 0) { XCharacter role = GTGlobal.Main; actorDB = ReadCfgActor.GetDataById(role.Id); } else { actorDB = ReadCfgActor.GetDataById(db.Actor); } if (actorDB == null) { return; } if (dlgRenderer != null) { dlgRenderer.DelAllModels(); } else { dlgRenderer = ERender.AddRender(dlgTexture); } dlgAvatar = GTWorld.Instance.AddAvatar(actorDB.Model); dlgAvatar.PlayAnim(db.Anim, null); dlgRenderer.AddModel(dlgAvatar.GetRootObj()); dlgAvatar.GetRootObj().transform.localPosition = new Vector3(-0.22f, -1.61f, 1.0f); dlgAvatar.GetRootObj().transform.localEulerAngles = new Vector3(0, 180, 0); }
private void ShowDialogueContent(DDialogue db) { string replaceName = string.Empty; switch (db.ContentType) { case EDialogueContentType.TYPE_NONE: { replaceName = string.Empty; } break; case EDialogueContentType.TYPE_PLAYER: { Character c = GTWorld.Main; replaceName = c == null ? string.Empty : c.Name; } break; case EDialogueContentType.TYPE_ACTOR: { DActor actorDB = ReadCfgActor.GetDataById(db.ContentID); replaceName = actorDB == null ? string.Empty : actorDB.Name; } break; case EDialogueContentType.TYPE_ITEM: { DItem itemDB = ReadCfgItem.GetDataById(db.ContentID); replaceName = itemDB == null ? string.Empty : itemDB.Name; } break; case EDialogueContentType.TYPE_MAP: { DCopyMainChapter worldDB = ReadCfgCopyMainChapter.GetDataById(db.ContentID); replaceName = worldDB == null ? string.Empty : worldDB.Name; } break; } dlgContent.text = db.Content.Replace("%p%", replaceName); switch (db.ContentShowType) { case EDialogueContentShowType.Normal: dlgContent.GetComponent <TypewriterEffect>().enabled = false; break; case EDialogueContentShowType.Effect: dlgContent.GetComponent <TypewriterEffect>().enabled = true; dlgContent.GetComponent <TypewriterEffect>().ResetToBeginning(); break; } }
private void ShowDialogue() { DDialogue db = ReadCfgDialogue.GetDataById(dlgCurID); if (db == null) { return; } ShowDialogueTitle(db); ShowDialogueContent(db); ShowDialogueModel(db); }
private void ShowDialogueTitle(DDialogue db) { if (db.Actor == 0) { Character c = GTWorld.Main; dlgTitle.text = c == null ? string.Empty : c.Name; } else { DActor actorDB = ReadCfgActor.GetDataById(db.Actor); dlgTitle.text = actorDB == null ? string.Empty : actorDB.Name; } }