IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/GameObject/HasComponent.cs

17 lines
350 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.Conditions
{
[Category("GameObject")]
public class HasComponent<T> : ConditionTask<Transform> where T : Component
{
protected override bool OnCheck() {
return agent.GetComponent<T>() != null;
}
}
}