Changing How TableMatrix Cells Are Drawn
If you want to change how the TwoDimensionalArrayDrawer draws its cells you have to add the TableMatrix attribute to the field and supply a method name to the DrawElementMethod parameter of the TableMatrix Attribute. This method name gets resolved using ActionResolvers and will be called for each cell. Inside of this function you use normal Unity GUI functions or Odin's GUI functions to draw the cell's contents. Odin can pass a few arguments to the provided function via [NamedValues], these are the possible arguments:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Here is a small complete example that shows how you could change the preview texture that Odin draws for your class inside the TwoDimensionalArrayDrawer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
1 2 3 4 5 6 7 8 9 |
|
Last update: September 30, 2021