From be41f9539a833bbce5d289ea5a97ce9dbf4922e8 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 16 Sep 2014 12:55:08 +0100 Subject: [PATCH] Improved view highlighting when view command selected --- Assets/Fungus/Camera/Editor/ViewEditor.cs | 30 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Assets/Fungus/Camera/Editor/ViewEditor.cs b/Assets/Fungus/Camera/Editor/ViewEditor.cs index 49b7c15e..72e9ea76 100644 --- a/Assets/Fungus/Camera/Editor/ViewEditor.cs +++ b/Assets/Fungus/Camera/Editor/ViewEditor.cs @@ -160,13 +160,35 @@ public class ViewEditor : Editor Color fill = viewColor; Color outline = viewColor; - if (Selection.activeGameObject == view.gameObject) + bool highlight = Selection.activeGameObject == view.gameObject; + + FungusScript fungusScript = FungusScriptWindow.GetFungusScript(); + if (fungusScript != null) { - fill = outline = Color.green; + MoveToView moveToViewCommand = fungusScript.selectedCommand as MoveToView; + if (moveToViewCommand != null) + { + highlight = (moveToViewCommand.targetView == view); + } + + FadeToView fadeToViewCommand = fungusScript.selectedCommand as FadeToView; + if (fadeToViewCommand != null) + { + highlight = (fadeToViewCommand.targetView == view); + } } - fill.a = 0.1f; - outline.a = 0.5f; + if (highlight) + { + fill = outline = Color.green; + fill.a = 0.1f; + outline.a = 1f; + } + else + { + fill.a = 0.1f; + outline.a = 0.5f; + } // Draw left box {