Exemple #1
0
        public void AffectHeightLevel()
        {
            int heightLevelRounded = objPlacer.HeightLevelRoundedDown;

            for (int y = 0; y < grid.GridSizeY; y++)
            {
                for (int x = 0; x < grid.GridSizeX; x++)
                {
                    switch (settings.EditMode)
                    {
                    case ObjectPlacer.EditMode.Add:
                        if (objPlacer.ObjectsLeft <= 0)
                        {
                            objPlacer.NotifyOutOfObjects();
                            return;
                        }
                        else
                        {
                            objPlacer.AddOrRemoveObject(new Vector2Int(x, y), false, false);
                        }
                        break;

                    case ObjectPlacer.EditMode.Remove:
                        objPlacer.AddOrRemoveObject(new Vector2Int(x, y), false, true);
                        break;

                    case ObjectPlacer.EditMode.Hide:
                        grid.HideObjectsInCell(new Vector2Int(x, y), true, heightLevelRounded);
                        break;
                    }
                }
            }
        }