match3/Assets/Resources/Scripts/Feeler.cs
2015-08-27 01:09:43 -04:00

21 lines
338 B
C#

using UnityEngine;
using System.Collections;
public class Feeler : MonoBehaviour {
public Gem owner;
void OnTriggerEnter(Collider c){
if (c.tag == "Gem") {
owner.AddNeighbor (c.GetComponent<Gem> ());
}
}
void OnTriggerExit(Collider c){
if (c.tag == "Gem") {
owner.RemoveNeighbor (c.GetComponent<Gem> ());
}
}
}