private void SetupButton(Button button, SkillKindId skill) { button.onClick.AddListener(() => DoSelect(skill)); var text = button.GetComponentInChildren <Text>(); text.text = GameBalance.SkillPower[skill][_wordIdx].ToString("0.##"); }
private void DoSelect(SkillKindId skillId) { if (_selected == skillId) { return; } OnSelect?.Invoke(_wordIdx, skillId); _selected = skillId; UpdateSelected(); }
public void SetSkill(SkillKindId skill) { Color color; switch (skill) { case SkillKindId.Aoe: color = Color.green; break; case SkillKindId.Freeze: color = Color.blue; break; case SkillKindId.Heal: color = Color.red; break; default: throw new ArgumentOutOfRangeException(nameof(skill), skill, null); } GetComponent <Image>().color = color; }
public static void SetSkill(int wordLen, SkillKindId skillId) { SkillLayout[wordLen] = skillId; PlayerPrefs.SetInt("word_" + wordLen, (int)skillId); PlayerPrefs.Save(); }
public void Setup(int wordIdx, SkillKindId selected) { _wordIdx = wordIdx; _selected = selected; }
private void LineOnOnSelect(int word, SkillKindId skillId) { Marks[word - 3].SetSkill(skillId); GameBalance.SetSkill(word, skillId); }