diff --git a/Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs b/Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs index 2135dd7..c83c811 100644 --- a/Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs +++ b/Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs @@ -23,6 +23,7 @@ public sealed class MetameshImporter : ScriptedImporter [SerializeField] Ring _ring = new Ring(); [SerializeField] Disc _disc = new Disc(); [SerializeField] bool _generateLightmapUVs = false; + [SerializeField] bool _readWriteMeshes = false; public override void OnImportAsset(AssetImportContext context) { @@ -65,7 +66,7 @@ Mesh ImportAsMesh(string path) mesh.RecalculateBounds(); if(_generateLightmapUVs) Unwrapping.GenerateSecondaryUVSet(mesh); - mesh.UploadMeshData(true); + mesh.UploadMeshData(!_readWriteMeshes); return mesh; } diff --git a/Packages/jp.keijiro.metamesh/Editor/MetameshImporterEditor.cs b/Packages/jp.keijiro.metamesh/Editor/MetameshImporterEditor.cs index 684ae79..7a12017 100644 --- a/Packages/jp.keijiro.metamesh/Editor/MetameshImporterEditor.cs +++ b/Packages/jp.keijiro.metamesh/Editor/MetameshImporterEditor.cs @@ -21,6 +21,7 @@ sealed class MetameshImporterEditor : ScriptedImporterEditor SerializedProperty _ring; SerializedProperty _disc; SerializedProperty _generateLightmapUVs; + SerializedProperty _readWriteMeshes; public override void OnEnable() { @@ -35,6 +36,7 @@ public override void OnEnable() _ring = serializedObject.FindProperty("_ring"); _disc = serializedObject.FindProperty("_disc"); _generateLightmapUVs = serializedObject.FindProperty("_generateLightmapUVs"); + _readWriteMeshes = serializedObject.FindProperty("_readWriteMeshes"); } public override void OnInspectorGUI() @@ -56,6 +58,7 @@ public override void OnInspectorGUI() } EditorGUILayout.PropertyField(_generateLightmapUVs); + EditorGUILayout.PropertyField(_readWriteMeshes); serializedObject.ApplyModifiedProperties(); ApplyRevertGUI();