match3/Assets/Resources/Scripts/Feeler.cs

21 lines
338 B
C#
Raw Normal View History

2015-08-27 05:09:43 +00:00
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> ());
}
}
}