//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Friday, June 15, 2018
|
//--------------------------------------------------------
|
using UnityEngine;
|
using System.Collections;
|
using UnityEngine.UI;
|
|
|
namespace Snxxz.UI
|
{
|
|
public class OffLineTimeLackBehaviour : MonoBehaviour, IInGamePush
|
{
|
[SerializeField] ItemBehaviour m_ItemBehaviour;
|
[SerializeField] Button m_Close;
|
[SerializeField] Button m_Supplement;
|
|
OffLineTimeLackModel model { get { return ModelCenter.Instance.GetModel<OffLineTimeLackModel>(); } }
|
PackModel playerPackModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
|
|
private void Awake()
|
{
|
m_ItemBehaviour.SetItem(new Item(952, 0));
|
|
m_Close.AddListener(Close);
|
m_Supplement.AddListener(Supplement);
|
}
|
|
private void Close()
|
{
|
this.gameObject.SetActive(false);
|
model.hasRemindOffLineTimeLack = true;
|
}
|
|
private void Supplement()
|
{
|
var own = playerPackModel.GetItemCountByID(PackType.Item, 952);
|
if (own > 0)
|
{
|
var guid = playerPackModel.GetItemGUIDByID(952);
|
ItemTipUtility.Show(guid);
|
}
|
else
|
{
|
var config = StoreConfig.Get(53);
|
storeModel.OnClickShopCell(config);
|
}
|
|
model.hasRemindOffLineTimeLack = true;
|
this.gameObject.SetActive(false);
|
}
|
|
public int GetSiblingIndex()
|
{
|
return transform.GetSiblingIndex();
|
}
|
|
public bool IsActive()
|
{
|
return transform.gameObject.activeSelf;
|
}
|
|
}
|
|
}
|
|
|
|