public Vector2 GetAnchorPosition(GameObject g) { for (int x = 0; x < Columns; x++) for (int y = 0; y < Rows; y++) if (grid[x, y] == g) return new Vector2(x * cellWidth, y * cellHeight); return Vector2.Zero; }
public void Add(GameObject obj2D, int x, int y) { grid[x, y] = obj2D; obj2D.Parent = this; obj2D.Position = new Vector2(x * cellWidth, y * cellHeight); }
public void Remove(GameObject obj) { gameObjects.Remove(obj); obj.Parent = null; }