mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-24 11:35:24 -05:00
s_typeMap を遅延
This commit is contained in:
@@ -14,7 +14,18 @@ namespace UniGLTF
|
||||
|
||||
public abstract class RemapEditorBase
|
||||
{
|
||||
public static Dictionary<String, Type> s_typeMap = new Dictionary<string, Type>();
|
||||
static Dictionary<String, Type> s_typeMap;
|
||||
static Dictionary<String, Type> TypeMap
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_typeMap == null)
|
||||
{
|
||||
s_typeMap = new Dictionary<string, Type>();
|
||||
}
|
||||
return s_typeMap;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct SubAssetPair
|
||||
@@ -25,8 +36,8 @@ namespace UniGLTF
|
||||
[SerializeField]
|
||||
public String Name;
|
||||
|
||||
public SubAssetKey Key => new SubAssetKey(s_typeMap[Type], Name);
|
||||
public ScriptedImporter.SourceAssetIdentifier ID => new AssetImporter.SourceAssetIdentifier(s_typeMap[Type], Name);
|
||||
public SubAssetKey Key => new SubAssetKey(TypeMap[Type], Name);
|
||||
public ScriptedImporter.SourceAssetIdentifier ID => new AssetImporter.SourceAssetIdentifier(TypeMap[Type], Name);
|
||||
|
||||
[SerializeField]
|
||||
public UnityEngine.Object Object;
|
||||
@@ -34,7 +45,7 @@ namespace UniGLTF
|
||||
public SubAssetPair(SubAssetKey key, UnityEngine.Object o)
|
||||
{
|
||||
Type = key.Type.ToString();
|
||||
s_typeMap[Type] = key.Type;
|
||||
TypeMap[Type] = key.Type;
|
||||
Name = key.Name;
|
||||
Object = o;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace UniGLTF
|
||||
importer.RemoveRemap(kv.ID);
|
||||
}
|
||||
}
|
||||
m_editMap.Clear();
|
||||
AssetDatabase.WriteImportSettingsIfDirty(importer.assetPath);
|
||||
AssetDatabase.ImportAsset(importer.assetPath, ImportAssetOptions.ForceUpdate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user