using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class Collider_detect : MonoBehaviour
{
    public UnityEvent UnityEvent = new UnityEvent();
    
 private bool touchingDock = false;
 
 public GameObject Player;
    
     void OnCollisionEnter(Collision collision) {
        GameObject otherObj = collision.gameObject;
        Debug.Log("Collided with: " + otherObj);
        UnityEvent.Invoke();
    }
 
    void OnTriggerEnter(Collider collider) {
        GameObject otherObj = collider.gameObject;
        Debug.Log("Triggered with: " + otherObj);
        UnityEvent.Invoke();
    }
    
}   
    
    
     // Update is called once per frame
     
     
     
     /*void Update () {
          //check for player's collision with game object tagged Dock
          if (touchingDock){
          UnityEvent.Invoke(); 
          }      
         }
  
     void OnTriggerEnter(Collider other) {
         if (other.tag == "Doorbell") {
            touchingDock = true; 
         }
     }
     
     void OnTriggerExit(Collider other) {
         if (other.tag == "Doorbell") {
            //touchingDock = false;
         }
     }
  }
  */