void OnTriggerExit(Collider other) { Debug.Log("Trigger exit"); if (other.gameObject.GetComponent <adjustable>() != null) { other.GetComponent <adjustable>().onPullEnd(this.transform.position); } potentialAdjust = null; }
void OnTriggerEnter(Collider other) { if (other.tag == "Adjustable") { Debug.Log("Can adjust"); if (potentialAdjust != null) { potentialAdjust.onPullEnd(this.transform.position); } potentialAdjust = other.GetComponent <adjustable>(); } }
// Use this for initialization void Start() { potentialAdjust = null; trackedObj = GetComponent <SteamVR_TrackedObject>(); }