Refactor settings types to use scripting API

This commit is contained in:
Wojtek Figat
2021-01-05 14:14:34 +01:00
parent cc8e78b505
commit be319c446d
75 changed files with 955 additions and 1431 deletions

View File

@@ -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;

View File

@@ -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>