Add Default auto-generated member to scripting structures and improve deserialization

This commit is contained in:
Wojtek Figat
2022-08-01 18:49:54 +02:00
parent 4915e9fea0
commit fe1cab6a7f
11 changed files with 57 additions and 65 deletions

View File

@@ -16,33 +16,8 @@ namespace FlaxEditor.Content.Settings
/// </summary>
public GraphicsSettings()
{
// Initialize PostFx settings with default options (C# structs doesn't support it)
// Initialize PostFx settings with default options (C# structs don't support it)
PostProcessSettings = FlaxEngine.PostProcessSettings.Default;
}
}
}
namespace FlaxEngine
{
partial struct PostProcessSettings
{
private static PostProcessSettings _default;
/// <summary>
/// The default <see cref="PostProcessSettings"/>.
/// </summary>
public static PostProcessSettings Default
{
get
{
if (!_default.AmbientOcclusion.Enabled)
{
object obj = _default;
Utils.InitStructure(obj, typeof(PostProcessSettings));
_default = (PostProcessSettings)obj;
}
return _default;
}
}
}
}