Class JsonAsset
Generic type of Json-format asset. It provides the managed representation of this resource data so it can be accessed via C# API.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Content/JsonAsset.h
Syntax
public class JsonAsset : public JsonAssetBase
Fields
Instance
The deserialized unmanaged object instance (e.g. PhysicalMaterial). Might be null if asset was loaded before binary module with that asset was loaded (use GetInstance for this case).
Declaration
public void* Instance
Field Value
void
|
InstanceType
The scripting type of the deserialized unmanaged object instance (e.g. PhysicalMaterial).
Declaration
public ScriptingTypeHandle InstanceType
Field Value
ScriptingTypeHandle
|
Methods
GetInstance()
Gets the deserialized native object instance of the given type. Returns null if asset is not loaded or loaded object has different type.
Declaration
public T* GetInstance() const
Returns
T
The asset instance object or null. |
Type Parameters
typename T
|
GetMemoryUsage()
Gets amount of CPU memory used by this resource (in bytes). It's a rough estimation. Memory may be fragmented, compressed or sub-allocated so the actual memory pressure from this resource may vary.
Declaration
public virtual uint64 GetMemoryUsage() const override
Returns
uint64
|
Overrides
loadAsset()
Loads asset
Declaration
protected virtual LoadResult loadAsset() override
Returns
LoadResult
Loading result |
Overrides
OnGetData(rapidjson_flax::StringBuffer& buffer)
Declaration
protected virtual void OnGetData(rapidjson_flax::StringBuffer& buffer) const override
Parameters
rapidjson_flax::StringBuffer
buffer
|
Overrides
onLoaded_MainThread()
Declaration
protected virtual void onLoaded_MainThread() override
Overrides
unload(bool isReloading)
Unloads asset data
Declaration
protected virtual void unload(bool isReloading) override
Parameters
bool
isReloading
True if asset is reloading data, otherwise false. |