diff --git a/README.md b/README.md index e1e1c561..17045896 100644 --- a/README.md +++ b/README.md @@ -735,6 +735,38 @@ You open tracker window in `Window -> Observable Tracker`. It enables watch `Sub Observable Tracker is intended for debugging use only as enabling tracking and capturing stacktraces is useful but has a heavy performance impact. Recommended usage is to enable both tracking and stacktraces to find subscription leaks and to disable them both when done. +### `SerializableReactiveProperty` + +`ReactiveProperty` can not use on `[SerializeField]`. However you can use `SerializableReactiveProperty` instead. + +```csharp +public class NewBehaviourScript : MonoBehaviour +{ + public SerializableReactiveProperty rpInt; + public SerializableReactiveProperty rpLong; + public SerializableReactiveProperty rpByte; + public SerializableReactiveProperty rpFloat; + public SerializableReactiveProperty rpDouble; + public SerializableReactiveProperty rpString; + public SerializableReactiveProperty rpBool; + public SerializableReactiveProperty rpVector2; + public SerializableReactiveProperty rpVector2Int; + public SerializableReactiveProperty rpVector3; + public SerializableReactiveProperty rpVector3Int; + public SerializableReactiveProperty rpVector4; + public SerializableReactiveProperty rpColor; + public SerializableReactiveProperty rpRect; + public SerializableReactiveProperty rpBounds; + public SerializableReactiveProperty rpBoundsInt; + public SerializableReactiveProperty rpQuaternion; + public SerializableReactiveProperty rpMatrix4x4; + public SerializableReactiveProperty rpEnum; + public SerializableReactiveProperty rpFlagsEnum; +} +``` + +![image](https://github.com/Cysharp/R3/assets/46207/31be9378-846e-4635-8cc6-0b6e3954e918) + ### Godot Godot support is for Godot 4.x. diff --git a/src/R3.Unity/Assets/R3.Unity/Runtime/SerializableReactiveProperty.cs b/src/R3.Unity/Assets/R3.Unity/Runtime/SerializableReactiveProperty.cs index 2044593b..480cf457 100644 --- a/src/R3.Unity/Assets/R3.Unity/Runtime/SerializableReactiveProperty.cs +++ b/src/R3.Unity/Assets/R3.Unity/Runtime/SerializableReactiveProperty.cs @@ -49,11 +49,11 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten if (p.propertyType == SerializedPropertyType.Quaternion) { label.text += "(EulerAngles)"; - EditorGUI.PropertyField(position, p, label, false); + EditorGUI.PropertyField(position, p, label, true); } else { - EditorGUI.PropertyField(position, p, label, false); + EditorGUI.PropertyField(position, p, label, true); } }