public void ActivateHotKeySkill(int index) { PanelSkill panel = playerSkillController.skillPanel.transform.GetChild(index).GetComponent <PanelSkill>(); if (panel.playerSkill != null) { if (!(panel.playerSkill.cooldownRemain > 0)) //!playerSkillController.SkillsThatAreOnCooldown.Exists(aSkill => aSkill.skill.skillID == panel.cooldownSkill.skill.skillID)) { //playerSkillController.SkillsThatAreOnCooldown.Add(panel.cooldownSkill); if (player.CurrentMana > panel.playerSkill.skillMana) { playerSkillController.UsingSkill = panel.playerSkill; UIEventHandler.SkillUsed(); if (panel.playerSkill.skillType == Skill.SkillType.Active || panel.playerSkill.skillType == Skill.SkillType.Utility) { PerformChannel(panel.playerSkill); } else { PerformSkill(); } } else { EventNotifier.Instance.MakeEventNotifier("Not enough Mana!"); } } else { EventNotifier.Instance.MakeEventNotifier("Skill on cooldown!"); } } }
public void SetupPanelSkillPrefab(PanelSkill currentSkill) { _panelSkill = currentSkill; PanelSkillID = _panelSkill.SkillID; SkillImg.sprite = _panelSkill.SkillImg; SkillCDText.text = _panelSkill.SkillCDText; _timerCD = _panelSkill.TimerCD; }
private void AddButtons() { for (int i = 0; i < SkillList.Count; i++) { PanelSkill item = SkillList[i]; GameObject newPanelSkill = Instantiate(SkillPrefab, ParentPanel); PanelSkillPrefab panelShopSkillPrefab = newPanelSkill.GetComponent <PanelSkillPrefab>(); panelShopSkillPrefab.SetupPanelSkillPrefab(item); } }
public void HotKeyDeletePress(Transform self) { SoundDatabase.PlaySound(21); int selfIndex = self.GetSiblingIndex(); PanelSkill panelSkill = hotSkillPanel.transform.GetChild(selfIndex).GetComponent <PanelSkill>(); panelSkill.cooldownCircle.fillAmount = 0; panelSkill.playerSkill = null; panelSkill.UpdateImage(); }
public void HotkeyAssignPress(Transform self) { SoundDatabase.PlaySound(32); int selfIndex = self.GetSiblingIndex(); PanelSkill panelSkill = hotSkillPanel.transform.GetChild(selfIndex).GetComponent <PanelSkill>(); panelSkill.playerSkill = currentSkill; panelSkill.UpdateImage(); hotkeyAssign.SetActive(!hotkeyAssign.activeInHierarchy); }