You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
887 B
41 lines
887 B
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.Events; |
|
using UnityEngine.Serialization; |
|
|
|
public class ButtonFocusItem : MonoBehaviour |
|
{ |
|
public GameObject In; |
|
public GameObject Out; |
|
|
|
public void Focus(bool IN = true) |
|
{ |
|
if (IN) |
|
{ |
|
In.SetActive(true); |
|
Out.SetActive(false); |
|
} |
|
else |
|
{ |
|
In.SetActive(false); |
|
Out.SetActive(true); |
|
} |
|
} |
|
|
|
[System.Serializable] |
|
public class SelectEvent : UnityEvent { } |
|
[FormerlySerializedAs("onSelect")] |
|
[SerializeField] |
|
[Space(10)] |
|
private SelectEvent m_OnSelect = new SelectEvent(); |
|
public SelectEvent OnSelect |
|
{ |
|
get { return m_OnSelect; } |
|
set { m_OnSelect = value; } |
|
} |
|
public void OnFocusSelect() |
|
{ |
|
OnSelect.Invoke(); |
|
} |
|
}
|
|
|