// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-06-16 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using UnityEngine; using UnityEngine.UI; namespace G.UI { /// /// /// public class GemSelectWidget : KUIWidget { #region Field #pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null [KUIFlag] Button _btnFrame; [KUIFlag] GameObject _goSignined; [KUIFlag] Image _imgIcon; #pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null #endregion #region Method public override void Refresh() { if (this.data is EntityItemGem gem) { IconProxy.Instance.SetSprite(_imgIcon, gem.propItem.icon); _goSignined.SetActive(true); } } public bool IsSelect() { return _goSignined.activeSelf; } private void OnFrameBtnClick() { _goSignined.SetActive(!_goSignined.activeSelf); PostNotification(GlobalDefine.EVENT_GEM_FILTER_CHANGED, this, this.name); } #endregion #region Unity /// /// /// private void Awake() { SetViewData(); _btnFrame.onClick.AddListener(this.OnFrameBtnClick); } #endregion } }