From fc9ebdb444b87b569bc1187a5653a61f07d297b4 Mon Sep 17 00:00:00 2001 From: Daniel Borges Date: Sat, 4 Jul 2020 09:50:52 +0200 Subject: [PATCH] Fixed massive editor slowdown when there is MANY objects in the scene --- Assets/Fungus/Scripts/Editor/ViewEditor.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Assets/Fungus/Scripts/Editor/ViewEditor.cs b/Assets/Fungus/Scripts/Editor/ViewEditor.cs index 898c3d7e..db4da11f 100644 --- a/Assets/Fungus/Scripts/Editor/ViewEditor.cs +++ b/Assets/Fungus/Scripts/Editor/ViewEditor.cs @@ -18,17 +18,14 @@ namespace Fungus.EditorUtils // Draw Views when they're not selected #if UNITY_5_0 - [DrawGizmo(GizmoType.NotSelected | GizmoType.SelectedOrChild)] + [DrawGizmo(GizmoType.NotSelected | GizmoType.SelectedOrChild, typeof(View))] #else - [DrawGizmo(GizmoType.NotInSelectionHierarchy | GizmoType.InSelectionHierarchy)] + [DrawGizmo(GizmoType.NotInSelectionHierarchy | GizmoType.InSelectionHierarchy, typeof(View))] #endif static void RenderCustomGizmo(Transform objectTransform, GizmoType gizmoType) { View view = objectTransform.gameObject.GetComponent(); - if (view != null) - { - DrawView(view, false); - } + DrawView(view, false); } protected virtual Vector2 LookupAspectRatio(int index) @@ -264,4 +261,4 @@ namespace Fungus.EditorUtils return view.transform.InverseTransformPoint(view.transform.position + new Vector3(0, view.ViewSize, 0)).magnitude; } } -} \ No newline at end of file +}