public void OnNavigationCanceled(NavigationEventData eventData) { Debug.Log("Navigagion is canceled."); eventData.Use(); //rigidbody.useGravity = true; }
void INavigationHandler.OnNavigationStarted(NavigationEventData eventData) { InputManager.Instance.PushModalInputHandler(gameObject); eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers. if (!isSelected) { inputSource = eventData.InputSource; inputSourceId = eventData.SourceId; Vector3 currentHandPosition = Vector3.zero; InteractionSourceInfo sourceKind; inputSource.TryGetSourceKind(inputSourceId, out sourceKind); switch (sourceKind) { case InteractionSourceInfo.Hand: inputSource.TryGetGripPosition(inputSourceId, out currentHandPosition); break; case InteractionSourceInfo.Controller: inputSource.TryGetPointerPosition(inputSourceId, out currentHandPosition); break; } prevHandPosition = currentHandPosition; } //gameObject.SendMessageUpwards("OnSelect", SendMessageOptions.DontRequireReceiver); }
void INavigationHandler.OnNavigationUpdated(NavigationEventData eventData) { Vector3[] allPoints = new Vector3[line.positionCount + 1]; line.GetPositions(allPoints); float x = gameObject.transform.localPosition.x + eventData.CumulativeDelta.x; float y = gameObject.transform.localPosition.y + eventData.CumulativeDelta.y; float z = gameObject.transform.localPosition.z - 10 + eventData.CumulativeDelta.z; Vector3 newPoint = new Vector3(x, y, z); allPoints[allPoints.Length - 1] = newPoint; line.positionCount = allPoints.Length; line.SetPositions(allPoints); Debug.LogFormat("OnNavigationUpdated\r\nSource: {0} SourceId: {1}\r\nCumulativeDelta: {2} {3} {4}", eventData.InputSource, eventData.SourceId, eventData.NormalizedOffset.x, eventData.NormalizedOffset.y, eventData.NormalizedOffset.z); eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers. }
public void OnNavigationUpdated(NavigationEventData eventData) { InputManager.Instance.PushModalInputHandler(gameObject); GridParent.transform.Rotate(new Vector3(0, eventData.NormalizedOffset.x * -RotationSpeed, 0)); eventData.Use(); }
// Endof InputClickerHandler Event Handler public void OnNavigationStarted(NavigationEventData eventData) { Debug.Log("Navigation is started."); InputManager.Instance.ClearModalInputStack(); InputManager.Instance.PushModalInputHandler(this.gameObject); eventData.Use(); }
public void OnNavigationCompleted(NavigationEventData eventData) { Debug.Log("Navigation is completed."); InputManager.Instance.PopModalInputHandler(); eventData.Use(); //rigidbody.useGravity = true; }
public void OnNavigationCompleted(NavigationEventData eventData) { InputManager.Instance.PopModalInputHandler(); if (!GridParent.transform.GetComponent <WorldAnchor>()) { GridParent.transform.gameObject.AddComponent <WorldAnchor>(); } eventData.Use(); }
// .................................................................... INTERFACE IManipulationHandler public void OnNavigationStarted(NavigationEventData eventData) { if (isTapped) { initialEulerAngles = new Vector3(); InputManager.Instance.PushModalInputHandler(gameObject); eventData.Use(); } }
void INavigationHandler.OnNavigationUpdated(NavigationEventData eventData) { if (InputManager.Instance.CheckModalInputStack(gameObject) && _gesturesManager.IsNavigating) { transform.Rotate(new Vector3(0, eventData.NormalizedOffset.x * -RotationSpeed, 0)); eventData.Use(); } }
public void OnNavigationUpdated(NavigationEventData eventData) { Vector3 movingFactor = eventData.NormalizedOffset * MovingSensitivity * Time.deltaTime; Vector3 nextPos = GetNextPosition(movingFactor); //rigidbody.useGravity = false; this.transform.position += nextPos; eventData.Use(); }
void INavigationHandler.OnNavigationStarted(NavigationEventData eventData) { Debug.LogFormat("OnNavigationStarted\r\nSource: {0} SourceId: {1}\r\nCumulativeDelta: {2} {3} {4}", eventData.InputSource, eventData.SourceId, eventData.NormalizedOffset.x, eventData.NormalizedOffset.y, eventData.NormalizedOffset.z); eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers. }
public void OnNavigationStarted(NavigationEventData eventData) { InputManager.Instance.PushModalInputHandler(gameObject); if (GridParent.transform.GetComponent <WorldAnchor>()) { DestroyImmediate(GridParent.transform.GetComponent <WorldAnchor>()); } eventData.Use(); }
void INavigationHandler.OnNavigationCanceled(NavigationEventData eventData) { if (!_gesturesManager.IsNavigating) { return; } InputManager.Instance.PopModalInputHandler(); transform.rotation = _startRotation; eventData.Use(); }
void INavigationHandler.OnNavigationCompleted(NavigationEventData eventData) { if (!InputManager.Instance.CheckModalInputStack(gameObject) || !_gesturesManager.IsNavigating) { return; } _tileParent.SnapRotation(transform); InputManager.Instance.PopModalInputHandler(); eventData.Use(); }
void INavigationHandler.OnNavigationStarted(NavigationEventData eventData) { UIManager.Instance.SwitchState(UIManager.MenuState.Off); //We also check now if the entity is allowed to be rotated if (!_gesturesManager.IsNavigating || !_tileParent.GridTileCounterpart.Entity.AllowRotation) { return; } InputManager.Instance.PushModalInputHandler(gameObject); _startRotation = transform.rotation; eventData.Use(); }
public void OnNavigationUpdated(NavigationEventData eventData) { InputManager.Instance.PushModalInputHandler(gameObject); Vector3 scale = _startScale * (Mathf.Clamp(1 + eventData.NormalizedOffset.x, 0.2f, 3.0f)); if (scale.x < 0.5f) { scale.x = scale.y = scale.z = 0.8f; } if (scale.x > 3.0f) { scale.x = scale.y = scale.z = 3.0f; } GridParent.transform.localScale = scale; eventData.Use(); }
public void OnNavigationUpdated(NavigationEventData eventData) { float rotationFactor = eventData.NormalizedOffset.x * RotationSensitivity; BoxCollider box = GetComponent <BoxCollider>(); //transform.Rotate(new Vector3(0, -1 * rotationFactor, 0)); transform.RotateAround(box.bounds.center, new Vector3(0, -1, 0), rotationFactor); //float scaleFactor = eventData.NormalizedOffset.x * ScaleSensitivity; //make sure it is not an overflow if (Mathf.Abs(eventData.NormalizedOffset.x) < 1 && Mathf.Abs(eventData.NormalizedOffset.z) < 1) { float newScaleX = transform.localScale.x * (orignalScale + eventData.NormalizedOffset.y * ScaleSensitivity); float newScaleY = transform.localScale.y * (orignalScale + eventData.NormalizedOffset.y * ScaleSensitivity); float newScaleZ = transform.localScale.z * (orignalScale + eventData.NormalizedOffset.y * ScaleSensitivity); transform.localScale = new Vector3(newScaleX, newScaleY, newScaleZ); } //mark the event data to be used, why?? eventData.Use(); }
void INavigationHandler.OnNavigationStarted(NavigationEventData eventData) { InputManager.Instance.PushModalInputHandler(gameObject); eventData.Use(); }
public void OnNavigationCompleted(NavigationEventData eventData) { InputManager.Instance.PopModalInputHandler(); eventData.Use(); }
void INavigationHandler.OnNavigationUpdated(NavigationEventData eventData) { scrollBar.value += eventData.NormalizedOffset.x / 3f; eventData.Use(); }
void INavigationHandler.OnNavigationCanceled(NavigationEventData eventData) { InputManager.Instance.PopModalInputHandler(); eventData.Use(); }