コード例 #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);
 }