예제 #1
0
 private bool IsIntentAttackingMe(AbstractIntent intent, AbstractBattleUnit unitBeingAttacked)
 {
     if (intent is SingleUnitAttackIntent)
     {
         var singleUnitAttack = intent as SingleUnitAttackIntent;
         if (singleUnitAttack.Target == unitBeingAttacked)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
    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);
    }
예제 #3
0
 public void Notify(AbstractIntent intent, string contentKey)
 {
     popup.Show(intent, contentKey);
 }