示例#1
0
 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);
     }
 }
示例#2
0
        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);
            }
        }