Skip to content

RimuruDev/Unity-ReactivePropertyConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Unity -> Reactive Property Converter

ReactivePropertyConverter for ReactiveProperty

Dependency:

{
  "dependencies": {
    "com.unity.nuget.newtonsoft-json": "3.2.1",
 }
}

Example

    [Serializable]
    public class HalloweenUserProgress
    {
        [JsonProperty("Currency")] 
        [JsonConverter(typeof(ReactivePropertyConverter))]
        public ReactiveProperty<int> Currency = new();

        [JsonProperty("LevelProgress")] 
        [JsonConverter(typeof(ReactivePropertyConverter))]
        public ReactiveProperty<List<LevelProgress>> LevelProgress = new();
    }

Before use [JsonConverter(typeof(ReactivePropertyConverter))]

image

After use [JsonConverter(typeof(ReactivePropertyConverter))]

image