Skip to content

Unity Simple Reactive Property -> For small projects, so as not to import UniRx or R3

License

Notifications You must be signed in to change notification settings

RimuruDev/Unity-ReactiveProperty-Helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Unity ReactiveProperty Helper

How to use

[Serializable]
public class CurrencyData
{
    public ReactiveProperty<int> SoftCurrency { get; private set; }
    public ReactiveProperty<int> HardCurrency { get; private set; }

    public CurrencyData()
    {
        SoftCurrency = new ReactiveProperty<int>();
        HardCurrency = new ReactiveProperty<int>();
    }
}

Newtonsoft.Json

    [Serializable]
    public class CurrencyStorage
    {
        [JsonProperty] public ReactiveProperty<int> SoftCurrency { get; private set; } = new();

        [JsonProperty] public ReactiveProperty<int> HardCurrency { get; private set; } = new();
    }