Esempio n. 1
0
 //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();
         }
     }
 }
Esempio n. 2
0
 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();
         }
     }
 }