| 440 | } |
| 441 | |
| 442 | void 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 | |
| 457 | bool JsonAsset::CreateInstance() |
| 458 | { |
nothing calls this directly
no test coverage detected