Skip to content

Commit 0930bc0

Browse files
committed
feat: override target value in Axis
1 parent 727e9fc commit 0930bc0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Runtime/Scripts/Components/Axis.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace OC.Components
77
[SelectionBase]
88
[DisallowMultipleComponent]
99
[DefaultExecutionOrder(1000)]
10-
public class Axis : Actor, IInteractable
10+
public class Axis : Actor, IInteractable, ICustomInspector
1111
{
1212
public Actor Actor
1313
{
@@ -91,7 +91,15 @@ private void LateUpdate()
9191

9292
private void LocalUpdate(float deltaTime)
9393
{
94-
if (_isActorValid) Target.Value = _actor.Value.Value;
94+
if (_override)
95+
{
96+
Target.Value = _target;
97+
}
98+
else if (_isActorValid)
99+
{
100+
Target.Value = _actor.Value.Value;
101+
}
102+
95103
_value.Value = _target.Value * _factor;
96104

97105
switch (_controlMode)

0 commit comments

Comments
 (0)