Fix null values handling in C# Json serialization
It didn't replace prefab object reference if replaced with null in the prefab instance.
This commit is contained in:
@@ -73,7 +73,7 @@ namespace FlaxEngine.Json
|
||||
ContractResolver = new ExtendedDefaultContractResolver(isManagedOnly),
|
||||
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
||||
TypeNameHandling = TypeNameHandling.Auto,
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
NullValueHandling = NullValueHandling.Include,
|
||||
ObjectCreationHandling = ObjectCreationHandling.Auto,
|
||||
};
|
||||
if (ObjectConverter == null)
|
||||
@@ -276,6 +276,11 @@ namespace FlaxEngine.Json
|
||||
cache.IsDuringSerialization = false;
|
||||
Current.Value = cache;
|
||||
|
||||
/*// Debug json string reading
|
||||
cache.MemoryStream.Initialize(jsonBuffer, jsonLength);
|
||||
cache.Reader.DiscardBufferedData();
|
||||
string json = cache.Reader.ReadToEnd();*/
|
||||
|
||||
cache.MemoryStream.Initialize(jsonBuffer, jsonLength);
|
||||
cache.Reader.DiscardBufferedData();
|
||||
var jsonReader = new JsonTextReader(cache.Reader);
|
||||
|
||||
@@ -877,7 +877,7 @@ namespace FlaxEngine.GUI
|
||||
/// <summary>
|
||||
/// Gets or sets the tooltip text.
|
||||
/// </summary>
|
||||
[HideInEditor]
|
||||
[HideInEditor, NoSerialize]
|
||||
public string TooltipText
|
||||
{
|
||||
get => _tooltipText;
|
||||
@@ -887,7 +887,7 @@ namespace FlaxEngine.GUI
|
||||
/// <summary>
|
||||
/// Gets or sets the custom tooltip control linked. Use null to show default shared tooltip from the current <see cref="Style"/>.
|
||||
/// </summary>
|
||||
[HideInEditor]
|
||||
[HideInEditor, NoSerialize]
|
||||
public Tooltip CustomTooltip
|
||||
{
|
||||
get => _tooltip;
|
||||
|
||||
Reference in New Issue
Block a user