Execute() public abstract method

public abstract Execute ( GameObject actor, GameObject opponent ) : void
actor UnityEngine.GameObject
opponent UnityEngine.GameObject
return void
Example #1
0
        public override void Execute(GameObject actor, GameObject opponent)
        {
            GameObject actualOwner = Owner == Owner.Actor ? actor : opponent;
            Inventory  inventory   = actualOwner.GetComponent <Inventory>();

            if (inventory == null)
            {
                Debug.LogErrorFormat("can't find inventory on {0} gameObject ", actualOwner.name, actualOwner);
            }
            else
            {
                if (inventory.HasItem(Item))
                {
                    if (Yes != null)
                    {
                        Yes.Execute(actor, opponent);
                    }
                }
                else
                {
                    if (No != null)
                    {
                        No.Execute(actor, opponent);
                    }
                }
            }
        }
Example #2
0
 void ExecuteNodeIfNotNull(DialogueNode node, GameObject actor, GameObject opponent)
 {
     if (node != null)
     {
         node.Execute(actor, opponent);
     }
 }
Example #3
0
 public override void Execute(GameObject actor, GameObject opponent)
 {
     UIController.Instance.ShowSingleButton(Caption, () => {
         if (NextStep != null)
         {
             NextStep.Execute(actor, opponent);
         }
     });
 }
Example #4
0
        public override void Execute(GameObject actor, GameObject opponent)
        {
            string actorName = Owner == Owner.Actor ? actor.name : opponent.name;

            UIController.Instance.ShowText(actorName, Text, () => {
                if (NextStep != null)
                {
                    NextStep.Execute(actor, opponent);
                }
            });
        }
Example #5
0
        public override void Execute(GameObject actor, GameObject opponent)
        {
            GameObject actualOwner = Owner == Owner.Actor ? actor : opponent;
            Inventory  inventory   = actualOwner.GetComponent <Inventory>();

            if (inventory == null)
            {
                Debug.LogErrorFormat("can't find inventory on {0} gameObject ", actualOwner.name, actualOwner);
            }
            else
            {
                inventory.AddItem(ItemType, ItemNumber);
            }
            if (NextStep != null)
            {
                NextStep.Execute(actor, opponent);
            }
        }
Example #6
0
        public override void Execute(GameObject actor, GameObject opponent)
        {
            GameObject           actualOwner = Owner == Owner.Actor ? actor : opponent;
            RunCommandController commands    = actualOwner.GetComponent <RunCommandController>();

            if (commands == null)
            {
                Debug.LogError("Cant find InteractableObjects on the object", actualOwner);
            }
            else
            {
                commands.RunCommand(CommandKey);
                if (NextStep != null)
                {
                    NextStep.Execute(actor, opponent);
                }
            }
        }
 void ExecuteNodeIfNotNull(DialogueNode node, GameObject actor, GameObject opponent)
 {
     if (node!=null){
         node.Execute(actor, opponent);
     }
 }