91 lines
2.1 KiB
C#
91 lines
2.1 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using Games.Item;
|
|
using System.Collections.Generic;
|
|
using GCGame.Table;
|
|
using Games.GlobeDefine;
|
|
|
|
public class PKSetRoot : MonoBehaviour
|
|
{
|
|
public Toggle[] m_Toggles;
|
|
public InputOutView DescView;
|
|
public Text TipText;
|
|
string[] tips = new string[] { "#{4707}", "#{4708}", "#{4709}", "#{4710}" };
|
|
public void OnEnable()
|
|
{
|
|
for(int i=0;i<m_Toggles.Length;i++)
|
|
{
|
|
m_Toggles[i].isOn = false;
|
|
}
|
|
|
|
if(GameManager.gameManager.PlayerDataPool.PkModle<m_Toggles.Length)
|
|
{
|
|
m_Toggles[GameManager.gameManager.PlayerDataPool.PkModle].isOn = true;
|
|
}
|
|
DescView.Add(1, true, CloseWindow);
|
|
}
|
|
|
|
public void CloseWindow()
|
|
{
|
|
if(_PKInfo.gameObject.activeSelf)
|
|
{
|
|
_PKInfo.gameObject.SetActive(false);
|
|
return;
|
|
}
|
|
UIManager.CloseUI(UIInfo.PKSetInfo);
|
|
}
|
|
|
|
public void Toggle()
|
|
{
|
|
for (int i = 0; i < m_Toggles.Length; i++)
|
|
{
|
|
if (m_Toggles[i].isOn)
|
|
{
|
|
TipText.text = StrDictionary.GetClientDictionaryString(tips[i]);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetPKModel()
|
|
{
|
|
for(int i=0;i< m_Toggles.Length;i++)
|
|
{
|
|
if(m_Toggles[i].isOn)
|
|
{
|
|
if (GameManager.gameManager.PlayerDataPool.PkModle == i)
|
|
{
|
|
CloseWindow();
|
|
return;
|
|
}
|
|
PlayerFrameLogic.Instance().SendNewPKModle(i);
|
|
CloseWindow();
|
|
return;
|
|
}
|
|
}
|
|
CloseWindow();
|
|
}
|
|
|
|
public void PKModeDesc()
|
|
{
|
|
if(_PKInfo!=null && _PKInfo.gameObject.activeInHierarchy)
|
|
{
|
|
_PKInfo.gameObject.SetActive(false);
|
|
return;
|
|
}
|
|
InitText();
|
|
}
|
|
#region
|
|
|
|
public UIDynamicText _PKInfo;
|
|
|
|
private void InitText()
|
|
{
|
|
_PKInfo.gameObject.SetActive(true);
|
|
_PKInfo.SetText(StrDictionary.GetClientDictionaryString("#{4711}"));
|
|
}
|
|
|
|
#endregion
|
|
}
|