这是第一个 Unity 开放项目的repo,是 Unity 和社区合作创建的一个小型开源游戏演示,第一款游戏是一款名为 Chop Chop 的动作冒险游戏。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

37 行
1.1 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIPauseScreenSetter : MonoBehaviour
{
[SerializeField] private UIButtonSetter _unpauseButton = default;
[SerializeField] private UIButtonSetter _settingsButton = default;
[SerializeField] private UIButtonSetter _backToMenuButton = default;
[SerializeField] private Button _closeButton = default;
[SerializeField] private VoidEventChannelSO _clickUnpauseEvent = default;
[SerializeField] private VoidEventChannelSO _clickSettingsEvent = default;
[SerializeField] private VoidEventChannelSO _clickBackToMenuEvent = default;
[SerializeField] private InputReader _inputReader = default;
private void Start()
{
_closeButton.onClick.RemoveAllListeners();
_closeButton.onClick.AddListener(() => { _clickUnpauseEvent.RaiseEvent(); });
_inputReader.closePopupEvent += _clickUnpauseEvent.RaiseEvent;
}
public void SetPauseScreen()
{
_unpauseButton.SetButton(_clickUnpauseEvent, true);
_settingsButton.SetButton(_clickSettingsEvent, false);
_backToMenuButton.SetButton(_clickBackToMenuEvent, false);
}
}