Add Default auto-generated member to scripting structures and improve deserialization
This commit is contained in:
@@ -29,7 +29,7 @@ API_ENUM() enum class WindowStartPosition
|
||||
/// <summary>
|
||||
/// Settings for new window.
|
||||
/// </summary>
|
||||
API_STRUCT() struct CreateWindowSettings
|
||||
API_STRUCT(NoDefault) struct CreateWindowSettings
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(CreateWindowSettings);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user