DataAssetAsset
- Namespace: Turian.Engine.Core
- Source File: DataAssetAsset.cs
Asset metadata that points to a serialized DataAsset payload file.
Public Methods
GetContent
public DataAsset? GetContent(string projectPath)
Gets the payload associated with this metadata asset. It is read once and then shared: every later call returns the same instance without I/O, so a change made through one holder is seen by all.
Parameters:
projectPath(string): The absolute project root path.
Returns: DataAsset?
- The shared
DataAssetpayload instance. Remarks:IAssetLoaderkeeps one metadata instance per id, so every caller loading through the same loader shares one payload. UseInstantiate{T}for a private copy.
Reload
public DataAsset? Reload(string projectPath)
Re-reads the payload into the instance GetContent already handed out, so live references see the new values. The instance is replaced only when the payload type changed.
Parameters:
projectPath(string): The absolute project root path.
Returns: DataAsset?
- The shared
DataAssetpayload instance.
LoadContent
public static DataAsset? LoadContent(string absolutePath)
Loads a payload from the specified absolute path.
Parameters:
absolutePath(string): The absolute file path of the payload asset.
Returns: DataAsset?
- The deserialized
DataAssetpayload instance.