More asset handles

This commit is contained in:
Simon Lübeß
2023-03-13 20:35:36 +01:00
parent c22d122921
commit c3fb9bbd5d
11 changed files with 97 additions and 75 deletions
@@ -18,7 +18,8 @@ class PropertiesWindow : EditorWindow
private append String _selectedFileName = .();
private Asset _currentAsset ~ _?.ReleaseRef();
private AssetHandle _currentAssetHandle;
private Asset _currentAsset;
public this(Editor editor)
{
@@ -78,7 +79,8 @@ class PropertiesWindow : EditorWindow
if (_currentAsset?.Identifier != assetFile.Identifier)
{
_currentAsset?.ReleaseRef();
_currentAsset = _editor.ContentManager.LoadAsset(assetFile.Identifier);
_currentAssetHandle = _editor.ContentManager.LoadAsset(assetFile.Identifier);
_currentAsset = _editor.ContentManager.GetAsset(null, _currentAssetHandle);
}
// TODO: allow changing AssetLoader