protected void SpellSlotActivated(int slotNumber) { if (selectedHero != null) { var spellSlot = selectedHero.GetSpellSlots()[slotNumber]; if (!spellSlot.CheckCastPossibility()) return; activeSpell = spellSlot; if (spellSlot.data.type == SpellTypes.TARGET) { OnPreparationTargetSignal.Dispatch(); } else { OnPreparationAreaSignal.Dispatch((spellSlot.data as MeteorData).range); } } }
public void Initialize(HeroContext heroParam, HeroModel heroModelParam, SpellSlot slotParam, string icon) { slot = slotParam; Level = slot.level; Icon = icon; Parent = heroParam; heroModel = heroModelParam; slot.OnStartCooldown += OnStartCooldown; slot.OnEndCooldown += OnEndCooldown; if (slot.Cooldown != null) { IsOnCooldown = true; slot.Cooldown.OnTick += OnTick; } else { IsOnCooldown = false; } }
private void ResetActiveSpell() { activeSpell = null; }