/// <summary> /// 创建角色 /// </summary> /// <param name="actorId"></param> /// <param name="pos"></param> /// <param name="rot"></param> /// <returns></returns> //private uint PeiID = 8000; /// <summary> /// 创建怪物 /// </summary> /// <param name="actorId"></param> /// <param name="pos"></param> /// <param name="rot"></param> /// <returns></returns> public UnitID CreatePet(uint pet_id, uint actorId, Vector3 pos, Quaternion rot, Actor parent) { if (parent == null) { return(null); } //++PeiID; UnitID unit_id = ActorManager.GetAvailableModelId((byte)EUnitType.UNITTYPE_PET); var unit_cache_info = ActorHelper.CreatePetUnitCacheInfo(unit_id.obj_idx, pet_id, actorId, pos, rot, parent); ActorManager.Instance.PushUnitCacheData(unit_cache_info); return(unit_cache_info.UnitID); }