first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace NodeCanvas.Tasks.Actions
|
||||
{
|
||||
|
||||
[Category("GameObject")]
|
||||
public class GetDistance : ActionTask<Transform>
|
||||
{
|
||||
|
||||
[RequiredField]
|
||||
public BBParameter<GameObject> target;
|
||||
[BlackboardOnly]
|
||||
public BBParameter<float> saveAs;
|
||||
|
||||
protected override string info {
|
||||
get { return string.Format("Get Distance to {0}", target.ToString()); }
|
||||
}
|
||||
|
||||
protected override void OnExecute() {
|
||||
|
||||
saveAs.value = Vector3.Distance(agent.position, target.value.transform.position);
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user