From cc31171e6d4b2d9797e1119ed6a0cacd785ce21d Mon Sep 17 00:00:00 2001 From: Pascal Jacob Date: Thu, 10 Nov 2022 17:52:13 +0100 Subject: [PATCH] Use file name as generated mesh name --- Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs b/Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs index a8fc3a1..93a7cf2 100644 --- a/Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs +++ b/Packages/jp.keijiro.metamesh/Editor/MetameshImporter.cs @@ -1,6 +1,7 @@ using UnityEngine; using UnityEditor; using UnityEngine.Rendering; +using System.IO; #if UNITY_2020_2_OR_NEWER using UnityEditor.AssetImporters; #else @@ -53,7 +54,8 @@ public override void OnImportAsset(AssetImportContext context) Mesh ImportAsMesh(string path) { var mesh = new Mesh(); - mesh.name = "Mesh"; + string name = Path.GetFileNameWithoutExtension(path); + mesh.name = name; switch (_shape) {