private void DebugVisualizationGUI() { GUILayout.BeginHorizontal(); GUI.enabled = !Instance.VoxelizationUpdateQueued; if (GUILayout.Button(Localizer.Format("FARDebugVoxels"))) { Matrix4x4?localToWorldMatrix = null; try { // even with no root parts in the editor, neither RootPart or its partTransform are null // but trying to get localToWorldMatrix throws NRE localToWorldMatrix = EditorLogic.RootPart.partTransform.localToWorldMatrix; } catch (NullReferenceException) { } if (localToWorldMatrix != null) { _vehicleAero.DebugVisualizeVoxels((Matrix4x4)localToWorldMatrix); } } GUI.enabled = true; GUILayout.EndHorizontal(); }
void DebugVisualizationGUI() { if (GUILayout.Button("Display Debug Voxels")) { _vehicleAero.DebugVisualizeVoxels(EditorLogic.RootPart.partTransform.localToWorldMatrix); } }
void DebugVisualizationGUI() { GUILayout.BeginHorizontal(); if (GUILayout.Button(Localizer.Format("FARDebugVoxels"))) { _vehicleAero.DebugVisualizeVoxels(EditorLogic.RootPart.partTransform.localToWorldMatrix); } GUILayout.EndHorizontal(); }