Class Prefab
Class that represents a prefab.
Inherited Members
Namespace: Evergine.Framework.Prefabs
Assembly: Evergine.Framework.dll
Syntax
public class Prefab : ILoadable, IDisposable
Constructors
Prefab(EntityItemModel)
Initializes a new instance of the Prefab class.
Declaration
public Prefab(EntityItemModel root)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityItemModel | root | The root entity. |
Properties
Id
Gets or sets the asset Id.
Declaration
public Guid Id { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid | The asset path. |
ReaderVersion
Gets the reader version.
Declaration
public Version ReaderVersion { get; }
Property Value
| Type | Description |
|---|---|
| Version | The reader version. |
Root
Gets the prefab root entity.
Declaration
public EntityItemModel Root { get; }
Property Value
| Type | Description |
|---|---|
| EntityItemModel |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
Declaration
public void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
|
Instantiate()
Instantiates a Prefab.
Declaration
public Entity Instantiate()
Returns
| Type | Description |
|---|---|
| Entity | The entity already instantiated. |
Invalidate(ILoadable)
Invalidates this instance and raise the Invalidated event with the new ILoadable instance.
Declaration
public void Invalidate(ILoadable newInstance)
Parameters
| Type | Name | Description |
|---|---|---|
| ILoadable | newInstance | The new ILoadable instance. |
ReleaseUnusedMemory()
Release unused memory.
Declaration
public void ReleaseUnusedMemory()
Events
Invalidated
Occurs when this instance has been invalidated and all references must be reloaded.
Declaration
public event EventHandler<ILoadable> Invalidated
Event Type
| Type | Description |
|---|---|
| EventHandler<ILoadable> |