Ugly But Functional Commodity Editor

Ugly But Functional Commodity Editor

Posted by on Jan 11, 2016 in Game Development


It’s really nothing special to look at, but it does exactly what it’s meant to do, which is to allow me to work with data in a visual way, entirely within Unity.

The worst part is that it’s totally annoying me how everything is structured around the old UI methods, but also using a sub/superset in EditorGUI or EditorGUILayout. The Layout versions allow for better dynamic placement, but lack certain elements that I needed like the ObjectField that allows me to select the Texture2D editor for assigning images. I can only get that from the non-Layout EditorGUI, which means I need to place it very specifically in a way which doesn’t respect the flow layout that the Layout versions offer. So instead, everything is arranged by Rect(X,Y,W,H), making it less than flexible but grants access to everything I need.

Still, the data is stored in an .asset file, and I’ve already modified the master data loading procedure to get the data from the .asset file instead of the hard-coded List<CommodityDataObject> that I had been using.