diff --git a/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs b/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs index 6d0ab9bfc..16ba0819f 100644 --- a/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs +++ b/Assets/VRM10/Editor/ScriptedImporter/EditorVrm.cs @@ -3,7 +3,6 @@ using UnityEngine; using System.Linq; using System.IO; using UnityEditor; -using VRMShaders; #if UNITY_2020_2_OR_NEWER using UnityEditor.AssetImporters; #else @@ -55,6 +54,22 @@ namespace UniVRM10 } } + /// + /// $"{assetPath without extension}.{folderName}" + /// + /// + /// + /// + static string GetAndCreateFolder(string assetPath, string suffix) + { + var path = $"{Path.GetDirectoryName(assetPath)}/{Path.GetFileNameWithoutExtension(assetPath)}{suffix}"; + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + return path; + } + /// /// SubAssetを外部ファイルに展開する /// @@ -65,14 +80,9 @@ namespace UniVRM10 return; } - var path = $"{Path.GetDirectoryName(importer.assetPath)}/{Path.GetFileNameWithoutExtension(importer.assetPath)}.Extracted"; - if (!Directory.Exists(path)) - { - Directory.CreateDirectory(path); - } - // meta { + var path = GetAndCreateFolder(importer.assetPath, ".Meta"); foreach (var (key, asset) in importer.GetSubAssets(importer.assetPath)) { asset.ExtractSubAsset($"{path}/{asset.name}.asset", false); @@ -81,12 +91,15 @@ namespace UniVRM10 { // expressions + var path = GetAndCreateFolder(importer.assetPath, ".Expressions"); foreach (var (key, asset) in importer.GetSubAssets(importer.assetPath)) { asset.ExtractSubAsset($"{path}/{asset.name}.asset", false); } - + } + { // expressions + var path = GetAndCreateFolder(importer.assetPath, ".ExpressionAvatar"); foreach (var (key, asset) in importer.GetSubAssets(importer.assetPath)) { asset.ExtractSubAsset($"{path}/{asset.name}.asset", false);