The TreeView itself is not serializable - it is reconstructed from the data that it represents when it is constructed or reloaded. TreeViewState is the only state that is serializable. TreeViewState ( TreeViewState) contains state information that is changed when interacting with TreeView fields in the Editor, such as selection state, expanded state, navigation state, and scroll state. The most important classes aside from the TreeView itself are TreeViewItem and TreeViewState. This item is the root of all other items. The TreeView has a single root TreeViewItem which is hidden and does not appear in the Editor. Each TreeViewItem contains parent and children information, which is used by the TreeView to handle navigation (key and mouse input). The rendering of the TreeView is handled by determining a list of expanded items called rows. This can be a C# tree model, or a Unity-based tree structure like the Transform hierarchy. You can construct TreeView using any tree data structure you prefer. Note that the TreeView is not a tree data model. Example of a TreeView with a MultiColumnHeader and a SearchField. See Unity Scripting API documentation on TreeView for information about the available TreeView API functions. Use TreeView to create highly customizable list views and multi-column tables for Editor windows, which you can use alongside other IMGUI controls and components. TreeView is an IMGUI control used to display hierarchical data that you can expand and collapse. For information about IMGUI and customizing Editor windows, refer to Extending the Editor and the IMGUI Unity blog. The information on this page assumes the reader has basic knowledge of IMGUI (Immediate Mode GUI) concepts. Note: It’s strongly recommended to use the UI Toolkit to extend the Unity Editor, as it provides a more modern, flexible, and scalable solution than IMGUI.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |