InteractionController.Interact C# (CSharp) Method

Interact() public method

public Interact ( ArrayList list ) : bool
list ArrayList
return bool
    public bool Interact(ArrayList list)
    {
        bool val = false;
        if(!interacting && GameHandler.IsControlField())
        {
            for(int i=0; i<list.Count; i++)
            {
                if(list[i] != null)
                {
                    BaseInteraction[] interactions = ((GameObject)list[i]).GetComponents<BaseInteraction>();
                    foreach(BaseInteraction interaction in interactions)
                    {
                        if(interaction != null && interaction.enabled &&
                            EventStartType.INTERACT.Equals(interaction.startType))
                        {
                            StartCoroutine(BlockInteraction());
                            val = interaction.Interact();
                            if(val) return val;
                        }
                    }
                }
            }
        }
        return val;
    }

Usage Example

 public void Interact(GameObject interactor, Interaction interaction)
 {
     Debug.Log("Interactor: " + interactor.name);
     Debug.Log("Interaction: " + interaction.name);
     Debug.Log("Interactable: " + gameObject.name);
     _interactionController.Interact(interactor, interaction);
 }
All Usage Examples Of InteractionController::Interact