Пример #1
0
 public void SetActiveAbility(IActiveAbility abilityObject)
 {
     associatedAbility = abilityObject;
     if (associatedAbility.CanBeUsed())
     {
         image.material = null;
         activatable    = true;
     }
     else
     {
         image.material = grayscaleMaterial;
     }
 }
Пример #2
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Left && belongsToActiveUnit && activatable)
     {
         if (isSelected)
         {
             EventBus.FireEvent <AbilityDeselectedEvent>();
         }
         else if (associatedAbility.CanBeUsed())
         {
             frameImage.gameObject.SetActive(true);
             isSelected = true;
             EventBus.FireEvent <AbilitySelectedEvent>(new AbilitySelectedEvent()
             {
                 Ability = associatedAbility
             });
         }
     }
 }