//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Wednesday, October 18, 2017
|
//--------------------------------------------------------
|
using UnityEngine;
|
using System.Collections;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
|
public class TeamApplyEntrance : MonoBehaviour
|
{
|
[SerializeField] Button m_ApplyList;
|
|
TeamModel model { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
|
|
public void Init()
|
{
|
OnApplyChange();
|
|
m_ApplyList.RemoveAllListeners();
|
m_ApplyList.AddListener(OpenInvitations);
|
model.applicationsChangeEvent += OnApplyChange;
|
}
|
|
public void UnInit()
|
{
|
model.applicationsChangeEvent -= OnApplyChange;
|
}
|
|
private void OpenInvitations()
|
{
|
WindowCenter.Instance.Open<TeamApplicationWin>();
|
|
}
|
|
private void OnApplyChange()
|
{
|
if (CrossServerUtility.IsCrossServer() || ClientCrossServerOneVsOne.isClientCrossServerOneVsOne)
|
{
|
m_ApplyList.SetActive(false);
|
}
|
else
|
{
|
m_ApplyList.SetActive(model.applications.Count > 0);
|
}
|
}
|
|
}
|
|
}
|