neuecc / UniRx

Reactive Extensions for Unity
MIT License
7.1k stars 889 forks source link

Inspector does not properly show Custom Reactive Property #239

Open NoxMortem opened 7 years ago

NoxMortem commented 7 years ago

The Inspector display looks very wrong: Inspector Inspector

[Serializable] public class RxPointPresenter : MonoBehaviour
{[SerializeField] public RxPoint point = new RxPoint(new Point(Vector3.zero));}

[Serializable]
public class RxPoint : ReactiveProperty<Point>  {
    public RxPoint() { }
    public RxPoint(Point initialValue) : base(initialValue) { }}

[CustomPropertyDrawer(typeof(RxPoint))]
public class PointReactivePropertyInspector : InspectorDisplayDrawer { }

public class Point{[SerializeField] public Vector3ReactiveProperty Position { get; set; }}

Looks like the InspectorDisplayDrawer does not properly display the ReactiveProperty

The first image was generated with a CustomPropertyDrawer:

[CustomPropertyDrawer(typeof(RxPoint))]
public class PointReactivePropertyInspector : InspectorDisplayDrawer { }

The second when using properties.

public Vector3ReactiveProperty Position { get; set; }

Windows x64 Home Unity 5.6.0p3

NoxMortem commented 7 years ago

And further: Is it not possible to make ReactiveCollection inspectable (viewable in the inspector) the same was as ReactiveProperties?