您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
28 行
742 B
28 行
742 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
[RequireComponent(typeof(Selectable))]
|
|
public class HighlightEntry : MonoBehaviour, ISelectHandler, IDeselectHandler
|
|
{
|
|
public Image MenuEntryBackgroundImage;
|
|
public Color Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f);
|
|
public Color Selected = new Color(2.0f, 2.0f, 2.0f, 1.0f);
|
|
|
|
public void OnEnable()
|
|
{
|
|
MenuEntryBackgroundImage.color = Normal;
|
|
}
|
|
|
|
public void OnDeselect(BaseEventData eventData)
|
|
{
|
|
MenuEntryBackgroundImage.color = Normal;
|
|
}
|
|
|
|
public void OnSelect(BaseEventData eventData)
|
|
{
|
|
MenuEntryBackgroundImage.color = Selected;
|
|
}
|
|
}
|