显示ara

This commit is contained in:
2025-06-21 01:29:18 +08:00
parent 0f78ad7a32
commit e9141b7ec1
158 changed files with 347644 additions and 3613 deletions

View File

@@ -80,6 +80,17 @@ public class GridSelector : MonoBehaviour
int hitIndex = Mathf.FloorToInt(pos.x / map.sideWidth) + Mathf.FloorToInt(pos.z / map.sideHeight) * horizontalNumber;
return hitIndex;
}
public Vector2Int getMapGrid(Vector3 pos)
{
return getMapGrid(new Vector2(pos.x,pos.y));
}
public Vector2Int getMapGrid(Vector2 pos)
{
var grid = new Vector2Int();
grid.x = Mathf.FloorToInt(pos.x / map.sideWidth);
grid.y = Mathf.FloorToInt(pos.y / map.sideHeight);
return grid;
}
private void Awake()
{
mapRenderer = GetComponent<MeshRenderer>();