public static bool CreateAvater(ref Client.Avater refAvater, string strBodyPath, Transform parent, int nLayer, Action <object> callback, object param = null) { var bodyPath = strBodyPath; List <SuitInfo> lstSuit = new List <SuitInfo>(); SuitInfo info = new SuitInfo(); info.modelPath = bodyPath; info.pos = SuitPos.Cloth; lstSuit.Add(info); refAvater = new Client.Avater(); return(refAvater.CreateAvatar(parent.gameObject, lstSuit, nLayer, callback, param)); }
public static SuitInfo GetResPathBySuitID(uint uSuitID, Client.EquipPos pos, uint profession, uint sex, uint skillStatu) { SuitInfo info = new SuitInfo(); info.pos = (SuitPos)pos; var table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>(uSuitID); if (table_data == null) { GameCmd.enmCharSex nSex = (GameCmd.enmCharSex)GameUtil.FaceToSex(sex); // 根据职业、性别和部位去查找 var database = table.SelectRoleDataBase.Where((GameCmd.enumProfession)profession, (GameCmd.enmCharSex)nSex); if (database != null) { switch (pos) { case Client.EquipPos.EquipPos_Body: { table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.bodyPathID); break; } case Client.EquipPos.EquipPos_Weapon: { table_data = GameTableManager.Instance.GetTableItem <table.SuitDataBase>((uint)database.weaponPath); break; } } } } if (table_data == null) { return(info); } uint viewID = skillStatu == 0?table_data.viewresid:table_data.viewresid2; table.ResourceDataBase db = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(viewID); // 使用观察路径 if (db != null) { info.modelPath = db.strPath; info.locatorName = table_data.locator_name; } return(info); }