#if GRAPH_DESIGNER /// --------------------------------------------- /// Behavior Designer /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Variables { using Opsive.GraphDesigner.Runtime; using Opsive.GraphDesigner.Runtime.Variables; using UnityEngine; [Opsive.Shared.Utility.Description("Sets the value of a Vector2 SharedVariable by name.")] [Shared.Utility.Category("Variables")] public class SetVector2Variable : SetVariableBase { [Tooltip("The name of the Vector2 SharedVariable.")] [SerializeField] protected SharedVariable m_VariableName; [Tooltip("The Vector2 value to set.")] [SerializeField] protected SharedVariable m_Value; /// /// Executes the task. /// /// The execution status of the task. public override TaskStatus OnUpdate() { SetVariableValue(m_VariableName, m_Value.Value); return TaskStatus.Success; } /// /// Resets the task values back to their default. /// public override void Reset() { base.Reset(); m_VariableName = ""; m_Value = Vector2.zero; } } } #endif