Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIButtonHighlighter.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3
4public class UIButtonHighlighter : MonoBehaviour
5{
6 public Func<bool> killCondition;
7
9
10 public Sprite sprite;
11
12 public void Set(Func<bool> _killCondition)
13 {
14 killCondition = _killCondition;
15 button = GetComponent<UIButton>();
16 sprite = button.image.sprite;
17 button.image.sprite = button.spriteState.highlightedSprite;
18 }
19
20 private void Update()
21 {
22 if (killCondition())
23 {
24 button.image.sprite = sprite;
25 UnityEngine.Object.Destroy(this);
26 }
27 }
28}
Func< bool > killCondition
void Set(Func< bool > _killCondition)