void updateScrubbers(manipulator m) { if (manips[m].trigger && manips[m].colliding && m.emptyGrab) { scrubberCandidate = scrubberActive = manips[m]; player.grabScrub(true); } else { player.grabScrub(false); } }
void OnCollisionExit(Collision coll) { manipulator m = coll.transform.GetComponent <manipulator>(); if (m == null) { return; } if (manips.ContainsKey(m)) { manips[m].colliding = false; if (scrubberCandidate == manips[m]) { scrubberCandidate = null; scrubIndicator.gameObject.SetActive(false); } } }
void OnCollisionEnter(Collision coll) { manipulator m = coll.transform.GetComponent <manipulator>(); if (m == null) { return; } if (manips.ContainsKey(m)) { manips[m].colliding = true; } else { manips[m] = new scrubber(m.transform, m.triggerDown, true); } m.hapticPulse(); { scrubberCandidate = manips[m]; scrubIndicator.gameObject.SetActive(true); } }