SelectionHistory¶
Namespace:
SideXP.Selection
Tracks the selection changes in the editor, and allows navigating through the previous selections.
Remarks
Empty selections are not recorded. A selection is recorded only once it has remained unchanged for CommitDelay, so interactions that change the selection many times in a row (like rectangle selection in the Scene view) produce a single entry. The folders browsed from the folder tree of the Project window (two columns layout) are recorded the same way, as if they were selected (see ShouldRecordBrowsedFolders).
Properties¶
Entries¶
Inherited documentation.
CurrentIndex¶
Inherited documentation.
Current¶
The current entry, or null if the history is empty.
CanGoBack¶
Checks if there's a previous entry that can be selected.
CanGoForward¶
Checks if there's a next entry that can be selected.
Events¶
OnChanged¶
Called when the history has changed (new entry, navigation, ...).
Methods¶
Back(int)¶
Selects a previous entry of the history. Entries that can't be resolved are skipped.
Parameters
count: The number of entries to go back by. If there are fewer previous entries, selects the oldest one.
Returns
Returns true if a previous entry has been selected.
Forward(int)¶
Selects a next entry of the history. Entries that can't be resolved are skipped.
Parameters
count: The number of entries to go forward by. If there are fewer next entries, selects the most recent one.
Returns
Returns true if a next entry has been selected.
GoTo(int)¶
Selects the entry at the given index of the history.
Parameters
index: The index of the entry to select.
Returns
Returns true if the entry has been selected, or false if the index is out of range or the entry can't be resolved.
Remarks
If the current selection has not been recorded yet, it's discarded, so the given index still targets the expected entry. The objects of the entry that can't be resolved are skipped, and a warning is logged to list them.
Clear()¶
Removes all the entries of the history, and records the current selection as the first entry.
Clean()¶
Removes the objects that don't exist anymore from the entries, and the entries that become empty. If the current entry is removed, the previous remaining entry becomes the current one.
Returns
Returns true if at least one object or entry has been removed.
RefreshReferences()¶
Captures again the identifiers of the objects that are still alive in all the entries.
Flush()¶
Records the current selection now if it has changed, instead of waiting for CommitDelay.