Files
beyond/Assets/Scripts/Tutorial/QuantaCastStep.cs

30 lines
958 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Beyond
{
public class QuantaCastStep : MonoBehaviour
{
public MagicAttacks magicAttacks;
public BaseStepController baseStepController;
// Start is called before the first frame update
private void Start()
{
// [FIX] magicAttacks.isPlaying is private.
// We check the animator directly for the "Spell" tag or state.
baseStepController.ConditionsAreMet += CheckIsPlaying;
}
private bool CheckIsPlaying()
{
var animator = magicAttacks.GetComponent<Animator>();
if (animator == null) return false;
// Assuming layer 5 is spells (from your MagicAttacks constants)
var state = animator.GetCurrentAnimatorStateInfo(5);
return state.IsTag("Spell") || state.IsTag("special");
}
}
}