コード例 #1
0
 private void checkForMapPanning()
 {
     MapPositionCaster.CursorPosition cursorPosition = cursor.getCursorPosition();
     if (!cursorPosition.Equals(MapPositionCaster.CursorPosition.Central))
     {
         mapDrawer.panMap(cursorPosition);
         topLayer.panMap(cursorPosition);
     }
 }
コード例 #2
0
 public void panMap(MapPositionCaster.CursorPosition cursorPosition)
 {
     if (cursorPosition.Equals(MapPositionCaster.CursorPosition.LeftBorder) && !isMapPanning)
     {
         Vector3 direction = new Vector3(1, 0, 0);
         setNewTarget(direction);
     }
     else if (cursorPosition.Equals(MapPositionCaster.CursorPosition.RightBorder) && !isMapPanning)
     {
         Vector3 direction = new Vector3(-1, 0, 0);
         setNewTarget(direction);
     }
     else if (cursorPosition.Equals(MapPositionCaster.CursorPosition.TopBorder) && !isMapPanning)
     {
         Vector3 direction = new Vector3(0, -1, 0);
         setNewTarget(direction);
     }
     else if (cursorPosition.Equals(MapPositionCaster.CursorPosition.BottomBorder) && !isMapPanning)
     {
         Vector3 direction = new Vector3(0, 1, 0);
         setNewTarget(direction);
     }
 }