private void AddTile(Vector3 position) { if (!gridBase.ContainsTileAt(position)) { TilePositionsProperty.arraySize++; TilePositionsProperty.serializedObject.ApplyModifiedProperties(); TilePositionsProperty.GetArrayElementAtIndex(gridBase.storage.tilePositions.Count - 1).vector3Value = position; TilePositionsProperty.serializedObject.ApplyModifiedProperties(); meshPainter.DrawTile(position); } }
private void CreateTile(Vector3 position) { // Get Floor height before generating a new Tile object position.y = GridUtility.FloorHeight(position); if (GridBase.Instance.alignY) { position.y = GridUtility.CheckVerticalAlignment(position.y); } if (!gridBase.ContainsTileAt(position)) { TilePositionsProperty.arraySize++; TilePositionsProperty.serializedObject.ApplyModifiedProperties(); TilePositionsProperty.GetArrayElementAtIndex(gridBase.storage.tilePositions.Count - 1).vector3Value = position; TilePositionsProperty.serializedObject.ApplyModifiedProperties(); meshPainter.DrawTile(position); } }