private void Awake() { Events = new NoticesObserver(); mMapper = new StringIntValueList(); mUIAreaNotice = Pooling <ParamNotice <UIDisplay> > .From(); mUIAreaNotice.SetNoticeName(N_UI_AREA_CHANGED); }
internal void UpdatePlayerTroops(Vector2Int troopsValue) { mTroopsNotice.ParamValue = troopsValue; mTroopsNotice.SetNoticeName(UIBattleModular.UI_UPDATE_TROOPS); this.Dispatch(mTroopsNotice); UpdatSubgroup("battleTroops"); }
internal void UpdatePlayerMorale(Vector2 moraleValue) { mMoraleNotice.ParamValue = moraleValue; mMoraleNotice.SetNoticeName(UIBattleModular.UI_UPDATE_MORALE); this.Dispatch(mMoraleNotice); UpdatSubgroup("battleMorale"); }
public void UpdatePlayerIntelligence(Vector2 value) { mIntelligenceNotice.ParamValue = value; mIntelligenceNotice.SetNoticeName(UIBattleModular.UI_UPDATE_INTELLIGENCE); this.Dispatch(mIntelligenceNotice); UpdatSubgroup("battleIntellige"); }
private void Awake() { Events = new NoticesObserver(); mChangedNotice = Pooling <ParamNotice <UIDisplay> > .From(); mChangedNotice.SetNoticeName(N_UI_DISPLAY_SELECTED); if (string.IsNullOrEmpty(m_GroupID)) { throw new Exception("UIDisplay group id do not allow empty."); } else { } }
/// <summary> /// 派发携带一个参数的观察者消息,并传入消息的参数 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="target"></param> /// <param name="noticeName"></param> /// <param name="vs"></param> /// <returns></returns> public static T Dispatch <T>(this INotificationSender target, int noticeName, T vs) { ParamNotice <T> notice = new ParamNotice <T> { ParamValue = vs }; notice.SetNoticeName(noticeName); notice.NotifcationSender = target; NotificatonsInt.Instance.Notificater.Dispatch(notice); T result = notice.ParamValue; notice.Dispose(); return(result); }