e774581bfe
- 引入DoTween - 实现功能
36 lines
745 B
C#
36 lines
745 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using OCES.Audio;
|
|
using UnityEngine.Audio;
|
|
|
|
namespace OCES
|
|
{
|
|
public class ButtonInvoker : MonoBehaviour
|
|
{
|
|
public GameState targetGameState;
|
|
public bool enableLowpass;
|
|
|
|
Button m_button;
|
|
|
|
void Awake()
|
|
{
|
|
this.m_button = GetComponent<Button>();
|
|
|
|
|
|
this.m_button.onClick.AddListener(ButtonPressed);
|
|
}
|
|
|
|
void OnDestroy()
|
|
{
|
|
this.m_button.onClick.RemoveListener(ButtonPressed);
|
|
}
|
|
|
|
private void ButtonPressed()
|
|
{
|
|
AudioSystem.Instance.SetState(this.targetGameState);
|
|
|
|
AudioSystem.Instance.SetLowpass(this.enableLowpass);
|
|
}
|
|
}
|
|
}
|