mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-30 15:33:44 +00:00
Working magnet and crane AI
This commit is contained in:
26
Assets/Scripts/EnterTriggerSender.cs
Normal file
26
Assets/Scripts/EnterTriggerSender.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class EnterTriggerSender : MonoBehaviour
|
||||
{
|
||||
public UnityEvent onEnterEvent;
|
||||
public UnityEvent onExitEvent;
|
||||
|
||||
public Collider triggeredCollider;
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
Debug.Log("Entered: " + other.name);
|
||||
triggeredCollider = other;
|
||||
onEnterEvent.Invoke();
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
Debug.Log("Exited: " + other.name);
|
||||
triggeredCollider = other;
|
||||
onExitEvent.Invoke();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user