-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathGrid.cs
More file actions
15 lines (13 loc) · 725 Bytes
/
Grid.cs
File metadata and controls
15 lines (13 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
namespace UnityEngine
{
public partial class Grid
{
public Vector3 GetCellCenterLocal(Vector3Int position) { return CellToLocalInterpolated(position + GetLayoutCellCenter()); }
public Vector3 GetCellCenterWorld(Vector3Int position) { return LocalToWorld(CellToLocalInterpolated(position + GetLayoutCellCenter())); }
// [IMPROVEMENT] Added helper to get center from float position
public Vector3 GetCellCenterWorld(Vector3 position) { return LocalToWorld(CellToLocalInterpolated(position + GetLayoutCellCenter())); }
}
}