public void Init(NPCWorldMapData npcData, GameObject @object) { m_CurrNPCEntity = NPCDBModel.GetInstance.GetEntityById(npcData.NPCId); InitHeadBar(); //提取npc需要说的话 m_npcTalkContent = m_CurrNPCEntity.Talk.Split('|'); }
private IEnumerator InitNPC() { yield return(null); if (worldMapEntity == null) { yield break; } for (int i = 0; i < worldMapEntity.NPCWorldMapList.Count; i++) { NPCWorldMapData data = worldMapEntity.NPCWorldMapList[i]; NPCEntity nPCEntity = NPCDBModel.GetInstance.GetEntityById(data.NPCId); GameObject @object = RoleMgr.Instance.LoadNPC(nPCEntity.PrefabName); @object.transform.position = data.NPCPostion; @object.transform.eulerAngles = new Vector3(0, data.EulerAngleY, 0); @object.GetComponent <NPCCtr>().Init(data, @object); } }