Description
The Clear
method is a public, virtual method of the SelectionSystem
class in the Sandbox namespace. It is used to remove all items from the current selection, effectively resetting the selection state to empty. This method does not take any parameters and does not return a value.
Usage
To use the Clear
method, you need to have an instance of the SelectionSystem
class. Once you have the instance, you can call the Clear
method to remove all selected items. This is useful when you want to reset the selection state, for example, when starting a new selection process or when clearing the selection as part of a user action.
Example
// Example of using the Clear method in the SelectionSystem class
// Assume selectionSystem is an instance of SelectionSystem
SelectionSystem selectionSystem = new SelectionSystem();
// Add some items to the selection
selectionSystem.Add(someObject1);
selectionSystem.Add(someObject2);
// Clear all selections
selectionSystem.Clear();
// At this point, selectionSystem.Count should be 0, indicating no items are selected.