VariableAttribute
Marks a field as an action variable for runtime binding.
Definition
Namespace: Paragon.Core.ActionSystem
Assembly: Paragon.dll
[AttributeUsage(AttributeTargets.Field)]
public class VariableAttribute : OdinSerializeAttributeInheritance: Attribute → OdinSerializeAttribute → VariableAttribute
Remarks
Fields marked with [Variable] are automatically discovered by ActionVariables and can be:
Modified at runtime via
SetVariable<T>()Bound to other variables via the Inspector
Serialized with Odin
Usage
public class MyAction : Action
{
[Variable]
private float duration = 1.0f;
[Variable]
private Transform target;
[Variable]
private AnimationCurve curve;
protected override async Task OnExecute()
{
// Use variables...
await Yield.WaitForSeconds(duration);
}
}See Also
Last updated
Was this helpful?