Files
Cielonos/Packages/com.opsive.behaviordesigner/Runtime/Tasks/Actions/Math/SetVector2.cs

35 lines
1.3 KiB
C#
Raw Normal View History

2025-11-25 08:19:33 -05:00
#if GRAPH_DESIGNER
/// ---------------------------------------------
/// Behavior Designer
/// Copyright (c) Opsive. All Rights Reserved.
/// https://www.opsive.com
/// ---------------------------------------------
2026-05-10 11:47:55 -04:00
namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Variables
2025-11-25 08:19:33 -05:00
{
using Opsive.GraphDesigner.Runtime;
using Opsive.GraphDesigner.Runtime.Variables;
using UnityEngine;
2026-05-10 11:47:55 -04:00
using UnityEngine.Scripting.APIUpdating;
2025-11-25 08:19:33 -05:00
[Opsive.Shared.Utility.Description("Set the Vector2 value.")]
2026-05-10 11:47:55 -04:00
[Shared.Utility.Category("Variables")]
[MovedFrom(false, "Opsive.BehaviorDesigner.Runtime.Tasks.Actions.Math", "Opsive.BehaviorDesigner.Runtime", "SetVector2")]
2025-11-25 08:19:33 -05:00
public class SetVector2 : Action
{
[Tooltip("The Vector2 value to set.")]
[SerializeField] protected SharedVariable<Vector2> m_Value;
[Tooltip("The variable that should be set.")]
[RequireShared] [SerializeField] protected SharedVariable<Vector2> m_StoreResult;
/// <summary>
/// Executes the task.
/// </summary>
/// <returns>The execution status of the task.</returns>
public override TaskStatus OnUpdate()
{
m_StoreResult.Value = m_Value.Value;
return TaskStatus.Success;
}
}
}
#endif