When you have unsaved changes, you need this method: AssetDatabase.SaveAssets();
When you changed assets externally: AssetDatabase.ImportAsset(asset) or AssetDatabase.Refresh()
Note: both have ImportAssetOptions. Interesting ones:
- DontDownloadFromCacheServer - helpful to trobleshoot cache server problems,
- ForceSynchronousImport - in new versions of unity, asset import can be async. So, if your code requires all assets imported, you need to block, so use this option.
When you changed assets externally: AssetDatabase.ImportAsset(asset) or AssetDatabase.Refresh()
Note: both have ImportAssetOptions. Interesting ones:
- DontDownloadFromCacheServer - helpful to trobleshoot cache server problems,
- ForceSynchronousImport - in new versions of unity, asset import can be async. So, if your code requires all assets imported, you need to block, so use this option.
Комментариев нет:
Отправить комментарий