spell refactor part 2
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,12 @@ namespace Beyond
|
||||
// Start is called before the first frame update
|
||||
private void Start()
|
||||
{
|
||||
baseStepController.ConditionsAreMet += () => magicAttacks.selectedEffect.secondaryName == "Covert Gaze ";
|
||||
// [FIX] Checked the equipped item name instead of 'selectedEffect'
|
||||
baseStepController.ConditionsAreMet += () =>
|
||||
{
|
||||
var item = magicAttacks.GetEquippedSpellItem();
|
||||
return item != null && item.name.Contains("Covert Gaze");
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user