MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / onLoaded_MainThread

Method onLoaded_MainThread

Source/Engine/Content/JsonAsset.cpp:442–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442void JsonAsset::onLoaded_MainThread()
443{
444 JsonAssetBase::onLoaded_MainThread();
445
446 // Special case for Settings assets to flush them after edited and saved in Editor
447 // TODO: add interface for custom JsonAsset interaction of the instance class (eg. OnJsonLoaded, or similar to C# like OnDeserialized from Newtonsoft.Json)
448 const StringAsANSI<> dataTypeNameAnsi(DataTypeName.Get(), DataTypeName.Length());
449 const auto typeHandle = Scripting::FindScriptingType(StringAnsiView(dataTypeNameAnsi.Get(), DataTypeName.Length()));
450 if (Instance && typeHandle && typeHandle.IsSubclassOf(SettingsBase::TypeInitializer) && _isAfterReload)
451 {
452 _isAfterReload = false;
453 ((SettingsBase*)Instance)->Apply();
454 }
455}
456
457bool JsonAsset::CreateInstance()
458{

Callers

nothing calls this directly

Calls 6

FindScriptingTypeFunction · 0.85
StringAnsiViewClass · 0.50
GetMethod · 0.45
LengthMethod · 0.45
IsSubclassOfMethod · 0.45
ApplyMethod · 0.45

Tested by

no test coverage detected