using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
|
public class DebugRoot : MonoBehaviour
|
{
|
[SerializeField] RectTransform m_DebugBasic;
|
[SerializeField] RectTransform m_Trigger;
|
|
float lastClickTime = 0f;
|
int clickIndex = 0;
|
float duration = 5f;
|
|
bool alreadyOpen = false;
|
|
private void Awake()
|
{
|
if (DebugUtility.Instance.debugAccount)
|
{
|
m_DebugBasic.SetActive(true);
|
m_Trigger.SetActive(true);
|
alreadyOpen = true;
|
}
|
else
|
{
|
m_DebugBasic.SetActive(false);
|
m_Trigger.SetActive(false);
|
alreadyOpen = false;
|
}
|
}
|
|
private void LateUpdate()
|
{
|
if (alreadyOpen)
|
{
|
return;
|
}
|
|
if (DebugUtility.Instance.isWhiteListAccount)
|
{
|
if (Input.GetMouseButtonDown(0))
|
{
|
if (RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, Input.mousePosition, CameraManager.uiCamera))
|
{
|
if (Time.time - lastClickTime > duration)
|
{
|
clickIndex = 1;
|
lastClickTime = Time.time;
|
}
|
else
|
{
|
clickIndex++;
|
}
|
|
if (clickIndex >= 10)
|
{
|
m_DebugBasic.SetActive(true);
|
m_Trigger.SetActive(true);
|
alreadyOpen = true;
|
}
|
|
}
|
}
|
}
|
|
}
|
|
|
}
|