改了格子大小
This commit is contained in:
@@ -30,7 +30,7 @@ public partial class MapManager : MonoBehaviour
|
||||
Vector3 newPosition = Camera.main.transform.position + move;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>ͼ<EFBFBD>߽磩
|
||||
newPosition.x = Mathf.Clamp(newPosition.x, 0, mapRealWidth);
|
||||
newPosition.x = Mathf.Clamp(newPosition.x, 0, mapRealWidth * 1.5f);
|
||||
newPosition.y = Mathf.Clamp(newPosition.y, 0, mapRealHeight);
|
||||
Camera.main.transform.position = newPosition;
|
||||
|
||||
@@ -49,7 +49,7 @@ public partial class MapManager : MonoBehaviour
|
||||
public void MoveToCamera(float x, float y)
|
||||
{
|
||||
Vector3 newPosition;
|
||||
newPosition.x = Mathf.Clamp(x, 0, mapRealWidth);
|
||||
newPosition.x = Mathf.Clamp(x, 0, mapRealWidth * 1.5f);
|
||||
newPosition.y = Mathf.Clamp(y, 0, mapRealHeight);
|
||||
Camera.main.transform.position = new Vector3(x, y, -10);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public partial class MapManager : MonoBehaviour
|
||||
Vector2Int pos = new Vector2Int();
|
||||
pos.x = (int)Camera.main.transform.position.x;
|
||||
pos.y = (int)Camera.main.transform.position.y;
|
||||
pos.x = Mathf.Clamp(pos.x, 0, (int)mapRealWidth);
|
||||
pos.x = Mathf.Clamp(pos.x, 0, (int)(mapRealWidth * 1.5f));
|
||||
pos.y = Mathf.Clamp(pos.y, 0, (int)mapRealHeight);
|
||||
pos.x = (int)(pos.x / map.sideWidth);
|
||||
pos.y = (int)(pos.y / map.sideHeight);
|
||||
|
||||
Reference in New Issue
Block a user