您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
34 行
870 B
34 行
870 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 Button _button = default;
|
|
|
|
PopupButtonType _currentType = default;
|
|
|
|
[SerializeField]
|
|
private IntEventChannelSO _buttonClickedEvent = default;
|
|
|
|
public void SetButton(PopupButtonType _type, PopupType popupType)
|
|
{
|
|
_currentType = _type;
|
|
_buttonText.StringReference.TableEntryReference = _currentType.ToString() + "_"+ popupType.ToString();
|
|
}
|
|
public void SelectButton()
|
|
{
|
|
_button.Select();
|
|
}
|
|
|
|
public void ButtonClicked()
|
|
{
|
|
int idType = (int)_currentType;
|
|
Debug.Log(idType);
|
|
_buttonClickedEvent.RaiseEvent(idType);
|
|
}
|
|
}
|