public static void DrawAtlas_Sub4(hgAtlasInfoData.RECTPATTERN pattern, Vector2[] atlasRect, int[] size, Vector2 perfectSize, hgMesh.MeshSet meshSet, int boneIndex, Vector3[] vs, int colorIndex, hgAtlasInfoData.StrechMode mode, bool frameOnly /*=false*/) { switch (pattern) { case hgAtlasInfoData.RECTPATTERN.ONE: DrawAtlas_ONE(atlasRect, meshSet, boneIndex, vs, colorIndex); break; case hgAtlasInfoData.RECTPATTERN.THREEHORIZON: DrawAtlas_HORIZON(atlasRect, size, perfectSize, meshSet, boneIndex, vs, colorIndex, mode); break; case hgAtlasInfoData.RECTPATTERN.THREEVERTIACAL: DrawAtlas_VERTICAL(atlasRect, size, perfectSize, meshSet, boneIndex, vs, colorIndex, mode); break; case hgAtlasInfoData.RECTPATTERN.NINE: DrawAtlas_NINE(atlasRect, size, perfectSize, meshSet, boneIndex, vs, colorIndex, mode, frameOnly); break; } }
public static void DrawAtlas_Sub3(hgAtlasInfoData.RECTPATTERN pattern, Vector2[] atlasRect, MeshSet meshSet, int boneIndex, Vector3[] vs, int colorIndex) { int save_vsize = (meshSet != null) ? meshSet.vclist.Count : 0; // Vertex meshSet.vlist.AddRange(vs); // Vcolor var ncolor = hglHtmlColor.IndexToVColor(colorIndex); ncolor.a = 17f / 64f - 1f / 128f; meshSet.vclist.AddRange(new Color[] { ncolor, ncolor, ncolor, ncolor }); // Triangle meshSet.trilist.AddRange(new int[] { save_vsize, save_vsize + 1, save_vsize + 3 }); meshSet.trilist.AddRange(new int[] { save_vsize, save_vsize + 3, save_vsize + 2 }); /* uv * 0--1 | | | 2--3 | */ meshSet.uvlist.AddRange(atlasRect); // bone weights if (boneIndex < 0) { throw new SystemException("Unexpected!"); } meshSet.bwlist.Add(new BoneWeight() { boneIndex0 = boneIndex, weight0 = 1 }); // v[0] meshSet.bwlist.Add(new BoneWeight() { boneIndex0 = boneIndex, weight0 = 1 }); // v[1] meshSet.bwlist.Add(new BoneWeight() { boneIndex0 = boneIndex, weight0 = 1 }); // v[2] meshSet.bwlist.Add(new BoneWeight() { boneIndex0 = boneIndex, weight0 = 1 }); // v[3] }