/// <summary> /// 根据怪物组id获取怪物的位置 /// </summary> /// <param name="id"></param> /// <param name="data"></param> /// <returns></returns> static public Vector3 GetMonsterPosition(uint id, Neptune.Data data = null) { if (data == null) { data = Neptune.DataManager.Instance.Data; } Neptune.MonsterBase monsterBase = data.GetNode <Neptune.MonsterBase>((int)id); if (monsterBase != null) { return(monsterBase.Position); } return(Vector3.zero); }
/// <summary> /// 根据PkgMonBrief来初始化AOI数据 /// </summary> /// <param name="info"></param> /// <param name="pos"></param> /// <returns></returns> public static UnitCacheInfo CreateUnitCacheInfo(PkgMonBrief info, Vector3 pos) { var unit_cache_info = new xc.UnitCacheInfo(EUnitType.UNITTYPE_MONSTER, info.uuid); unit_cache_info.CacheType = xc.UnitCacheInfo.EType.ET_Create; unit_cache_info.PosBorn = pos; unit_cache_info.AOIMonster.type_idx = info.actor_id; unit_cache_info.AOIMonster.camp = info.side; unit_cache_info.AOIMonster.level = info.lv; Actor parent = ActorManager.Instance.GetPlayer(info.father_id); unit_cache_info.ParentActor = parent; unit_cache_info.AttrElements = info.attr_elm; Neptune.MonsterBase monster = Neptune.DataManager.Instance.Data.GetNode <Neptune.MonsterBase>((int)(info.group_id)); if (monster != null) { unit_cache_info.Rotation = monster.Rotation; } return(unit_cache_info); }