Skip to content

Commit

Permalink
Fixed forward/backward button interactable states
Browse files Browse the repository at this point in the history
  • Loading branch information
TomSimons committed Oct 8, 2024
1 parent ebb933d commit db524ed
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 94 deletions.
5 changes: 3 additions & 2 deletions Assets/Scripts/UI/MatchSpriteToSelectionState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class MatchSpriteToSelectionState : MonoBehaviour
{
[SerializeField] private Selectable targetSelectable;
private Image image;
private Sprite normalSprite;
[SerializeField] private Sprite highlightedSprite;
[SerializeField] private Sprite pressedSprite;
[SerializeField] private Sprite selectedSprite;
Expand All @@ -24,8 +23,10 @@ private void Awake()

private void Update()
{
if (!targetSelectable.image)
if (!targetSelectable.targetGraphic)
{
return;
}

if (targetSelectable.image.overrideSprite == targetSelectable.spriteState.highlightedSprite)
image.overrideSprite = highlightedSprite;
Expand Down
49 changes: 18 additions & 31 deletions Assets/_Functionalities/Sun/Prefabs/SunInspector.prefab

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit db524ed

Please sign in to comment.