Summoner
This commit is contained in:
33
Assets/AI/_Summoner/DEC_ShouldCastSpell.cs
Normal file
33
Assets/AI/_Summoner/DEC_ShouldCastSpell.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Invector.vCharacterController.AI.FSMBehaviour;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DemonBoss.Summoner
|
||||
{
|
||||
/// <summary>
|
||||
/// FSM Decision: should Summoner cast a ranged spell
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Invector/FSM/Decisions/Summoner/Should Cast Spell")]
|
||||
public class DEC_ShouldCastSpell : vStateDecision
|
||||
{
|
||||
public override string categoryName => "Summoner";
|
||||
public override string defaultName => "Should Cast Spell";
|
||||
|
||||
[Header("Debug")]
|
||||
[Tooltip("Enable debug logging")]
|
||||
public bool enableDebug = false;
|
||||
|
||||
public override bool Decide(vIFSMBehaviourController fsmBehaviour)
|
||||
{
|
||||
var summoner = fsmBehaviour.gameObject.GetComponent<SummonerAI>();
|
||||
if (summoner == null)
|
||||
{
|
||||
if (enableDebug) Debug.LogWarning("[DEC_ShouldCastSpell] No SummonerAI component found!");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool canCast = summoner.CanCastSpell();
|
||||
if (enableDebug) Debug.Log($"[DEC_ShouldCastSpell] canCast={canCast}");
|
||||
return canCast;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user