怪物搞完
This commit is contained in:
@@ -45,4 +45,12 @@ public partial class MapManager : MonoBehaviour
|
||||
mapRealWidth = x;
|
||||
mapRealHeight = y;
|
||||
}
|
||||
|
||||
public void MoveToCamera(float x, float y)
|
||||
{
|
||||
Vector3 newPosition;
|
||||
newPosition.x = Mathf.Clamp(x, 0, mapRealWidth);
|
||||
newPosition.y = Mathf.Clamp(y, 0, mapRealHeight);
|
||||
Camera.main.transform.position = new Vector3(x, y, -10);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user