void OnTriggerEnter(Collider coll) { if (coll.CompareTag("Player")) { coll.material = coll.GetComponent <TransformController>().currentTransform.transformPhysicMaterial; BallController ball = coll.GetComponent <BallController>(); ball.GetComponent <TransformController>().currentTransform.EnablePhysicalModifiers(ball); ball.ResetMovementModifiersToDefaults(); ball.GetComponent <LightsController>().TurnLightOff(); ball.allowBrakeLocks = true; cameraRig.removeAngleConstraint(); cameraRig.resetNeutralTilt(); } }
void OnTriggerExit(Collider coll) { if (resetOnExit && coll.CompareTag("Player")) { if (camLock || hardReset) { cameraRig.removeAngleConstraint(); } if (camTilt || hardReset) { cameraRig.resetNeutralTilt(resetTiltTime); } if (camZoom || hardReset) { cameraRig.zoomCamera(-camZoomAmount, resetZoomTime); } } }