This commit is contained in:
CortexCore
2024-11-03 16:42:23 +08:00
commit b125894cc3
5904 changed files with 1070129 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions
{
[Category("GameObject")]
public class GetComponent<T> : ActionTask<Transform> where T : Component
{
[BlackboardOnly]
public BBParameter<T> saveAs;
protected override string info {
get { return string.Format("Get {0} as {1}", typeof(T).Name, saveAs.ToString()); }
}
protected override void OnExecute() {
var o = agent.GetComponent<T>();
saveAs.value = o;
EndAction(o != null);
}
}
}