private void Update() { if (equipedItem) { HorizontalSide otherSide = side == HorizontalSide.left ? HorizontalSide.right : HorizontalSide.left; if (equipedItem.twoHanded) { equipedItem.transform.LookAt(player.controllers[otherSide].transform.position); } } else if (InputsVR.Hands.ContainsKey(side)) { animator.SetFloat("Trigger", InputsVR.Hands[side].trigger.Value); animator.SetFloat("Grip", InputsVR.Hands[side].grip.Value); } }
private static Rectangle GetBorderPatch(HorizontalSide h, VerticalSide v) { int left = 0; int top = 0; int width = 0; int height = 0; if (h == HorizontalSide.Left) { left = 0; width = BORDER_SIZE; } else if (h == HorizontalSide.Middle) { left = BORDER_SIZE; width = SEAMLESS_SIZE; } else if (h == HorizontalSide.Right) { left = BORDER_IMG_SIZE - BORDER_SIZE; width = BORDER_SIZE; } if (v == VerticalSide.Top) { top = 0; height = BORDER_SIZE; } else if (v == VerticalSide.Middle) { top = BORDER_SIZE; height = SEAMLESS_SIZE; } else if (v == VerticalSide.Bottom) { top = BORDER_IMG_SIZE - BORDER_SIZE; height = BORDER_SIZE; } return(new Rectangle(left, top, width, height)); }
private static Rectangle GetSeamlessPatch(HorizontalSide h, VerticalSide v) { int left = 0; int top = 0; int width = 0; int height = 0; if (h == HorizontalSide.Left) { left = 0; width = CELL_MARGIN; } else if (h == HorizontalSide.Middle) { left = 0; width = SEAMLESS_SIZE; } else if (h == HorizontalSide.Right) { left = SEAMLESS_SIZE - CELL_MARGIN; width = CELL_MARGIN; } if (v == VerticalSide.Top) { top = 0; height = CELL_MARGIN; } else if (v == VerticalSide.Middle) { top = 0; height = SEAMLESS_SIZE; } else if (v == VerticalSide.Bottom) { top = SEAMLESS_SIZE - CELL_MARGIN; height = CELL_MARGIN; } return(new Rectangle(left, top, width, height)); }
/// <summary> /// Creates a new <see cref="HorizontalResizeDragEventArgs"/> instance. /// </summary> /// <param name="horizontalSide"> /// The <see cref="Common.HorizontalSide">horizontal side</see> of the originating border <see cref="Thumb"/>. /// </param> /// <inheritdoc cref="DragDeltaEventArgs(double, double)"/> public HorizontalResizeDragEventArgs(HorizontalSide horizontalSide, double horizontalChange) : base(horizontalChange, verticalChange: 0d) { HorizontalSide = horizontalSide; RoutedEvent = VideoTimelineSegment.HorizontalResizeDraggingEvent; }
/// <summary> /// Creates a new <see cref="HorizontalResizeDragCompletedEventArgs"/> instance. /// </summary> /// <param name="horizontalSide"> /// The <see cref="Common.HorizontalSide">horizontal side</see> of the originating border <see cref="Thumb"/>. /// </param> /// <inheritdoc cref="DragCompletedEventArgs(double, double, bool)"/> public HorizontalResizeDragCompletedEventArgs(HorizontalSide horizontalSide, double horizontalChange, bool canceled) : base(horizontalChange, verticalChange: 0d, canceled) { HorizontalSide = horizontalSide; RoutedEvent = VideoTimelineSegment.HorizontalResizeDragCompletedEvent; }