popcorn/popcorn/Assets/MainGameDebugView.cs

44 lines
1.1 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UniRx;
using UnityEngine;
using UnityEngine.UI;
public class MainGameDebugView : MonoBehaviour
{
[SerializeField] private Button showDebugButton;
[SerializeField] private Button closeDebugButton;
[SerializeField] private Button gameResetButton;
[SerializeField] private GameObject view;
private void Awake()
{
view.SetActive(true);
Observable.NextFrame().Subscribe(_ => view.SetActive(false));
}
// Start is called before the first frame update
void Start()
{
showDebugButton.OnClickAsObservable().Subscribe(_ =>
{
view.SetActive(true);
}).AddTo(this);
closeDebugButton.OnClickAsObservable().Subscribe(_ =>
{
view.SetActive(false);
}).AddTo(this);
gameResetButton.OnClickAsObservable().Subscribe(_ =>
{
view.SetActive(false);
}).AddTo(this);
}
// Update is called once per frame
void Update()
{
}
}