Class AssetSceneManager
Asset Scene Manager class.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Managers
Assembly: Evergine.Framework.dll
Syntax
public class AssetSceneManager : SceneManager, IDependencyObject
Constructors
AssetSceneManager()
Initializes a new instance of the AssetSceneManager class.
Declaration
public AssetSceneManager()
Fields
assetService
The asset service.
Declaration
[BindService(true)]
protected AssetsService assetService
Field Value
Type | Description |
---|---|
AssetsService |
Methods
AddReference(Guid, int)
Adds an asset reference to the dictionary.
Declaration
protected void AddReference(Guid id, int value = 1)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The asset's id. |
int | value | The value of the reference. |
Load<T>(Guid, bool)
Load an asset.
Declaration
public T Load<T>(Guid id, bool forceNewInstance = false) where T : ILoadable
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The asset id to load. |
bool | forceNewInstance | Force to reload the asset. |
Returns
Type | Description |
---|---|
T | The asset instance. |
Type Parameters
Name | Description |
---|---|
T | The asset type to load. |
Load<T>(string, bool)
Load an asset.
Declaration
public T Load<T>(string path, bool forceNewInstance = false) where T : ILoadable
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to load. |
bool | forceNewInstance | True to force a new instance of the asset. |
Returns
Type | Description |
---|---|
T | The loaded asset. |
Type Parameters
Name | Description |
---|---|
T | Type of the asset to load. |
Load<T>(string, Stream, bool)
Loads an asset.
Declaration
public T Load<T>(string name, Stream stream, bool forceNewInstance = false) where T : ILoadable
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the asset. |
Stream | stream | The stream of the asset. |
bool | forceNewInstance | True to force a new instance of the asset. |
Returns
Type | Description |
---|---|
T | The loaded asset. |
Type Parameters
Name | Description |
---|---|
T | Type of the asset to load. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Stream is null. |
ArgumentNullException | Asset name is null or empty. |
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if all is OK. |
Overrides
OnDestroy()
Invoked when the object is going to be disposed.
Declaration
protected override void OnDestroy()
Overrides
RegisterInstance<T>(ILoadable)
Register an instance of an scene asset into the scene manager..
Declaration
public bool RegisterInstance<T>(ILoadable asset) where T : ILoadable
Parameters
Type | Name | Description |
---|---|---|
ILoadable | asset | The new asset. |
Returns
Type | Description |
---|---|
bool | True if the asset has been registered properly. False otherwise. |
Type Parameters
Name | Description |
---|---|
T | The type of the asset. |
Unload(Guid)
Unload scene asset by Guid.
Declaration
public void Unload(Guid id)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | Asset guid. |
Unload(string)
Unload scene asset.
Declaration
public void Unload(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | Asset path. |