spell refactor part - assets and prefabs
This commit is contained in:
@@ -12,12 +12,19 @@ namespace Beyond
|
||||
// Start is called before the first frame update
|
||||
private void Start()
|
||||
{
|
||||
baseStepController.ConditionsAreMet += () => magicAttacks.isPlaying;
|
||||
// [FIX] magicAttacks.isPlaying is private.
|
||||
// We check the animator directly for the "Spell" tag or state.
|
||||
baseStepController.ConditionsAreMet += CheckIsPlaying;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
private void Update()
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user