//--------------------------------------------------------
|
// [Author]: Mechanist Games
|
// [ Date ]: Wednesday, August 09, 2017
|
//--------------------------------------------------------
|
using UnityEngine;
|
using System.Collections;
|
using UnityEngine.UI;
|
using Snxxz.UI;
|
|
|
namespace Dmyx.UI
|
{
|
|
public class DebugController : MonoBehaviour
|
{
|
|
[SerializeField] FPS m_Fps;
|
[SerializeField] Toggle m_ToggleFPS;
|
|
[SerializeField] DebugVersionShow m_DebugVersion;
|
[SerializeField] Toggle m_ToggleVersion;
|
|
private void OnEnable()
|
{
|
if (m_Fps != null)
|
{
|
m_Fps.gameObject.SetActive(m_ToggleFPS.isOn);
|
}
|
|
m_ToggleFPS.RemoveAllListeners();
|
m_ToggleFPS.AddListener(ToggleFPS);
|
|
if (m_DebugVersion != null)
|
{
|
m_DebugVersion.gameObject.SetActive(m_ToggleVersion.isOn);
|
}
|
|
m_ToggleVersion.RemoveAllListeners();
|
m_ToggleVersion.AddListener(ToggleVersion);
|
}
|
|
void ToggleFPS(bool _value)
|
{
|
if (m_Fps != null)
|
{
|
m_Fps.gameObject.SetActive(_value);
|
}
|
}
|
|
void ToggleVersion(bool _value)
|
{
|
if (m_DebugVersion != null)
|
{
|
m_DebugVersion.gameObject.SetActive(_value);
|
}
|
}
|
|
public void OpenGM()
|
{
|
if (!WindowCenter.Instance.IsOpen<GMInputWin>())
|
{
|
WindowCenter.Instance.Open<GMInputWin>();
|
}
|
}
|
|
public void OpenGMCommond()
|
{
|
WindowCenter.Instance.Open<GMCmdPanel>();
|
}
|
|
public void SendSpecialCTG()
|
{
|
var model = ModelCenter.Instance.GetModel<VipModel>();
|
var list = model.GetCTGConfigs(VersionConfig.Get().appId);
|
for (int i = 0; i < list.Count; i++)
|
{
|
var config = CTGConfig.Get(list[i]);
|
if (config.PayType == 4)
|
{
|
model.CTG(config.RecordID);
|
return;
|
}
|
}
|
}
|
|
public void PrintLastCrashLog()
|
{
|
if (CrashReport.lastReport != null)
|
{
|
DebugEx.LogFormat("崩溃日志:{0}", CrashReport.lastReport);
|
}
|
}
|
|
}
|
|
}
|
|
|
|