public XNPC CreateNPC(XNpcList.RowData row) { var pos = new Vector3(row.NPCPosition[0], row.NPCPosition[1], row.NPCPosition[2]); var rot = Quaternion.Euler(row.NPCRotation[0], row.NPCRotation[1], row.NPCRotation[2]); return(CreateNPC(row, pos, rot)); }
public XNPC CreateNPC(XNpcList.RowData row, Vector3 pos, Quaternion rot) { XAttributes attr = InitAttrByPresent(row.PresentID); attr.AppearPostion = pos; attr.AppearQuaternion = rot; var e = PrepareEntity <XNPC>(attr); Add(EntityType.Npc, e); return(e); }
public XEntity CreateNPC(uint id, float yRotate, Vector3 pos, int _waveid) { Quaternion rotation = Quaternion.Euler(0, yRotate, 0); XNpcList.RowData row = XTableMgr.GetTable <XNpcList>().GetByUID((int)id); XEntity entity = XEntityMgr.singleton.CreateNPC(row, pos, rotation); if (entity != null) { entity.Wave = _waveid; entity.CreateTime = Time.realtimeSinceStartup; return(entity); } return(null); }