+ 타이틀 씬 교체 + 타이틀 씬 오브젝트 및 Ui 수정 + 타이틀 씬 스파인 풀 속도 각각 다르게 설정 + 타이틀 씬 Player Input 변경
56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
namespace BlueWater.Titles
|
|
{
|
|
public class TitleMenuButton : MonoBehaviour, ISelectHandler, IDeselectHandler, IPointerEnterHandler, IPointerExitHandler
|
|
{
|
|
[SerializeField, Required]
|
|
private Button _targetButton;
|
|
|
|
[SerializeField, Required]
|
|
private Image _selectedImage;
|
|
|
|
[SerializeField]
|
|
private Color _highlightedColor;
|
|
|
|
private Color _originalColor;
|
|
|
|
private void Start()
|
|
{
|
|
_originalColor = _selectedImage.color;
|
|
}
|
|
|
|
public void OnSelect(BaseEventData eventData)
|
|
{
|
|
_selectedImage.color = _originalColor;
|
|
_selectedImage.enabled = true;
|
|
}
|
|
|
|
public void OnDeselect(BaseEventData eventData)
|
|
{
|
|
_selectedImage.enabled = false;
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
if (EventSystem.current.currentSelectedGameObject == gameObject) return;
|
|
|
|
_selectedImage.color = _highlightedColor;
|
|
_selectedImage.enabled = true;
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
if (EventSystem.current.currentSelectedGameObject == gameObject) return;
|
|
|
|
_selectedImage.color = _originalColor;
|
|
_selectedImage.enabled = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
|