Exemple #1
0
        //public static GameObject Create(GameCmd.SelectUserInfo info)
        //{
        //    var bodyPath = GetModelPath((ushort)info.suite, (byte)info.face);
        //    var weaponPath = GetModelPath((ushort)info.weapon, (byte)info.face, false);
        //    switch ((enumProfession)info.type)
        //    {
        //        case enumProfession.Profession_Soldier:
        //            weaponPath = "Prefabs/Models/Weapon/ZS/Wepon_Zs10";
        //            break;
        //        case enumProfession.Profession_Gunman:
        //            weaponPath = "Prefabs/Models/Weapon/GS/Wepon_Gs10";
        //            break;
        //        case enumProfession.Profession_Freeman:
        //            weaponPath = "Prefabs/Models/Weapon/FS/Wepon_Fs10";
        //            break;
        //        case enumProfession.Profession_Doctor:
        //            weaponPath = "Prefabs/Models/Weapon/MS/Wepon_Ms10";
        //            break;
        //        default:
        //            break;
        //    }
        //    var wingPath = GetModelPath((ushort)info.wing, (byte)info.face, false);
        //    var tbl = table.SelectRoleDataBase.Where(info.type, (GameCmd.enmCharSex)GameUtil.FaceToSex((byte)info.face));
        //    var avatarRole = CreateAvatarByPath(info.type, bodyPath, weaponPath, wingPath, tbl.bodyPath);
        //    return avatarRole;
        //}

        public static bool CreateAvater(ref Client.Avater refAvater, GameCmd.SelectUserInfo info, Transform parent, int nLayer, Action <object> callback, object param = null)
        {
            List <SuitInfo> lstSuit = new List <SuitInfo>();

            lstSuit.Add(GetResPathBySuitID(info.sclothes, Client.EquipPos.EquipPos_Body, (uint)info.type, info.face, info.skillstatus));
            lstSuit.Add(GetResPathBySuitID(info.sqibing, Client.EquipPos.EquipPos_Weapon, (uint)info.type, info.face, info.skillstatus));
            lstSuit.Add(GetResPathBySuitID(info.sback, Client.EquipPos.EquipPos_Wing, (uint)info.type, info.face, info.skillstatus));
            lstSuit.Add(GetResPathBySuitID(info.sface, Client.EquipPos.EquipPos_Face, (uint)info.type, info.face, info.skillstatus));

            refAvater = new Client.Avater();
            return(refAvater.CreateAvatar(parent.gameObject, lstSuit, nLayer, callback, param));
        }
Exemple #2
0
        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));
        }