From 79375f7055b5a5f900b2d2b731ea573d4cba1cb4 Mon Sep 17 00:00:00 2001 From: Zach Vinless Date: Fri, 4 Nov 2016 07:47:09 -0700 Subject: [PATCH] Removed flowchart min/max buttons and undid reflection null checks -Removed redundant min/max buttons in flowchart toolbar -Undid null checks from previous commit in favor of knowing about problems versus potential dead code --- .../Fungus/Scripts/Editor/FlowchartWindow.cs | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs index dab3d850..a0df30f9 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs @@ -95,24 +95,16 @@ namespace Fungus.EditorUtils // The docked value doesn't always report correctly without the delayCall EditorApplication.delayCall += () => { var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - var dockedProperty = typeof(EditorWindow).GetProperty("docked", flags); - - if (dockedProperty != null) + var isDockedMethod = typeof(EditorWindow).GetProperty("docked", flags).GetGetMethod(true); + if ((bool) isDockedMethod.Invoke(this, null)) { - var isDockedMethod = dockedProperty.GetGetMethod(true); - if (isDockedMethod != null) - { - if ((bool) isDockedMethod.Invoke(this, null)) - { - EditorZoomArea.Offset = new Vector2(2.0f, 19.0f); - } - else - { - EditorZoomArea.Offset = new Vector2(0.0f, 22.0f); - } - } + EditorZoomArea.Offset = new Vector2(2.0f, 19.0f); + } + else + { + EditorZoomArea.Offset = new Vector2(0.0f, 22.0f); } - }; + }; } public static Flowchart GetFlowchart() @@ -205,15 +197,6 @@ namespace Fungus.EditorUtils ); GUILayout.Label(flowchart.Zoom.ToString("0.0#x"), EditorStyles.miniLabel, GUILayout.Width(30)); - if (GUILayout.Button("Min", EditorStyles.toolbarButton)) - { - newZoom = minZoomValue; - } - if (GUILayout.Button("Max", EditorStyles.toolbarButton)) - { - newZoom = maxZoomValue; - } - DoZoom(flowchart, newZoom - flowchart.Zoom, Vector2.one * 0.5f); if (GUILayout.Button("Center", EditorStyles.toolbarButton))