Exemplo n.º 1
0
            private Vector2Int GetAlignDelta(EnumPieceAlignVec alignVec)
            {
                int deltaX = 0;
                int deltaY = 0;

                switch (alignVec)
                {
                case EnumPieceAlignVec.Left:
                    deltaX = -BorderSpeed;
                    break;

                case EnumPieceAlignVec.Right:
                    deltaX = +BorderSpeed;
                    break;

                case EnumPieceAlignVec.Up:
                    deltaY = +BorderSpeed;
                    break;

                case EnumPieceAlignVec.Down:
                    deltaY = -BorderSpeed;
                    break;
                }
                return(new Vector2Int(deltaX, deltaY));
            }
Exemplo n.º 2
0
            private bool CheckFinishAlign(FieldInput fieldInput, Vector2Int newDistPosition)
            {
                EnumPieceAlignVec lastAlignVec = GetBackAlignVec(fieldInput.distPosition, fieldInput.swipeVec);
                EnumPieceAlignVec nowAlignVec  = GetBackAlignVec(newDistPosition, fieldInput.swipeVec);

                // DebugPanel.Log($"fieldInput.distPosition", fieldInput.distPosition.ToString());
                // DebugPanel.Log($"newDistPosition", newDistPosition.ToString());
                // DebugPanel.Log($"lastAlignVec", lastAlignVec.ToString());
                // DebugPanel.Log($"fieldInput.alignVec", fieldInput.alignVec.ToString());
                return(((lastAlignVec != nowAlignVec) && lastAlignVec == fieldInput.alignVec) ||
                       lastAlignVec == EnumPieceAlignVec.None);
            }