Skip to content

Commit 4ef0322

Browse files
committed
feat: added value setter
1 parent 9c5e507 commit 4ef0322

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Runtime/SerializableInterface.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ public TInterface Value
2626
_ => throw new ArgumentOutOfRangeException()
2727
};
2828
}
29+
set
30+
{
31+
if (value is UnityEngine.Object unityObject)
32+
{
33+
rawReference = null;
34+
unityReference = unityObject;
35+
mode = ReferenceMode.Unity;
36+
}
37+
else
38+
{
39+
unityReference = null;
40+
rawReference = value;
41+
mode = ReferenceMode.Raw;
42+
}
43+
}
2944
}
3045

3146
/// <inheritdoc />

0 commit comments

Comments
 (0)