mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Manage all Assets with ContentManager
This commit is contained in:
@@ -22,7 +22,7 @@ abstract class Asset : RefCounter
|
||||
public StringView Identifier
|
||||
{
|
||||
get => _identifier;
|
||||
internal set => _identifier.Set(value);
|
||||
set => _identifier.Set(value);
|
||||
}
|
||||
|
||||
/// If true the asset is completely loaded. If false it is only partially loaded (if at all).
|
||||
@@ -40,6 +40,11 @@ abstract class Asset : RefCounter
|
||||
((.)new => AssetSerialize, new => AssetDeserialize));
|
||||
}
|
||||
|
||||
protected this()
|
||||
{
|
||||
Content.ManageAsset(this);
|
||||
}
|
||||
|
||||
protected ~this()
|
||||
{
|
||||
// TODO: crash when _contentManager is deleted first...
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace GlitchyEngine.Content
|
||||
var contentManager;
|
||||
|
||||
if (contentManager == null)
|
||||
contentManager = Application.Get().ContentManager;
|
||||
contentManager = Application.Instance.ContentManager;
|
||||
|
||||
Asset asset = contentManager.GetAsset(typeof(T), handle, blocking);
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace GlitchyEngine.Content
|
||||
var contentManager;
|
||||
|
||||
if (contentManager == null)
|
||||
contentManager = Application.Get().ContentManager;
|
||||
contentManager = Application.Instance.ContentManager;
|
||||
|
||||
return contentManager.ManageAsset(asset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user