public override void PrepareForExport() { base.PrepareForExport(); if (_submeshIndex == 0 && _mesh.SubMeshCount > 1) { for (int i = 1; i < _mesh.SubMeshCount; ++i) { var dummyObject = new GameObject("Submesh#" + i); dummyObject.transform.parent = mComponent.transform; var submeshObject = new GLexGameObject(dummyObject, _glexGameObject.GlexData); _glexGameObject.GlexData.AddGameObject(submeshObject); var submeshRenderer = new GLexMeshRenderer(this, i); submeshObject.AddComponent(submeshRenderer); _glexGameObject.GlexData.AddComponent(submeshRenderer); GooExporter.RemoveAfterExport(dummyObject); } } }
public override void PrepareForExport() { base.PrepareForExport(); if (_submeshIndex == 0 && mMesh.SubMeshCount > 1) { for (int i = 1; i < mMesh.SubMeshCount; ++i) { var dummyObject = new GameObject("Submesh#" + i); dummyObject.transform.parent = mComponent.transform; var submeshObject = new GLexGameObject(dummyObject, _glexGameObject.GlexData); _glexGameObject.GlexData.AddGameObject(submeshObject); var submeshRenderer = (GLexSkinnedMeshRenderer)System.Activator.CreateInstance(GetType()); submeshRenderer.SetupSubmeshRenderer(this, i); submeshObject.AddComponent(submeshRenderer); _glexGameObject.GlexData.AddComponent(submeshRenderer); GooExporter.RemoveAfterExport(dummyObject); } } }