IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Actions/GameObject/FindWithName.cs

28 lines
630 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("GameObject")]
public class FindWithName : ActionTask
{
[RequiredField]
public BBParameter<string> gameObjectName;
[BlackboardOnly]
public BBParameter<GameObject> saveAs;
protected override string info {
get { return "Find Object " + gameObjectName + " as " + saveAs; }
}
protected override void OnExecute() {
saveAs.value = GameObject.Find(gameObjectName.value);
EndAction();
}
}
}