Esempio n. 1
0
 public static void DrawSuit(GameObject go, FashionSuit.RowData rowData, uint presentid, int weapon_index, bool complete)
 {
     if (rowData != null)
     {
         XRoleParts xpart = go.GetComponent <XRoleParts>();
         XRolePart  part  = UtilPart(go, rowData.id);
         if (part != null)
         {
             UnloadSuit(go);
             DrawFace(go, (RoleShape)rowData.shape, TCConst.FACE, xpart.face, presentid);
             if (complete)
             {
                 DrawPart(go, rowData.body, (RoleShape)rowData.shape, rowData.dir, TCConst.BODY, part.body, part.sbody, SearchPart(rowData.id, (uint)FPart.BODY));
                 DrawPart(go, rowData.hair, (RoleShape)rowData.shape, rowData.dir, TCConst.HAIR, part.hair, part.shair, SearchPart(rowData.id, (uint)FPart.HAIR));
                 DrawPart(go, rowData.helmet, (RoleShape)rowData.shape, rowData.dir, TCConst.HELMET, part.helmet, part.shelmet, SearchPart(rowData.id, (uint)FPart.HELMET));
                 uint pos = weapon_index == 1 ? (uint)FPart.WEAPON : 5;
                 DrawWeapon(go, (RoleShape)rowData.shape, rowData.dir, part, presentid, weapon_index, SearchPart(rowData.id, pos));
                 DrawWing(go, rowData.dir);
             }
         }
     }
     else
     {
         Debug.LogError("rowdata is null " + go.name + "  presentid: " + presentid);
     }
 }
Esempio n. 2
0
        public static void DrawWeapon(GameObject go, RoleShape shape, string dir, XRolePart part, uint presentid, int weapon_index, FashionList.RowData row)
        {
            string    sshape    = shape.ToString().ToLower();
            Transform transf    = go.transform.Find("Player_" + sshape + "_" + TCConst.WEAPON);
            string    shape_dir = "Player_" + sshape;
            string    cname     = "Player_" + sshape + "_" + dir + "_" + TCConst.WEAPON + "_" + presentid + "_" + weapon_index;
            string    asset     = "Assets/BundleRes/FBXRawData/" + shape_dir + "/" + shape_dir + "_" + dir + "/" + cname;

            for (int i = 0; i < part.weapon.Length; i++)
            {
                if (part.weapon[i].presentid == presentid)
                {
                    if (weapon_index == 1)
                    {
                        FashionUtility.DrawPart(transf, asset, part.weapon[i].weapon1, part.weapon[i].sweapon1, row);
                    }
                    else
                    {
                        DrawPart(transf, asset, part.weapon[i].weapon2, part.weapon[i].sweapon2, row);
                    }
                    break;
                }
            }
        }