From 8796aef6b7067e6edf714ef4b27fcd65d0f4bf94 Mon Sep 17 00:00:00 2001 From: LightVelox Date: Sun, 31 May 2020 14:46:11 -0300 Subject: [PATCH] Removes interaction opacity when not selected (#365) --- .../RadialMenuUI/Classic/RadialMenuList.prefab | 2 +- .../Engine/Interactions/UI/RadialInteractionMenuUI.cs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/Content/Graphics/UI/Interaction/RadialMenuUI/Classic/RadialMenuList.prefab b/Assets/Content/Graphics/UI/Interaction/RadialMenuUI/Classic/RadialMenuList.prefab index 9b7933eb8d..6a0837884c 100644 --- a/Assets/Content/Graphics/UI/Interaction/RadialMenuUI/Classic/RadialMenuList.prefab +++ b/Assets/Content/Graphics/UI/Interaction/RadialMenuUI/Classic/RadialMenuList.prefab @@ -58,7 +58,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0.27058825} + m_Color: {r: 0.6901961, g: 0.6901961, b: 0.6901961, a: 0} m_RaycastTarget: 1 m_Maskable: 1 m_OnCullStateChanged: diff --git a/Assets/Engine/Interactions/UI/RadialInteractionMenuUI.cs b/Assets/Engine/Interactions/UI/RadialInteractionMenuUI.cs index 8f5131bd4b..5f396807b9 100644 --- a/Assets/Engine/Interactions/UI/RadialInteractionMenuUI.cs +++ b/Assets/Engine/Interactions/UI/RadialInteractionMenuUI.cs @@ -34,6 +34,10 @@ public class RadialInteractionMenuUI : MonoBehaviour public float mouseDistance; public Sprite missingIcon; + private Image indicatorImage; + private Color indicatorBaseColor; + private Color indicatorOffColor; + // Current selected object GameObject obj = null; @@ -83,6 +87,10 @@ private void Start() else contextMenuManagerInstance = this; parentCanvas = GetComponentInParent(); + + indicatorImage = indicator.GetComponent(); + indicatorOffColor = indicatorImage.color; + indicatorBaseColor = new Color(indicatorOffColor.r, indicatorOffColor.g, indicatorOffColor.b, .69f); } private void Update() { @@ -137,6 +145,8 @@ private void Update() interactionName.text = null; objectName.text = null; } + + indicatorImage.color = (selectedPetal == null) ? indicatorOffColor : indicatorBaseColor; } private void UpdateInteractions()