mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-25 20:16:05 -05:00
Fix import Exception from Unity-6.4
This commit is contained in:
@@ -81,7 +81,17 @@ namespace UniGLTF
|
||||
if (!EditorTextureUtility.TryGetAsEditorTexture2DAsset(externalTexture, out var texture2D, out var importer)) return;
|
||||
|
||||
Configure(texDesc, importer);
|
||||
importer.SaveAndReimport();
|
||||
|
||||
// https://github.com/vrm-c/UniVRM/issues/2813 (4)
|
||||
// https://github.com/vrm-c/UniVRM/issues/2783
|
||||
//
|
||||
// UnityException: Calls to "AssetDatabase.ImportAsset" are restricted during asset importing.
|
||||
// Please make sure this function is not called from ScriptedImporters or PostProcessors,
|
||||
// as it is a source of non-determinism.
|
||||
UnityEditor.EditorApplication.delayCall += () =>
|
||||
{
|
||||
importer.SaveAndReimport();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user