public static void CreateGroupAsset() { string dirPath = SelectionUtility.GetSelectionDir(); if (!string.IsNullOrEmpty(dirPath)) { string filePath = $"{dirPath}/asset_group.asset"; filePath = AssetDatabase.GenerateUniqueAssetPath(filePath); var config = ScriptableObject.CreateInstance <AssetGroupCreater>(); config.RootFolder = dirPath; EditorUtility.SetDirty(config); AssetDatabase.CreateAsset(config, filePath); AssetDatabase.ImportAsset(filePath); } else { Debug.LogError("AssetMenuItems::CreateGroupAsset->The dir is not found"); } }