private void SetInputer <I>(ref I target) { IParamNotice <IInputer> notice = target as IParamNotice <IInputer>; MainInputer = notice.ParamValue; MainInputer.CommitAfterSetToServer(); }
public virtual void Init() { Grid = CreateGrid(); Grid.OnGetGridShapeAssets = GetGridAssets; Grid.GridID = transform.GetInstanceID(); Grid.ShouldLine = m_ShouldLine; Grid.GridTrans = transform; Grid.GridBg = m_GridBg; Grid.IsObstacle = m_IsObstacle; Grid.GridType = m_GridTypeValue; Grid.GridSprite = m_Grid; Grid.GridLocalScale = m_GridScale; Grid.GridLocalPosition = m_GridLocalPosOffset; Grid.GridCollider = m_GridCollider; Grid.LineRenderer = m_GridLineRenderer; GetGridAssets(Grid, Grid.GridType); IParamNotice <ElimlnateGrid> notice = Pooling <ParamNotice <ElimlnateGrid> > .From(); notice.ParamValue = Grid; int noticeName = GetInstanceID(); noticeName.Broadcast(notice); notice.ToPool(); }
private void SetUserFWRole(ref IParamNotice <ICommonRole> target) { IParamNotice <ICommonRole> notice = target as IParamNotice <ICommonRole>; IFWRole role = notice.ParamValue as IFWRole; FWPlayerData data = mRelater.DataRef <FWPlayerData>(FWConsts.DATA_PLAYER); data.SetCurrentRole(role); }
public static P DeliveParam <P>(this string serverName, string resolverName, string alias, ResolveDelegate <IParamNotice <P> > customResolver = default, bool isMakeResolver = false, bool isReregister = false) { IParamNotice <P> notice = Delive(serverName, resolverName, alias, customResolver, isMakeResolver, isReregister); P result = notice.ParamValue; serverName.Revert(alias, notice); return(result); }
private void AddCampRole(ref IParamNotice <ICommonRole> target) { Debug.Log(target.ParamValue); var data = mRelater.DataRef <FWGameData>(FWConsts.DATA_GAME); data.AddCampRole(target.ParamValue as IFWRole); target.ParamValue.Name = "Role_" + mRoleIndex; mRoleIndex++; }
private void OnUIReady(INoticeBase <int> param) { int id = gameObject.GetInstanceID(); id.Remove(OnUIReady); IParamNotice <MonoBehaviour> notice = param as IParamNotice <MonoBehaviour>; notice.ParamValue = this; }
override protected void OnRoleNotices(INoticeBase <int> obj) { IParamNotice <int> notice = obj as IParamNotice <int>; switch (notice.ParamValue) { case FWConsts.NOTICE_PLAYER_ROLE_CHOOSEN: FWConsts.SERVER_FW_LENS.DeliveParam <FWCamerasServer, FWRoleComponent>("SetChoosenPlayer", "PlayerRoleChoosen", OnRoleChoosen); break; } }
public override void GetDataProxyHandler(IParamNotice <IDataProxy[]> param) { base.GetDataProxyHandler(param); param.ParamValue = new IDataProxy[] { new PlayerData(), new ConfigsData(), new BattleData(), }; }
/// <summary> /// UI 就绪的消息处理函数 /// </summary> /// <param name="param"></param> private void OnUIReady(INoticeBase <int> param) { mInstanceID.Remove(OnUIReady); IParamNotice <MonoBehaviour> notice = param as IParamNotice <MonoBehaviour>; if (notice != default) { notice.ParamValue = GetUIReadyParam(); } else { } }
override public void OnDataChanged(IData data, int keyName) { base.OnDataChanged(data, keyName); switch (keyName) { case FWConsts.DC_PLAYER_ROLE_CHOOSEN: FWPlayerData playerData = data as FWPlayerData; IParamNotice <int> paramNotice = Resolve <IParamNotice <int> >("Int"); paramNotice.ParamValue = FWConsts.NOTICE_PLAYER_ROLE_CHOOSEN; //int msg = playerData.PlayerCurrentRole.ID;//.SourceID; playerData.PlayerCurrentRole.Dispatch(paramNotice); //TODO 单机版应该不会有这个需求了 //msg.Broadcast(paramNotice); break; } }
private void OnNewGridCreated(INoticeBase <int> param) { int noticeName = param.Name; noticeName.Remove(OnNewGridCreated); IParamNotice <ElimlnateGrid> notice = param as IParamNotice <ElimlnateGrid>; ElimlnateGrid grid = notice.ParamValue; GridCreateInfo info = mGridCreatingInfo[noticeName]; int col = info.column, row = info.row; #if LOG_GRID_CREATED "OnNewGridCreated, pos = {0},{1}".Log(col.ToString(), row.ToString()); #endif grid.SetGridPos(info.column, info.row); grid.GridTrans.SetParent(mGridParent); grid.SetColliderSize(CellSize); grid.SetCreateInfo(info); grid.AddDestroyCallback((g) => { info.Clear(); mGridCreatingInfo.Remove(noticeName); }); string name = grid.GridTrans.name; grid.GridTrans.name = name.Append("@[", row.ToString(), "_", col.ToString(), "] #", grid.GridShapeIndex.ToString());//Sample: @[行,列] #图案索引 if (!mElimiGamePlay.BoardGrids.HasEnoughGrids()) { CreateGridOperateUI?.Invoke(grid); } else { } mElimiGamePlay.BoardGrids.SetGridMapper(new Vector2Int(col, row), grid, false); info.GridCommit(grid); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { IsDuringState = true; mNoticeName = animator.GetInstanceID(); mNotice = Pooling <ParamNotice <AniStateBehaviour> > .From(); mNotice.ParamValue = this; if (m_ApplyFSM) { mParamName = m_AniSubgroup.ParamName; } else { } m_MotionCompleted = 0; SendAniStateNotice(); StateEffectsEntered(); }
private void OnSetLens(ref IParamNotice <ICamerLens> target) { IParamNotice <ICamerLens> notice = target as IParamNotice <ICamerLens>; notice.ParamValue = this; }
/// <summary> /// 响应获取IoC各个服务容器事件的处理函数 /// </summary> /// <param name="param">消息对象,持有待处理的各个IoC服务容器对象</param> public virtual void GetGameServersHandler(IParamNotice <IServer[]> param) { }
/// <summary> /// 响应获取数据层各个代理对象事件的处理函数 /// </summary> /// <param name="param">消息对象,持有待处理的各个数据代理对象</param> public virtual void GetDataProxyHandler(IParamNotice <IDataProxy[]> param) { }
/// <summary> /// 响应初始化用户对象事件的处理函数,用于向用户数据填充源自数据代理部分的内容 /// </summary> /// <param name="param">消息对象,持有可能用到的数据代理名</param> public virtual void InitProfileHandler(IParamNotice <int[]> param) { }
/// <summary> /// 响应获取服务容器别名解析配置事件的处理函数 /// </summary> /// <param name="param">消息对象,持有待处理的别名解析配置</param> public virtual void GetServerConfigsHandler(IParamNotice <IResolvableConfig[]> param) { }
private void IntParamerResolver(ref IParamNotice <int> target) { }
private void GetInputerParamer(ref IParamNotice <IInputer> target) { target.ParamValue = MainInputer; }
private void SetInputerParamer(ref IParamNotice <IInputer> target) { }
private void ReleaseNotice() { mNotice?.ToPool(); mNotice = default; }
private void V3ParamerResolver(ref IParamNotice <Vector3> target) { }
private void SetBoolFalse(ref IParamNotice <bool> target) { target.ParamValue = false; }
private void SetBoolTrue(ref IParamNotice <bool> target) { target.ParamValue = true; }
private void PlayerRoleChoosenParamer(ref IParamNotice <FWRoleComponent> target) { }
private void SetLensParamer(ref IParamNotice <ICamerLens> target) { }
public INoticeBase <int> NotifyModularWithParam <T>(int noticeName, T param = default, IParamNotice <T> notice = default) { INoticeBase <int> temp = notice != default ? notice as INoticeBase <int> : default; BeforeNotifyModular(noticeName, ref temp, out INoticeBase <int> result); if (result is IParamNotice <T> noticeWithParam) { noticeWithParam.ParamValue = param; DuringNotifyModular(noticeName, ref result); } else { #if LOG_MODULARS "error".Log("Notice param type do not match..".Append(" notice = ", noticeName.ToString())); #endif } return(result); }
private void AddConfigCreater(ref IParamNotice <string> target) { SetConfigCreater(target.ParamValue); }
private void StringParamerResolver(ref IParamNotice <string> target) { }
private void BoolParamerResolver(ref IParamNotice <bool> target) { }