Пример #1
0
    public void Rotate()
    {
        GridPosR.Orientation newOri = GridPosR.RotateOrientationClockwise90(InventoryItem.GridPos_Matrix.orientation);
        GridPosR             newGPR = new GridPosR(InventoryItem.GridPos_Matrix.x, InventoryItem.GridPos_Matrix.z, newOri);

        InventoryItem.SetGridPosition(newGPR);
    }
Пример #2
0
 private void Rotate()
 {
     InventoryItem.GridPos_Matrix.orientation = GridPosR.RotateOrientationClockwise90(InventoryItem.GridPos_Matrix.orientation);
     InventoryItem.SetGridPosition(InventoryItem.GridPos_Matrix);
     dragStartLocalPos += new Vector2(InventoryItem.BoundingRect.x_min * Backpack.GridSize, -InventoryItem.BoundingRect.z_min * Backpack.GridSize) - RectTransform.anchoredPosition;
     SetVirtualGridPos(InventoryItem.GridPos_World);
     RefreshView();
 }
Пример #3
0
 private void Rotate()
 {
     if (!InventoryItem.ItemContentInfo.Rotatable)
     {
         return;
     }
     GridPosR.Orientation newOri = GridPosR.RotateOrientationClockwise90(InventoryItem.GridPos_Matrix.orientation);
     InventoryItem.GridPos_Matrix = new GridPosR(InventoryItem.GridPos_Matrix.x, InventoryItem.GridPos_Matrix.z, newOri);
     SetVirtualGridPos(InventoryItem.GridPos_World);
     dragStartLocalPos += new Vector2(InventoryItem.BoundingRect.x_min * UIInventory.GridSize, -InventoryItem.BoundingRect.z_min * UIInventory.GridSize) - RectTransform.anchoredPosition;
     RefreshView();
 }
Пример #4
0
        public void SetConnection(GridPosR.OrientationFlag adjacentConnection, GridPosR.OrientationFlag diagonalConnection)
        {
            foreach (GridPosR.Orientation orientation in Enum.GetValues(typeof(GridPosR.Orientation)))
            {
                MainImageBorders[(int)orientation].enabled = !adjacentConnection.HasFlag(orientation.ToFlag());

                GridPosR.Orientation next = GridPosR.RotateOrientationClockwise90(orientation);
                if (!adjacentConnection.HasFlag(orientation.ToFlag()) && !adjacentConnection.HasFlag(next.ToFlag()))
                {
                    SideImageBorders[((int)orientation) * 2].enabled     = false;
                    SideImageBorders[((int)orientation) * 2 + 1].enabled = false;
                }
                else if (adjacentConnection.HasFlag(orientation.ToFlag()) && adjacentConnection.HasFlag(next.ToFlag()))
                {
                    if (diagonalConnection.HasFlag(orientation.ToFlag()))
                    {
                        SideImageBorders[((int)orientation) * 2].enabled     = false;
                        SideImageBorders[((int)orientation) * 2 + 1].enabled = false;
                    }
                    else
                    {
                        SideImageBorders[((int)orientation) * 2].enabled     = true;
                        SideImageBorders[((int)orientation) * 2 + 1].enabled = true;
                    }
                }
                else
                {
                    if (adjacentConnection.HasFlag(orientation.ToFlag()))
                    {
                        SideImageBorders[((int)orientation) * 2].enabled     = true;
                        SideImageBorders[((int)orientation) * 2 + 1].enabled = false;
                    }
                    else
                    {
                        SideImageBorders[((int)orientation) * 2].enabled     = false;
                        SideImageBorders[((int)orientation) * 2 + 1].enabled = true;
                    }
                }
            }
        }
Пример #5
0
 public void CameraLeftRotate()
 {
     RotateDirection            = GridPosR.RotateOrientationClockwise90(RotateDirection);
     TargetConfigData.HorAngle += 90f;
 }
Пример #6
0
 public void Rotate()
 {
     SetGridPosition(new GridPosR(GridPos_Matrix.x, GridPos_Matrix.z, GridPosR.RotateOrientationClockwise90(GridPos_Matrix.orientation)));
 }