private void Update() { if (allowOrbitWhileZooming != AllowOrbitWhileZooming) { allowOrbitWhileZooming = AllowOrbitWhileZooming; if (allowOrbitWhileZooming) { scaleGesture.AllowSimultaneousExecution(panGesture); } else { scaleGesture.DisallowSimultaneousExecution(panGesture); } } }
private void Update() { if (allowOrbitWhileZooming != AllowOrbitWhileZooming) { allowOrbitWhileZooming = AllowOrbitWhileZooming; if (allowOrbitWhileZooming) { scaleGesture.AllowSimultaneousExecution(panGesture); } else { scaleGesture.DisallowSimultaneousExecution(panGesture); } } scaleGesture.ZoomSpeed = ZoomSpeed; UpdateOrbit(panVelocity.x, panVelocity.y); panVelocity = panVelocity * OrbitInertia; }
protected virtual void LateUpdate() { if (allowOrbitWhileZooming != AllowOrbitWhileZooming) { allowOrbitWhileZooming = AllowOrbitWhileZooming; if (allowOrbitWhileZooming) { scaleGesture.AllowSimultaneousExecution(panGesture); } else { scaleGesture.DisallowSimultaneousExecution(panGesture); } } Vector3 startPos = Orbiter.transform.position; UpdateOrbit(panVelocity.x, panVelocity.y); UpdateZoom(); ClampDistance(startPos); panVelocity *= OrbitInertia; zoomSpeed *= OrbitInertia; }