// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-03-10 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using System.Collections.Generic; using PureMVC.Interfaces; using UnityEngine; using UnityEngine.UI; namespace G.UI { /// /// /// public class RedPointWidget : KUIWidget { #region Field public RedPointType redPointType; public string redPointNode; #pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null [KUIFlag] GameObject _goPoint; #pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null #endregion #region Method private void SetState(bool state) { _goPoint.SetActive(state); } private void OnStateChanged(int state) { SetState(state > 0); } #endregion #region Unity /// /// /// private void Awake() { SetViewData(); //_goPoint.SetActive(false); } private void OnEnable() { RedPointProxy.Instance.AddListener(redPointType, redPointNode, this.OnStateChanged); } private void OnDisable() { RedPointProxy.Instance.RemoveLisnener(redPointType, redPointNode); } #endregion } }