Layer Based Removing
Last updated
Last updated
You already learned about the GridType property of the placeable object and how the GridData classes handle those types. Additionally the system automatically groups the instantiated objects by the grid type in the scene. When you start the demo scene you will notice an Object grouper in the GridBuildSystem that holds all the different Grid types.
Also when you click on the bin icon you will see a remove dropdown for different grid types.
This UI uses a custom Dropdown implementation and an Remove Button Initializer that triggers removal for either all types or only one specific type.
You probably have or want to create your own UI for your game, so for your buttons you would need to call one of those functions:
PlacementSystem.Instance.StartRemoving(gridType)
PlacementSystem.Instance.StartRemovingAll()
PlacementSystem.Instance.Remove(PlacedObject placedObject)
So you have the option to either remove from all grid types at the same time, only a special grid type or to remove a placed object directly.