Moved material editing from component window to asset editor

- EditorContentManager now returns null if asset wasn't found (instead of crashing)
- FixUp asset identifier when dragging from asset browser
- Lock current asset in properties editor
This commit is contained in:
Simon Lübeß
2023-01-08 20:31:43 +01:00
parent d3d284256c
commit 2324ae852d
9 changed files with 394 additions and 143 deletions
+5 -1
View File
@@ -24,6 +24,7 @@ class AssetFile
private EditorContentManager _contentManager;
private String _path;
private String _identifier;
private String _assetConfigPath;
private AssetConfig _assetConfig ~ delete _;
@@ -35,6 +36,7 @@ class AssetFile
public bool IsDirectory => _isDirectory;
public StringView FilePath => _path;
public StringView Identifier => _identifier;
public const String ConfigFileExtension = ".ass";
@@ -43,11 +45,13 @@ class AssetFile
public Object LoadedAsset => _loadedAsset;
[AllowAppend]
public this(EditorContentManager contentManager, StringView path, bool isDirectory)
public this(EditorContentManager contentManager, StringView identifier, StringView path, bool isDirectory)
{
String identifierBuffer = append String(identifier);
String pathBuffer = append String(path);
String configPathBuffer = append String(path.Length + ConfigFileExtension.Length);
_identifier = identifierBuffer;
_path = pathBuffer;
configPathBuffer..Append(path).Append(ConfigFileExtension);