Fix Unity 5.6 submesh sorting bug

This commit is contained in:
2017-05-15 23:46:15 +07:00
parent 4451018727
commit 26e30e45f2
5 changed files with 39 additions and 4 deletions

View File

@@ -27,6 +27,17 @@ namespace FTRuntime.Internal {
//
//
public static T GetOrCreateComponent<T>(GameObject obj) where T : Component {
var comp = obj.GetComponent<T>();
return comp != null
? comp
: obj.AddComponent<T>();
}
//
//
//
public static void FillGeneratedMesh(Mesh mesh, SwfClipAsset.MeshData mesh_data) {
if ( mesh_data.SubMeshes.Length > 0 ) {
mesh.subMeshCount = mesh_data.SubMeshes.Length;