mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-27 22:11:39 +00:00
40 lines
835 B
C#
40 lines
835 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Lean.Gui;
|
|
using Raindrop;
|
|
using Raindrop.ServiceLocator;
|
|
using UnityEngine;
|
|
|
|
public class ButtonSound : MonoBehaviour
|
|
{
|
|
|
|
public RaindropInstance Instance => ServiceLocator.Instance.Get<RaindropInstance>();
|
|
|
|
private LeanButton btn;
|
|
void Awake()
|
|
{
|
|
try
|
|
{
|
|
btn = this.GetComponent<LeanButton>();
|
|
|
|
if (btn)
|
|
{
|
|
this.GetComponent<LeanButton>().OnClick.AddListener(OnClick);
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
OpenMetaverse.Logger.DebugLog(e.ToString());
|
|
}
|
|
}
|
|
|
|
private void OnClick()
|
|
{
|
|
if (btn.interactable)
|
|
{
|
|
Instance.MediaManager.PlayUISound(UISounds.Click);
|
|
}
|
|
}
|
|
}
|