public void addSkill(SkillsNames skillname) { if (showSkills.Length > skillsQueue.Count) { // skillsQueue.Enqueue(skillname); switch (skillname) { case SkillsNames.Freeze: // AddSpriteSkill(0); AddToQueue(0, skillname); break; case SkillsNames.Wind: AddToQueue(1, skillname); break; case SkillsNames.Stone: AddToQueue(2, skillname); break; case SkillsNames.Fly: AddToQueue(3, skillname); break; case SkillsNames.SmallSize: AddToQueue(4, skillname); break; default: break; } } }
public void SetSkillToQueue(SkillsNames skillname, Sprite sprite) { if (!checkUnenablePosSkill(queueValue)) { GameManager.Instance.state.skillsOnStart[queueValue] = skillname; skillListPanel.transform.GetChild(queueValue).GetChild(0).GetComponent <Image>().sprite = sprite; skillListPanel.transform.GetChild(queueValue).GetChild(0).GetComponent <RectTransform>().localScale = scaleSprite; } }
private void AddToQueue(int skillSpriteNumber, SkillsNames skillname) { skillsQueue.Enqueue(skillname); showSkills[skillsQueue.Count - 1].GetComponent <Image>().sprite = skillSprites[skillSpriteNumber]; }