private void OnTriggerExit(Collider other) { if (isHitted && GF != null && other.gameObject.GetComponent <GloveFollowing>().m_controller.Equals(GF.m_controller)) { exitPosition = GF.RelativePosition(); int hitValue = PunchRecognition(exitPosition - enterPosition, GF.gameObject.name); if (hitValue != 0) { StartCoroutine(TriggerVibration(GF.m_controller)); switch (status) { case 1: tutorialPunchDetection(hitValue); break; case 2: practicePunchDetection(hitValue); break; case 3: testPunchDetection(hitValue); break; default: StartCoroutine(BagBouncing(hitValue, true, 0)); break; } } isHitted = false; GF = null; } }
private void OnTriggerEnter(Collider other) { if (!isHitted) { isHitted = true; GF = other.gameObject.GetComponent <GloveFollowing>(); enterPosition = GF.RelativePosition(); } }