Class DataTableEditorUtils
- Namespace
- Ceres.DataDriven.Editor
- Assembly
- Ceres.Editor.dll
Utility for editing DataTable in editor script
public static class DataTableEditorUtils
- Inheritance
-
DataTableEditorUtils
- Inherited Members
Fields
OnDataTablePostUpdate
Call after dataTable internal update
public static DataTableUpdateDelegate OnDataTablePostUpdate
Field Value
OnDataTablePreUpdate
Call before dataTable internal update
public static DataTableUpdateDelegate OnDataTablePreUpdate
Field Value
Properties
ToolBarButtonStyle
public static GUIStyle ToolBarButtonStyle { get; }
Property Value
- GUIStyle
Methods
Cleanup(DataTable)
Clear DataTable editor object cache
public static void Cleanup(DataTable dataTable)
Parameters
dataTableDataTable
ExportJson(DataTable)
Export dataTable to json
public static string ExportJson(DataTable dataTable)
Parameters
dataTableDataTable
Returns
GetAllRowsSafe(DataTable)
Get data rows from table without modify default object
public static IDataTableRow[] GetAllRowsSafe(DataTable dataTable)
Parameters
dataTableDataTable
Returns
GetAllRowsSafe<T>(DataTable)
Get data rows from table without modify default object
public static T[] GetAllRowsSafe<T>(DataTable dataTable) where T : class, IDataTableRow
Parameters
dataTableDataTable
Returns
- T[]
Type Parameters
T
GetNewRowId(DataTable)
Get a valid new row id
public static string GetNewRowId(DataTable dataTable)
Parameters
dataTableDataTable
Returns
GetRowMapSafe(DataTable)
Get all data rows as map with RowId as key without modify default object
public static Dictionary<string, IDataTableRow> GetRowMapSafe(DataTable dataTable)
Parameters
dataTableDataTable
Returns
ImportJson(DataTable, string)
Import json and overwrite dataTable
public static void ImportJson(DataTable dataTable, string jsonData)
Parameters
Modify(DataTable)
Post-processing after update DataTable, which will clear editor object cache and keep row struct type right.
public static void Modify(DataTable dataTable)
Parameters
dataTableDataTable
Remarks
When use version control, update object handle will let file checkout. So cleanup after editor completed use.
RegisterAllDataTablesToAssetGroup()
Register all DataTable in project if defined AddressableDataTableAttribute
public static void RegisterAllDataTablesToAssetGroup()
RegisterTableToAssetGroup(DataTable)
Register a DataTable if defined AddressableDataTableAttribute
public static void RegisterTableToAssetGroup(DataTable dataTable)
Parameters
dataTableDataTable
SetRowStruct(DataTable, Type)
Set row struct type
public static void SetRowStruct(DataTable dataTable, Type rowType)
Parameters
SetRowStruct<T>(DataTable)
Set row struct type
public static void SetRowStruct<T>(DataTable dataTable) where T : class, IDataTableRow
Parameters
dataTableDataTable
Type Parameters
T
ValidateNewRowId(DataTable, string, string, out string)
Validate input row id and out right one
public static bool ValidateNewRowId(DataTable dataTable, string oldRowId, string newRowId, out string result)