//used by the player to interact with game entities public virtual void Interact() { //calls interact method in all interactable traits TraitBase[] traits = GetArray(); for (int i = 0; i < traits.Length; i++) { if (traits[i] is IInteractCallable) { IInteractCallable interactCallable = (IInteractCallable)traits[i]; interactCallable.CallInteract(); } } }
public virtual void Interact() { if (SendAction == null) { return; } SendAction(this); TraitBase[] traits = GetArray(); for (int i = 0; i < traits.Length; i++) { if (traits[i] is IInteractCallable) { IInteractCallable interactCallable = (IInteractCallable)traits[i]; interactCallable.CallInteract(); } } }