IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Actions/Blackboard/DecomposeVector.cs

33 lines
861 B
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions
{
[Category("✫ Blackboard")]
[Description("Create up to 3 floats from a Vector and save them to blackboard")]
public class DecomposeVector : ActionTask
{
public BBParameter<Vector3> targetVector;
[BlackboardOnly]
public BBParameter<float> x;
[BlackboardOnly]
public BBParameter<float> y;
[BlackboardOnly]
public BBParameter<float> z;
protected override string info {
get { return "Decompose Vector " + targetVector; }
}
protected override void OnExecute() {
x.value = targetVector.value.x;
y.value = targetVector.value.y;
z.value = targetVector.value.z;
EndAction();
}
}
}