Liberi
An exergame built for kids with CP!
RemoteTrigger.cs
1 using UnityEngine;
2 using System;
3 using System.Linq;
4 using System.Collections.Generic;
5 using Janus;
6 
7 public delegate void RemoteTriggerHandler(GameObject source, GameObject trigger);
8 
13 [AddComponentMenu("Liberi/Remote Trigger")]
14 public class RemoteTrigger : MonoBehaviour
15 {
16  public event RemoteTriggerHandler Triggered;
17  public event RemoteTriggerHandler Untriggered;
18 
19  void OnCollisionEnter(Collision collision)
20  {
21  if (Triggered != null)
22  Triggered(collision.gameObject, gameObject);
23  }
24 
25  void OnTriggerEnter(Collider other)
26  {
27  if (Triggered != null)
28  Triggered(other.gameObject, gameObject);
29  }
30 
31  void OnCollisionExit(Collision collision)
32  {
33  if (Untriggered != null)
34  Untriggered(collision.gameObject, gameObject);
35  }
36 
37  void OnTriggerExit(Collider other)
38  {
39  if (Untriggered != null)
40  Untriggered(other.gameObject, gameObject);
41  }
42 }
This component is mostly replaced by logic scripts and Vital/Hitter interactions. It's kind of reduna...