public static ScopeChecker GetScopeChecker(float minDist, float angle) { ScopeChecker result = Pooling <ScopeChecker> .From(); result.Reinit(minDist, angle); return(result); }
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(); }
/// <summary> /// 派发观察者消息 /// </summary> /// <param name="target"></param> /// <param name="noticeName"></param> /// <param name="notice"></param> public static void Dispatch(this INotificationSender target, int noticeName, INoticeBase <int> notice = default) { bool defaultNotice = notice == default; if (defaultNotice) { notice = Pooling <Notice> .From(); } else { } notice.SetNoticeName(noticeName); notice.NotifcationSender = target; NotificatonsInt.Instance.Notificater.Dispatch(notice); if (defaultNotice) { Pooling <Notice> .To(notice as Notice); } else { } }
public override void Init() { base.Init(); ShipDockApp app = ShipDockApp.Instance; Datas = app.Datas; ABs = app.ABs; UIs = app.UIs; if (mUI == default) { GameObject prefab = ABs.Get(ABName, UIAssetName); GameObject ui = UnityEngine.Object.Instantiate(prefab, UIs.UIRoot.MainCanvas.transform); ParamNotice <MonoBehaviour> notice = Pooling <ParamNotice <MonoBehaviour> > .From(); int id = ui.GetInstanceID(); id.Broadcast(notice); mUI = (T)notice.ParamValue; notice.ToPool(); } else { } UILayer layer = mUI.GetComponent <UILayer>(); SetUIParent(ref layer); mUI.Add(UIModularHandler); }
private INoticeBase <int> OnAIChoosePlayerCardHeroCreate(int noticeName) { HeroNotice heroNotice = Pooling <HeroNotice> .From(); heroNotice.camp = Consts.CAMP_PLAYER; return(heroNotice); }
protected override void Start() { base.Start(); if (m_ApplyInitSelf) { IUIStack stack = CreateModular(); if (stack != default) { UIs.Open <UIStack>(stack.Name, () => { UIs.BindResourcesUIToStack(stack, gameObject, ActiveSelfControlHide); return(stack); }); } else { } ParamNotice <MonoBehaviour> notice = Pooling <ParamNotice <MonoBehaviour> > .From(); int noticeName = GetInstanceID(); noticeName.Broadcast(notice); notice.ToPool(); } else { } }
private void SendLoadedNotice() { if (m_LoadedNoticeInfo.IsSendIDAsNotice && !m_LoadedNoticeInfo.IsReadyNoticeSend) { if (m_LoadedNoticeInfo.ApplyDefaultNoticeType) { mIDAsNotice = Pooling <Notice> .From(); } else { ApplyCustomNotice(); } if (m_LoadedNoticeInfo.ApplyCallLate) { UpdaterNotice.SceneCallLater(SendLoadedNoticeAndRelease); } else { SendLoadedNoticeAndRelease(0); } } else { } }
void IPlatformSDK.Init() { if (mMessageBody == null) { ParamNotice <SDKMessages> notice = Pooling <ParamNotice <SDKMessages> > .From(); SDKMessages.N_GET_SDK_MESSAGES_REF.Broadcast(notice); mMessageBody = notice.ParamValue; Pooling <ParamNotice <SDKMessages> > .To(notice); } else { } if (mMainActivity == null) { using (AndroidJavaClass mClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) { mMainActivity = mClass.GetStatic <AndroidJavaObject>("currentActivity"); mMainActivity.Call("setUnityCallbackBody", mMessageBody.TargetName, mMessageBody.MethodName); } } else { } }
private INoticeBase <int> OnPlayerCardGenerateCreat(int noticeName) { CardNotice cardNotice = Pooling <CardNotice> .From(); cardNotice.camp = Consts.CAMP_PLAYER; return(cardNotice); }
public static void RemoveSceneUpdater(IUpdate target) { UpdaterNotice notice = Pooling <UpdaterNotice> .From(); notice.ParamValue = target; ShipDockConsts.NOTICE_REMOVE_SCENE_UPDATE.Broadcast(notice); Pooling <UpdaterNotice> .To(notice); }
public static void SceneCallLater(Action <int> target) { ParamNotice <Action <int> > notice = Pooling <ParamNotice <Action <int> > > .From(); notice.ParamValue = target; ShipDockConsts.NOTICE_SCENE_CALL_LATE.Broadcast(notice); Pooling <ParamNotice <Action <int> > > .To(notice); }
public static void AddUpdater(IUpdate target) { UpdaterNotice notice = Pooling <UpdaterNotice> .From(); notice.ParamValue = target; ShipDockConsts.NOTICE_ADD_UPDATE.Broadcast(notice); Pooling <UpdaterNotice> .To(notice); }
private void Awake() { Events = new NoticesObserver(); mMapper = new StringIntValueList(); mUIAreaNotice = Pooling <ParamNotice <UIDisplay> > .From(); mUIAreaNotice.SetNoticeName(N_UI_AREA_CHANGED); }
public static void AddUpdater(IUpdate target) { UpdaterNotice notice = Pooling <UpdaterNotice> .From(); notice.ParamValue = target; notice.SetNoticeName(ShipDockConsts.NOTICE_ADD_UPDATE); NotificatonsInt.Instance.Notificater.Broadcast(notice); notice.ToPool(); }
public static void SceneCallLater(Action <int> target) { SceneCallLaterNotice notice = Pooling <SceneCallLaterNotice> .From(); notice.ParamValue = target; notice.SetNoticeName(ShipDockConsts.NOTICE_SCENE_CALL_LATE); NotificatonsInt.Instance.Notificater.Broadcast(notice); notice.ToPool(); }
void IPlatformSDK.Init() { init(); onStart(); ParamNotice <SDKMessages> notice = Pooling <ParamNotice <SDKMessages> > .From(); SDKMessages.N_GET_SDK_MESSAGES_REF.Broadcast(notice); mMessageBody = notice.ParamValue; Pooling <ParamNotice <SDKMessages> > .To(notice); }
private void SetRoleCamp() { (mRole as FWRole).Camp = m_Camp; if (m_Camp == 0) { ParamNotice <RoleEntitas> notice = Pooling <ParamNotice <RoleEntitas> > .From(); notice.ParamValue = mRole; FWConsts.COMPONENT_ROLE_CONTROLLABLE.Broadcast(notice); Pooling <ParamNotice <RoleEntitas> > .To(notice); } }
private void SendRoleFSMStateNotifications(ref INotificationSender target, ref NotificationInfo[] list) { Notice notice = Pooling <Notice> .From(); int max = list.Length; for (int i = 0; i < max; i++) { target.Dispatch(list[i].noticeName, notice); } notice.ToPool(); }
private void OnAIChoosePlayerCardHero(INoticeBase <int> param) { Debug.Log("OnAIChoosePlayerCardHero 1"); HeroNotice notice = param as HeroNotice; AIRatioNotice AIRatioNotice = Pooling <AIRatioNotice> .From(); AIRatioNotice.camp = notice.camp; NotifyModular(Consts.N_SET_GENERAL_INTO_BATTLE_RATIO, AIRatioNotice); NotifyModular(Consts.N_COMMIT_PLAYER_AI, notice); AIRatioNotice.ToPool(); }
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 { } }
public override void Init() { base.Init(); Datas = ShipDockApp.Instance.Datas; ABs = ShipDockApp.Instance.ABs; UIs = ShipDockApp.Instance.UIs; GameObject prefab = ABs.Get(ABName, UIName); GameObject ui = Object.Instantiate(prefab, UIs.UIRoot.MainCanvas.transform); ParamNotice <MonoBehaviour> notice = Pooling <ParamNotice <MonoBehaviour> > .From(); int id = ui.GetInstanceID(); id.Broadcast(notice); mUI = (T)notice.ParamValue; Pooling <ParamNotice <MonoBehaviour> > .To(notice); }
private void OnSceneUpdateReady(INoticeBase <int> obj) { ShipDockConsts.NOTICE_SCENE_UPDATE_READY.Remove(OnSceneUpdateReady); MethodUpdater updater = ShipDockComponentManagerSetting.isMergeUpdateMode ? new MethodUpdater { Update = MergeComponentUpdateModeInScene } : new MethodUpdater { Update = SingleFrameComponentUpdateModeInScene }; UpdaterNotice notice = Pooling <UpdaterNotice> .From(); notice.ParamValue = updater; ShipDockConsts.NOTICE_ADD_SCENE_UPDATE.Broadcast(notice); Pooling <UpdaterNotice> .To(notice); }
void Init() { ParamNotice <SDKMessages> notice = Pooling <ParamNotice <SDKMessages> > .From(); SDKMessages.N_GET_SDK_MESSAGES_REF.Broadcast(notice); mMessageBody = notice.ParamValue; Pooling <ParamNotice <SDKMessages> > .To(notice); using (AndroidJavaClass mClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) { mMainActivity = mClass.GetStatic <AndroidJavaObject>("currentActivity"); } mMainActivity.Call("setUnityCallbackBody", mMessageBody.TargetName, mMessageBody.MethodName); mWechat = mMainActivity.Call <AndroidJavaObject>("getWXSDK"); mAlipay = mMainActivity.Call <AndroidJavaObject>("getAlipaySDK"); mNative = mMainActivity.Call <AndroidJavaObject>("getNativeUtil"); mSmartOralEva = mMainActivity.Call <AndroidJavaObject>("getSmartOral"); mTalkingData = mMainActivity.Call <AndroidJavaObject>("getTalkingData"); mTalkingData.Call("init", SDKMessages.SDKChannel); }
private void ApplyCustomNotice() { string methodName = m_LoadedNoticeInfo.GetIDAsCustomNoticeMethod; if (string.IsNullOrEmpty(methodName)) { mIDAsNotice = Pooling <Notice> .From(); } else { ILRuntimeUtils.InvokeMethodILR(ShellBridge, m_StartUpInfo.ClassName, methodName, 0, OnGetIDAsNoticeHandler); if (mIDAsNotice == default) { mIDAsNotice = Pooling <Notice> .From(); } else { } } }
// 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 Update() { if (isActive) { if (mFPSNotice == null) { mFPSNotice = Pooling <ParamNotice <int> > .From(); } else { } mFrameCount++; mTimeDelta = Time.realtimeSinceStartup - mLastShowTime; if (mTimeDelta >= showTimeGap) { mFPS = mFrameCount / mTimeDelta; mFrameCount = 0; mLastShowTime = Time.realtimeSinceStartup; } else { } mFrameRate = (int)mFPS; ShipDockConsts.NOTICE_FPS_SHOW.BroadcastWithParam(mFrameRate); if (m_FrameRateText != default) { mFrameRateValue = mFrameRate.ToString(); m_FrameRateText.text = mFrameRateValue; } else { } } else { } }
private void OnServersInit() { Components = new ShipDockComponentManager { FrameTimeInScene = (int)(UnityEngine.Time.deltaTime * 1000) }; MethodUpdater updater = ShipDockComponentManagerSetting.isMergeUpdateMode ? new MethodUpdater { Update = MergeComponentUpdateMode } : new MethodUpdater { Update = SingleFrameComponentUpdateMode }; UpdaterNotice notice = Pooling <UpdaterNotice> .From(); notice.ParamValue = updater; ShipDockConsts.NOTICE_ADD_UPDATE.Broadcast(notice); Pooling <UpdaterNotice> .To(notice); ShipDockConsts.NOTICE_SCENE_UPDATE_READY.Add(OnSceneUpdateReady); }
protected override IGameModel GetNewModel() { return(Pooling <DruggeryModel> .From()); }
protected override IGameModel GetNewModel() { return(Pooling <BlueprintModel> .From()); }
protected virtual IGameModel GetNewModel() { return(Pooling <GameModel> .From() as IGameModel); }