Exemple #1
0
 public void SetChargesText(AbilityIndicator indicator, int chargeNum)
 {
     if (chargeNum <= 1)
     {
         indicator.ChargesText.text = "";
         return;
     }
     else
     {
         indicator.ChargesText.text = chargeNum.ToString();
     }
 }
Exemple #2
0
        public void SetAbilityIcon(Ability ability, AbilityIndicator abilityIndicator)
        {
            // Set Image
            Dictionary <System.Type, string> abilityToImageMapping = new Dictionary <System.Type, string>()
            {
                { typeof(BlinkAbility), "BlinkIcon" },
                { typeof(ReviveProjectileAbility), "ReviveProjectile" }
            };

            string iconPath = "UI/Abilities/";

            System.Type abilityType = ability.GetType();
            string      spritename  = abilityToImageMapping[abilityType];

            abilityIndicator.AbilityImage.sprite = Resources.Load <Sprite>(iconPath + spritename);
        }