| | |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class DogzEliteMonsterBehaviour:MonoBehaviour { |
| | | public class DogzEliteMonsterBehaviour : MonoBehaviour |
| | | { |
| | | [SerializeField] Text m_Elite; |
| | | [SerializeField] RawImage m_RawImage; |
| | | |
| | | DogzDungeonModel model { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } } |
| | | |
| | | public void Display() |
| | | { |
| | | UI3DModelExhibition.Instance.BeginShowNPC(999, Vector3.zero, m_RawImage); |
| | | DisplayGuardSurplusInfo(); |
| | | model.boxSurplusChangeEvent += OnGuardInfoUpdate; |
| | | } |
| | | |
| | | public void Dispose() |
| | | { |
| | | model.boxSurplusChangeEvent -= OnGuardInfoUpdate; |
| | | UI3DModelExhibition.Instance.StopShowNPC(); |
| | | } |
| | | |
| | | private void OnGuardInfoUpdate() |
| | | { |
| | | DisplayGuardSurplusInfo(); |
| | | } |
| | | |
| | | private void DisplayGuardSurplusInfo() |
| | | { |
| | | var guard = model.dogzDungeonGuard; |
| | | m_Elite.text = guard.guardSurplus.ToString(); |
| | | m_Elite.color = UIHelper.GetUIColor(guard.guardSurplus > 0 ? TextColType.White : TextColType.Red); |
| | | } |
| | | |
| | | } |
| | | |