public void SetActiveAbility(IActiveAbility abilityObject) { associatedAbility = abilityObject; if (associatedAbility.CanBeUsed()) { image.material = null; activatable = true; } else { image.material = grayscaleMaterial; } }
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 }); } } }