Skip to content

Commit 7555ed6

Browse files
committed
Add functions to set value
1 parent b29d770 commit 7555ed6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Runtime/Variables/ValueReference.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,26 @@ public ValueReference(TVariable variable)
7474
this.variable = variable;
7575
}
7676

77+
/// <summary>
78+
/// Switches to use a fixed value and assigns the provided value.
79+
/// </summary>
80+
/// <param name="value">The fixed value to use.</param>
81+
public void SetFixedValue(TValue value)
82+
{
83+
useVariable = false;
84+
fixedValue = value;
85+
}
86+
87+
/// <summary>
88+
/// Switches to use a variable reference and assigns the provided variable.
89+
/// </summary>
90+
/// <param name="variable">The variable reference to use.</param>
91+
public void SetVariable(TVariable variable)
92+
{
93+
useVariable = true;
94+
this.variable = variable;
95+
}
96+
7797
}
7898

7999
}

0 commit comments

Comments
 (0)