Table of Contents

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

DataTableUpdateDelegate

OnDataTablePreUpdate

Call before dataTable internal update

public static DataTableUpdateDelegate OnDataTablePreUpdate

Field Value

DataTableUpdateDelegate

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

dataTable DataTable

ExportJson(DataTable)

Export dataTable to json

public static string ExportJson(DataTable dataTable)

Parameters

dataTable DataTable

Returns

string

GetAllRowsSafe(DataTable)

Get data rows from table without modify default object

public static IDataTableRow[] GetAllRowsSafe(DataTable dataTable)

Parameters

dataTable DataTable

Returns

IDataTableRow[]

GetAllRowsSafe<T>(DataTable)

Get data rows from table without modify default object

public static T[] GetAllRowsSafe<T>(DataTable dataTable) where T : class, IDataTableRow

Parameters

dataTable DataTable

Returns

T[]

Type Parameters

T

GetNewRowId(DataTable)

Get a valid new row id

public static string GetNewRowId(DataTable dataTable)

Parameters

dataTable DataTable

Returns

string

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

dataTable DataTable

Returns

Dictionary<string, IDataTableRow>

ImportJson(DataTable, string)

Import json and overwrite dataTable

public static void ImportJson(DataTable dataTable, string jsonData)

Parameters

dataTable DataTable
jsonData string

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

dataTable DataTable

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

dataTable DataTable

SetRowStruct(DataTable, Type)

Set row struct type

public static void SetRowStruct(DataTable dataTable, Type rowType)

Parameters

dataTable DataTable
rowType Type

SetRowStruct<T>(DataTable)

Set row struct type

public static void SetRowStruct<T>(DataTable dataTable) where T : class, IDataTableRow

Parameters

dataTable DataTable

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)

Parameters

dataTable DataTable
oldRowId string
newRowId string
result string

Returns

bool