Refactor settings types to use scripting API
This commit is contained in:
@@ -214,6 +214,7 @@ Asset::LoadResult JsonAsset::loadAsset()
|
||||
if (!instance)
|
||||
return LoadResult::Failed;
|
||||
Instance = instance;
|
||||
InstanceType = typeHandle;
|
||||
_dtor = type.Class.Dtor;
|
||||
type.Class.Ctor(instance);
|
||||
|
||||
@@ -238,6 +239,7 @@ void JsonAsset::unload(bool isReloading)
|
||||
|
||||
if (Instance)
|
||||
{
|
||||
InstanceType = ScriptingTypeHandle();
|
||||
_dtor(Instance);
|
||||
Allocator::Free(Instance);
|
||||
Instance = nullptr;
|
||||
|
||||
@@ -74,7 +74,6 @@ protected:
|
||||
/// <summary>
|
||||
/// Generic type of Json-format asset. It provides the managed representation of this resource data so it can be accessed via C# API.
|
||||
/// </summary>
|
||||
/// <seealso cref="JsonAssetBase" />
|
||||
API_CLASS(NoSpawn) class JsonAsset : public JsonAssetBase
|
||||
{
|
||||
DECLARE_ASSET_HEADER(JsonAsset);
|
||||
@@ -83,6 +82,11 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The scripting type of the deserialized unmanaged object instance (e.g. PhysicalMaterial).
|
||||
/// </summary>
|
||||
ScriptingTypeHandle InstanceType;
|
||||
|
||||
/// <summary>
|
||||
/// The deserialized unmanaged object instance (e.g. PhysicalMaterial).
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user