Skip to content

Commit

Permalink
Removes interaction opacity when not selected (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorNAlbarnaz authored May 31, 2020
1 parent 6402566 commit 8796aef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions Assets/Engine/Interactions/UI/RadialInteractionMenuUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -83,6 +87,10 @@ private void Start()
else
contextMenuManagerInstance = this;
parentCanvas = GetComponentInParent<Canvas>();

indicatorImage = indicator.GetComponent<Image>();
indicatorOffColor = indicatorImage.color;
indicatorBaseColor = new Color(indicatorOffColor.r, indicatorOffColor.g, indicatorOffColor.b, .69f);
}
private void Update()
{
Expand Down Expand Up @@ -137,6 +145,8 @@ private void Update()
interactionName.text = null;
objectName.text = null;
}

indicatorImage.color = (selectedPetal == null) ? indicatorOffColor : indicatorBaseColor;
}

private void UpdateInteractions()
Expand Down

0 comments on commit 8796aef

Please sign in to comment.