public NpcInfo GetNpcInfoByUnitId(int id) { NpcInfo npc = null; for (LinkedListNode <NpcInfo> linkNode = m_Npcs.FirstValue; null != linkNode; linkNode = linkNode.Next) { NpcInfo info = linkNode.Value; if (info.GetUnitId() == id) { npc = info; break; } } return(npc); }
internal void Create(NpcInfo npc) { Init(); if (null != npc) { m_Npc = npc; ObjectInfo.UnitId = m_Npc.GetUnitId(); ObjectInfo.CampId = m_Npc.GetCampId(); ObjectInfo.LinkId = m_Npc.GetLinkId(); MovementStateInfo msi = m_Npc.GetMovementStateInfo(); Vector3 pos = msi.GetPosition3D(); float dir = msi.GetFaceDir(); CreateActor(m_Npc.GetId(), m_Npc.GetModel(), pos, dir, m_Npc.Scale); npc.ActorId = Actor; ObjectInfo.IsNpc = true; CreateBornEffect(Actor, npc.GetBornEffect(), npc.ParticleScale, npc.GetBornEffectTime()); InitAnimationSets(); } }