added: enemy target acquisition, better pathfinding, moved combat reference to unit
This commit is contained in:
35
Assets/Scripts/Units/Graph Tasks/CheckIfSpawnmate.cs
Normal file
35
Assets/Scripts/Units/Graph Tasks/CheckIfSpawnmate.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Reset.Units {
|
||||
[Category("Reset/Units")]
|
||||
[Description("Returns true if this unit is in the same spawn group as the provided value.")]
|
||||
public class CheckIfSpawnmate : ConditionTask<Enemy>{
|
||||
protected override string info{ get => $"{target} is spawnmate"; }
|
||||
|
||||
public BBParameter<GameObject> target;
|
||||
|
||||
//Use for initialization. This is called only once in the lifetime of the task.
|
||||
//Return null if init was successfull. Return an error string otherwise
|
||||
protected override string OnInit(){
|
||||
return null;
|
||||
}
|
||||
|
||||
//Called whenever the condition gets enabled.
|
||||
protected override void OnEnable() {
|
||||
|
||||
}
|
||||
|
||||
//Called whenever the condition gets disabled.
|
||||
protected override void OnDisable() {
|
||||
|
||||
}
|
||||
|
||||
//Called once per frame while the condition is active.
|
||||
//Return whether the condition is success or failure.
|
||||
protected override bool OnCheck(){
|
||||
return agent.relatedSpawner.enemies.Contains(target.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user