Class DataSetListBase<T>
Base class for reorderable data sets list in the editor.
Inherited Members
Namespace: InsaneScatterbrain.MapGraph.Editor
Syntax
public abstract class DataSetListBase<T> : ListBase where T : IDataSetItem
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
DataSetListBase(IDataSet<T>)
Declaration
protected DataSetListBase(IDataSet<T> dataSet)
Parameters
| Type | Name | Description |
|---|---|---|
| IDataSet<T> | dataSet |
Properties
AdditionalFieldsWidth
Gets the width in pixel available for any additional fields.
Declaration
protected abstract int AdditionalFieldsWidth { get; }
Property Value
| Type | Description |
|---|---|
| int |
DataObject
Gets/sets the scriptable object that needs to be saved whenever the data set is changed.
Declaration
public ScriptableObject DataObject { get; set; }
Property Value
| Type | Description |
|---|---|
| ScriptableObject |
DataSet
Gets the data set the list represents.
Declaration
protected IDataSet<T> DataSet { get; }
Property Value
| Type | Description |
|---|---|
| IDataSet<T> |
DefaultName
Gets the default name for a new item.
Declaration
protected abstract string DefaultName { get; }
Property Value
| Type | Description |
|---|---|
| string |
LabelText
Gets the title text displayed in the list's label.
Declaration
protected abstract string LabelText { get; }
Property Value
| Type | Description |
|---|---|
| string |
OrderedIds
Declaration
public IList<string> OrderedIds { get; }
Property Value
| Type | Description |
|---|---|
| IList<string> |
ReorderableList
Gets the reorderable list element.
Declaration
protected override ReorderableList ReorderableList { get; }
Property Value
| Type | Description |
|---|---|
| ReorderableList |
Overrides
SelectedIndex
Gets the currently selected index.
Declaration
public int SelectedIndex { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Dispose()
Declaration
public virtual void Dispose()
DoLayoutList()
Draws list.
Declaration
public virtual void DoLayoutList()
DrawAdditionalFields(Rect, string)
Draw any additional item fields.
Declaration
protected abstract void DrawAdditionalFields(Rect rect, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | rect | The rect. |
| string | id | The item ID. |
NameField(Rect, string)
Draws a list item's name field.
Declaration
protected virtual string NameField(Rect rect, string itemName)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | rect | The rect where to draw the field. |
| string | itemName | The item's current name. |
Returns
| Type | Description |
|---|---|
| string | The item's new name. |
SaveAsset()
Declaration
protected void SaveAsset()
UpdateList()
Loads the entries in the reorderable list.
Declaration
public void UpdateList()
Events
OnRegisterUndo
Declaration
protected event Action<string> OnRegisterUndo
Event Type
| Type | Description |
|---|---|
| Action<string> |
OnRemove
Event triggered whenever an item has been removed.
Declaration
public event Action<string> OnRemove
Event Type
| Type | Description |
|---|---|
| Action<string> |
OnSelect
Event triggered whenever a new item has been selected.
Declaration
public event Action<string> OnSelect
Event Type
| Type | Description |
|---|---|
| Action<string> |