using UnityEngine; using UnityEngine.Serialization; namespace UnityAtoms { /// /// Base class for all SetVariableValue Actions. Inherits from `VoidAction`. /// /// The type of the Variable to set. /// A Variable class of type `type` to set. /// A Constant class of type `type` to set. /// A Reference of type `type`. /// An Event of type `type`. /// An Event x 2 of type `type`. public abstract class SetVariableValue : VoidAction where E1 : AtomEvent where E2 : AtomEvent where V : AtomVariable where C : AtomBaseVariable where R : AtomReference { /// /// The Variable to set. /// [SerializeField] private V _variable = null; /// /// The value to set. /// [SerializeField] private R _value = null; /// /// Perform the action. /// public override void Do() { _variable.Value = _value.Value; } } }