예제 #1
0
    void DrawObjectsTable()
    {
        List <TableColumn> columns = new List <TableColumn>()
        {
            new TableColumn("String", TableColumn.Width(60f)),
            new TableColumn("Float", TableColumn.Width(50f)),
            new TableColumn("Object", TableColumn.Width(110f)),
            new TableColumn("", TableColumn.Width(50f), TableColumn.EnabledTitle(false))
        };

        List <List <TableCell> > rows = new List <List <TableCell> >();

        ActionExample targetObject = (ActionExample)target;

        for (int i = 0; i < targetObject.simpleObjects.Count; i++)
        {
            ActionExample.SimpleObject entry = targetObject.simpleObjects[i];
            rows.Add(new List <TableCell>()
            {
                new LabelCell(entry.stringProperty),
                new PropertyCell(serializedObject, string.Format("simpleObjects.Array.data[{0}].floatProperty", i)),
                new PropertyCell(serializedObject, string.Format("simpleObjects.Array.data[{0}].objectProperty", i)),
                new ActionCell("Reset", () => entry.Reset()),
            });
        }

        tableState = GUITableLayout.DrawTable(tableState, columns, rows);
    }
예제 #2
0
    void DrawObjectsTable()
    {
        List <TableColumn> columns = new List <TableColumn>()
        {
            new TableColumn("String", 60f),
            new TableColumn("Float", 50f),
            new TableColumn("Object", 110f),
            new TableColumn("", 50f)
            {
                enabledTitle = false
            },
        };

        List <List <TableEntry> > rows = new List <List <TableEntry> >();

        ActionExample targetObject = (ActionExample)target;

        for (int i = 0; i < targetObject.simpleObjects.Count; i++)
        {
            ActionExample.SimpleObject entry = targetObject.simpleObjects[i];
            rows.Add(new List <TableEntry>()
            {
                new LabelEntry(entry.stringProperty),
                new PropertyEntry(serializedObject, string.Format("simpleObjects.Array.data[{0}].floatProperty", i)),
                new PropertyEntry(serializedObject, string.Format("simpleObjects.Array.data[{0}].objectProperty", i)),
                new ActionEntry("Reset", () => entry.Reset()),
            });
        }

        tableState = GUITable.DrawTable(columns, rows, tableState);
    }