Skip to content

Commit

Permalink
fix: Properly de-serialize lights' color when using Newtonsoft JSON (#34
Browse files Browse the repository at this point in the history
)

Co-authored-by: Andreas Atteneder <andreas.atteneder@gmail.com>
  • Loading branch information
2 people authored and GitHub Enterprise committed Aug 28, 2023
1 parent 432176f commit a08ada8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Runtime/Scripts/Schema/LightsPunctual.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors
// SPDX-License-Identifier: Apache-2.0

#if NEWTONSOFT_JSON && GLTFAST_USE_NEWTONSOFT_JSON
#define JSON_NEWTONSOFT
#else
#define JSON_UTILITY
#endif

using System;
#if JSON_NEWTONSOFT
using Newtonsoft.Json;
#endif
using Unity.Mathematics;
using UnityEngine;

Expand Down Expand Up @@ -71,6 +80,9 @@ public enum Type
/// RGB value for light's color in linear space
/// </summary>
[SerializeField]
#if JSON_NEWTONSOFT
[JsonProperty]
#endif
float[] color = { 1, 1, 1 };

/// <summary>
Expand Down

0 comments on commit a08ada8

Please sign in to comment.