diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs index 29359fb5a..20c1a9631 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContext.cs @@ -57,9 +57,6 @@ namespace UniGLTF #endregion #region Load. Build unity objects - - public bool EnableLoadBalancing; - public virtual async Awaitable LoadAsync(Func MeasureTime = null) { if (MeasureTime == null) @@ -145,16 +142,7 @@ namespace UniGLTF { using (MeasureTime("BuildMesh")) { - MeshWithMaterials meshWithMaterials; - if (EnableLoadBalancing) - { - meshWithMaterials = await MeshImporter.BuildMeshAsync(MaterialFactory, x); - } - else - { - meshWithMaterials = MeshImporter.BuildMesh(MaterialFactory, x); - } - + var meshWithMaterials = await MeshImporter.BuildMeshAsync(MaterialFactory, x); var mesh = meshWithMaterials.Mesh; // mesh name diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContextExtensions.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContextExtensions.cs index 6d06c9457..5eaf1915a 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContextExtensions.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/ImporterContextExtensions.cs @@ -6,29 +6,6 @@ namespace UniGLTF { public static class ImporterContextExtensions { - // /// - // /// ReadAllBytes, Parse, Create GameObject - // /// - // /// allbytes - // public static void Load(this ImporterContext self, string path) - // { - // var bytes = File.ReadAllBytes(path); - // self.Load(path, bytes); - // } - - // /// - // /// Parse, Create GameObject - // /// - // /// gltf or glb path - // /// allbytes - // public static void Load(this ImporterContext self, string path, byte[] bytes) - // { - // var parser = new GltfParser(); - // parser.Parse(path, bytes); - // self.Load(parser); - // self.Root.name = Path.GetFileNameWithoutExtension(path); - // } - /// /// Build unity objects from parsed gltf /// diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshImporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshImporter.cs index 1409dcb0e..8e7402316 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshImporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshImporter.cs @@ -627,33 +627,6 @@ namespace UniGLTF } } - public static MeshWithMaterials BuildMesh(MaterialFactory ctx, MeshImporter.MeshContext meshContext) - { - var (mesh, recalculateTangents) = _BuildMesh(meshContext); - - if (recalculateTangents) - { - mesh.RecalculateTangents(); - } - - // 先にすべてのマテリアルを作成済みなのでテクスチャーは生成済み。Resultを使ってよい - var result = new MeshWithMaterials - { - Mesh = mesh, - Materials = meshContext.MaterialIndices.Select(x => ctx.GetMaterial(x)).ToArray() - }; - - if (meshContext.BlendShapes.Count > 0) - { - var emptyVertices = new Vector3[mesh.vertexCount]; - foreach (var blendShape in meshContext.BlendShapes) - { - BuildBlendShape(mesh, meshContext, blendShape, emptyVertices); - } - } - return result; - } - public static async Awaitable BuildMeshAsync(MaterialFactory ctx, MeshImporter.MeshContext meshContext) { var (mesh, recalculateTangents) = _BuildMesh(meshContext);