private bool IsIntentAttackingMe(AbstractIntent intent, AbstractBattleUnit unitBeingAttacked) { if (intent is SingleUnitAttackIntent) { var singleUnitAttack = intent as SingleUnitAttackIntent; if (singleUnitAttack.Target == unitBeingAttacked) { return(true); } } return(false); }
public void Show(AbstractIntent intent, string text) { textComponent.text = text; //Remove any action that was given to the button before button.onClick.RemoveAllListeners(); //And give it a new action: executing the given intent button.onClick.AddListener(() => { intent.Execute(); Close(); } ); gameObject.SetActive(true); }
public void Notify(AbstractIntent intent, string contentKey) { popup.Show(intent, contentKey); }