public abstract Execute ( |
||
actor | ||
opponent | ||
Résultat | void |
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); } } } }
void ExecuteNodeIfNotNull(DialogueNode node, GameObject actor, GameObject opponent) { if (node != null) { node.Execute(actor, opponent); } }
public override void Execute(GameObject actor, GameObject opponent) { UIController.Instance.ShowSingleButton(Caption, () => { if (NextStep != null) { NextStep.Execute(actor, opponent); } }); }
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); } }); }
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); } }
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); } }