using System;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
|
namespace vnxbqy.UI
|
{
|
public class DogzNotifyBehaviour : MonoBehaviour, IInGamePush
|
{
|
[SerializeField] Text titleText;
|
[SerializeField] Image dogzImg;
|
[SerializeField] Button gotoBtn;
|
[SerializeField] Button closeBtn;
|
DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
|
private void OnEnable()
|
{
|
closeBtn.AddListener(CloseNotify);
|
gotoBtn.AddListener(ClickGoto);
|
}
|
|
private void OnDisable()
|
{
|
closeBtn.RemoveAllListeners();
|
gotoBtn.RemoveAllListeners();
|
}
|
|
public void SetDisplay()
|
{
|
DogzConfig dogzConfig = DogzConfig.Get(dogzModel.dogzPutRedId);
|
if(dogzConfig == null)
|
{
|
CloseNotify();
|
}
|
else
|
{
|
this.SetActive(true);
|
dogzImg.SetSprite(dogzConfig.HeadIcon);
|
}
|
}
|
|
private void ClickGoto()
|
{
|
WindowCenter.Instance.Open<DogzWin>();
|
CloseNotify();
|
}
|
|
public void CloseNotify()
|
{
|
dogzModel.dogzPutRedId = 0;
|
this.SetActive(false);
|
}
|
|
public int GetSiblingIndex()
|
{
|
return transform.GetSiblingIndex();
|
}
|
|
public bool IsActive()
|
{
|
return transform.gameObject.activeSelf;
|
}
|
}
|
}
|