#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 float SharedVariable by name.")] [Shared.Utility.Category("Variables")] public class SetFloatVariable : SetVariableBase { [Tooltip("The name of the float SharedVariable.")] [SerializeField] protected SharedVariable m_VariableName; [Tooltip("The float 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 = 0f; } } } #endif