mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-29 19:03:10 +00:00
37 lines
1001 B
C#
37 lines
1001 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using OpenMetaverse;
|
|
using OpenMetaverse.Stats;
|
|
using Plugins.CommonDependencies;
|
|
using Raindrop.Presenters;
|
|
using Raindrop.Services;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
using Logger = OpenMetaverse.Logger;
|
|
|
|
[RequireComponent(typeof(Button))]
|
|
public class ButtonTriggerModal : MonoBehaviour
|
|
{
|
|
private Button button;
|
|
[SerializeField]
|
|
public GameObject modal;
|
|
// Start is called before the first frame update
|
|
void Awake()
|
|
{
|
|
button = GetComponent<Button>();
|
|
button.onClick.AddListener(OnButtonDown);
|
|
}
|
|
|
|
private void OnButtonDown()
|
|
{
|
|
if (modal == null)
|
|
{
|
|
Logger.Log("modal not implemented/link", Helpers.LogLevel.Error);
|
|
ModalsManager.PushModal_NotImplementedYet(this.gameObject.name.ToString() + " modal");
|
|
return;
|
|
}
|
|
ServiceLocator.Instance.Get<UIService>().ModalsManager.Show(modal);
|
|
}
|
|
}
|