Skip to content

Commit acaabf2

Browse files
Make Transform reset on signal release
1 parent 18e047a commit acaabf2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

UnityMapper/Builtin/Transform.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public List<IBoundProperty> ExtractProperties(Transform component)
1818

1919
internal class BoundPosition(Transform transform) : IBoundProperty
2020
{
21+
private Vector3 originalPos = transform.position;
22+
2123
public void SetObject(object val)
2224
{
2325
var value = (Single[])val;
@@ -45,6 +47,11 @@ public string GetName()
4547

4648
public string? Units => "m";
4749
public (float min, float max)? Bounds => null;
50+
51+
public void Reset()
52+
{
53+
transform.position = originalPos;
54+
}
4855
}
4956
internal class BoundScale(Transform transform) : IBoundProperty
5057
{

0 commit comments

Comments
 (0)