您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
39 行
941 B
39 行
941 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.Localization.Components;
|
|
using UnityEngine.Localization.Tables;
|
|
|
|
public class UIPopupButtonSetter : MonoBehaviour
|
|
{
|
|
[SerializeField] private LocalizeStringEvent _buttonText = default;
|
|
[SerializeField] private MultiInputButton _button = default;
|
|
|
|
PopupButtonType _currentType = default;
|
|
|
|
[SerializeField]
|
|
private IntEventChannelSO _buttonClickedEvent = default;
|
|
|
|
public void SetButton(PopupButtonType _type, PopupType popupType, bool isSelected)
|
|
{
|
|
_currentType = _type;
|
|
_buttonText.StringReference.TableEntryReference = _currentType.ToString() + "_"+ popupType.ToString();
|
|
|
|
if(isSelected)
|
|
SelectButton();
|
|
|
|
}
|
|
|
|
void SelectButton()
|
|
{
|
|
_button.Select();
|
|
_button.UpdateSelected();
|
|
}
|
|
|
|
public void ButtonClicked()
|
|
{
|
|
int idType = (int)_currentType;
|
|
_buttonClickedEvent.RaiseEvent(idType);
|
|
}
|
|
}
|