-
Notifications
You must be signed in to change notification settings - Fork 29
Examples
A selection of usage examples demonstrating how to use this package.
-
Serialized property inside custom inspector
Reorderable list fields can be added to custom inspector interfaces with automatic support for undo/redo when using serialized properties. Serialized properties support native arrays as well as generic lists. -
Generic list inside editor window
Items from generic lists can be presented using custom item drawers. A custom item drawer is essentially a delegate which is called to draw each list item. The generic list adaptor can be subclassed instead if items of varying heights are needed (see Custom list adaptor). -
Serialized property inside editor window
The serialized property version of this field can also be used in editor windows. This allows you to take advantage of the automatic undo and redo capabilities which Unity provides. -
Customize appearance of list field
Style of list container, add button and remove buttons can be customized by providing custom styles. This example demonstrates a custom inspector with custom styles which are based upon the default styles. -
Detect changes within list field
The reorderable list field watches for changes surrounding individual items allowing you to pinpoint the item which was actually modified. Any changes made outside of list item drawers are considered changes made by the list control itself. -
Custom list adaptor
This example demonstrates how to implement a custom list adaptor which can contain caption items which cannot be dragged or removed. List items can however be dragged around the stationary caption items. -
Customize context menu
This example demonstrates how to add to, or even replace entirely, the list field's context menu. -
Subscribing to item inserted and removing events
This example demonstrates how to subscribe to events by creating a local instance of the list control. It is also necessary to instantiate the appropriate list adaptor which can be cached alongside list control instance. -
Item selection with a custom adaptor
Item selection can be added to a reorderable list control by creating a custom reorderable list adaptor. Selection state can be efficiently represented using a hash set collection. -
Adding the drop down add menu
The drop-down add menu button is automatically displayed when there is at least one subscriber to theReorderableListControl.AddMenuClicked
event. The presentation of the button varies depending upon whether the regular add button is also shown. -
Populating the drop down add menu with types
Utility functionality is provided to assist when building menus that contain a number of addable element types that implement some interface or base type; this is referred to as the element contract type.
Source: topics/Examples.md
Copyright © Rotorz Limited. All rights reserved.