public void RestartATaskAfterRunning() { UITaskSystem system = new UITaskSystem(); Func <UITask, float, UITaskResult> task0 = (UITask t, float d) => { if (t.FrameCount == 2) { return(UITaskResult.Restarted); } if (t.FrameCount == 4) { return(UITaskResult.Completed); } return(UITaskResult.Running); }; UITask task = system.AddTask(task0); system.OnUpdate(); Assert.AreEqual(1, system.ActiveTaskCount); Assert.AreEqual(UITaskState.Running, task.state); system.OnUpdate(); Assert.AreEqual(1, system.ActiveTaskCount); Assert.AreEqual(UITaskState.Restarting, task.state); system.OnUpdate(); system.OnUpdate(); Assert.AreEqual(0, system.ActiveTaskCount); Assert.AreEqual(UITaskState.Completed, task.state); }
//如果type = UITaskType.None,按玩家最近一次的选择显示 public static UITask Open(UITaskType type = UITaskType.None, System.Action callBack = null) { if (Instance == null) { Object prefab = PrefabLoader.loadFromPack("LS/MissionSys/MissionSysRoot"); if (prefab != null) { GameObject obj = Instantiate(prefab) as GameObject; RED.AddChild(obj, DBUIController.mDBUIInstance._TopRoot); obj.transform.localScale = Vector3.one; obj.transform.localPosition = Vector3.zero; obj.transform.localEulerAngles = Vector3.zero; Instance = obj.GetComponent <UITask>(); } } else { if (!Instance.gameObject.activeSelf) { Instance.gameObject.SetActive(true); } Instance.UIInit(); } Instance.exitCallBack = callBack; //if(type != UITaskType.None) Instance.curTaskType = type; return(Instance); }
public void LoadVillagesRemoveTest() { newVillages.RemoveAt(0); UITask.LoadVillages(villages, newVillages); Assert.AreEqual(AreTwoVillagesEqual(), true); }
public void LoadVillagesAddTest() { newVillages.Add(new Village(33, "name3", 30, 31, true, true)); UITask.LoadVillages(villages, newVillages); Assert.AreEqual(AreTwoVillagesEqual(), true); }
public void LoadVillagesUpdateTest() { newVillages[1] = new Village(2, "name22", 20, 21, true, true); UITask.LoadVillages(villages, newVillages); Assert.AreEqual(AreTwoVillagesEqual(), true); }
internal static IDisposable SetCurrentTask(UITask task) { Verify.ArgumentNotNull(task, "task"); var parentTask = CallContext.GetData(Key) as UITask; CallContext.SetData(Key, task); return new DisposableAction(() => ClearCurrentTask(parentTask)); }
private void WebView_IsLoadingChanged(object sender, EventArgs e) { if (!webView.IsLoading) { webView.EvalScript(File.ReadAllText(Path.Combine(client.BasePath, "jquery-1.12.4.min.js"))); client.Url = webView.Url; client.Html = webView.GetHtml(); client.HtmlAvailableSignal.Set(); UITask.LoadVillages(webView.GetHtml()); UITask.GetUpdatedActivedVillage(webView.GetHtml()); if (webView.Url.Contains(UriGenerator.UrlSuburbs) || webView.Url.Contains(UriGenerator.UrlCity)) { UITask.LoadCurrentBuildings(webView.GetHtml()); // var village = client.Villages.Where(v => v.IsActive == true).FirstOrDefault(); if (village != null) { foreach (var building in village.Buildings) { client.Logger.Write($"{building.VillageId} {building.BuildingId:00} {building.BuildingType} {building.Level}"); } } // } MessageBox.Show("loaded"); } }
public void OnOpenTask() { this.DisAppear(); UITask ui = UIManager.Instance.GetUI <UITask> (); ui.Appear(); }
// Clears out the current task -- called from the disposable action. private static void ClearCurrentTask(UITask parentTask) { CallContext.SetData(Key, parentTask); if (parentTask == null) { CallContext.FreeNamedDataSlot(Key); } }
public void LoadVillagesAllTest() { newVillages.RemoveAt(1); newVillages.Add(new Village(33, "name3", 30, 31, true, true)); newVillages[0] = new Village(11, "name11", 11, 12, true, false); UITask.LoadVillages(villages, newVillages); Assert.AreEqual(AreTwoVillagesEqual(), true); }
public Worker() { // get the associated UITask, if any _task = UITask.Current; // Start with the synchronization context for the curren task. // Most applications will have the Worker created on the UI thread. SynchronizationContext = SynchronizationContext.Current; }
public void UIDestory() { if (exitCallBack != null) { exitCallBack(); } Destroy(gameObject); Instance = null; }
public TaskAwareSessionManager(ISessionFactoryResolver sessionFactoryResolver) : base(sessionFactoryResolver) { // Keep track of the task that was current when this object was created. // For this reason this class needs to be registered as Transient with the // Castle container. _currentTaskAtCreation = UITask.Current; if (_currentTaskAtCreation != null) { // When the task completes, forget about it. _currentTaskAtCreation.TaskComplete += (sender, args) => _currentTaskAtCreation = null; } }
private static SessionHolder GetSessionHolder(UITask task, string alias) { var sessionHolder = task.GetTaskLifetimeObject<SessionHolder>(alias); if (sessionHolder == null) { sessionHolder = new SessionHolder { ShouldHaveSession = HasSessionAttribute(task) }; task.SetTaskLifetimeObject(alias, sessionHolder); } return sessionHolder; }
// Token: 0x0600BDC8 RID: 48584 RVA: 0x003513F0 File Offset: 0x0034F5F0 public void SetUITask(UITask task) { if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_SetUITaskUITask_hotfix != null) { this.m_SetUITaskUITask_hotfix.call(new object[] { this, task }); return; } BJLuaObjHelper.IsSkipLuaHotfix = false; this.m_task = task; }
void Awake() { if (Instance == null) { Instance = this; } if (_view == null) { _view = GetComponent <UITask_View>(); } DayTaskList = new List <TaskData>(); MainTaskList = new List <TaskData>(); tm = Core.Data.taskManager; }
public void OnBtnTask() { UITask.Open(UITaskType.None, TaskCallBack); ExpandUI(false, false); }
private void Awake() { _instance = this; exit = transform.Find("TaskBG/ESCBtn").GetComponent <Button>(); contentTask = transform.Find("TaskBG/TaskScrollView/TaskItemUI/TaskListContent").GetComponent <RectTransform>(); }
public void LoadVillagesNoneTest() { UITask.LoadVillages(villages, newVillages); Assert.AreEqual(AreTwoVillagesEqual(), true); }
internal UINode(UITask task, NodeBuilder nodeBuilder) { Task = Verify.ArgumentNotNull(task, "task"); NodeBuilder = Verify.ArgumentNotNull(nodeBuilder, "nodeBuilder"); }
protected override void OnEvent(EventTypeDefine p_e, object p_param) { GuideData data = p_param as GuideData; switch (p_e) { //点击副本 case EventTypeDefine.Click_FB: DBUIController.mDBUIInstance.OnBtnMainViewID(SQYMainController.CLICK_FuBen); break; //*选择第一大章 case EventTypeDefine.Click_FirstChapter: foreach (Chapter c in Core.Data.dungeonsManager.ChapterList.Values) { DBUIController.mDBUIInstance.SetViewStateWithData(RUIType.EMViewState.S_CityFloor, c); UIMiniPlayerController.Instance.SetActive(false); break; } break; //点击执行 case EventTypeDefine.Click_RunButton: CityFloorData.Instance.ClickFloorItem(Core.Data.dungeonsManager.FloorList[CityFloorData.Instance.currCity.toFightFloorId], true); break; //点击收取 case EventTypeDefine.Click_ReceiveButton: GameObject.Find("pbUIFloorReward(Clone)").GetComponent <UIFloorReward>().OnColse(); City CurFightCity = CityFloorData.Instance.currCity; //Core.Data.dungeonsManager.CityList[Core.Data.dungeonsManager.fightCityId]; //60105 CurFightCity.toFightFloorId = CurFightCity.config.floorID[CurFightCity.config.floorID.Length - 1]; //60104 Core.Data.dungeonsManager.lastFloorId = CurFightCity.toFightFloorId - 1; //直接通过当前City的所有小关 foreach (int floorid in CurFightCity.config.floorID) { Floor floor = Core.Data.dungeonsManager.FloorList[floorid]; if (!floor.isBoss) { floor.curProgress = floor.config.wave; } } CityFloorData.Instance.SelectCity(CurFightCity); CityFloorData.Instance.UpdateFloorItemsState(); break; //跳转BOSS战 case EventTypeDefine.Click_GoToBossFight: break; //点击执行,进入BOSS战 case EventTypeDefine.Click_RunBossFight: CityFloorData.Instance.ClickFloorItem(Core.Data.dungeonsManager.FloorList[CityFloorData.Instance.currCity.toFightFloorId], true); Core.Data.guideManger.HideGuide(); break; //播放战斗 case EventTypeDefine.Play_FightAnimation: Core.Data.guideManger.HideGuide(); Time.timeScale = 1; break; //点击返回,<一键>从副本返回游戏主界面 case EventTypeDefine.Exit_FBtoMainScene: if (UICityFloorManager.Instance != null) { UICityFloorManager.Instance.ClickBack(); } if (SQYChapterController.Instance != null) { SQYChapterController.Instance.OnBtnBack(); } break; //点击返回,从副本主界面返回主界面 case EventTypeDefine.Exit_MainFB: if (JCPVEMainController.Instance != null) { JCPVEMainController.Instance.OnBtnClick("BackButton"); } break; //点击返回,从副本主界面返回主界面,并重置3D场景位置 case EventTypeDefine.Click_TeamToMainUI2: if (JCPVEMainController.Instance != null) { JCPVEMainController.Instance.OnBtnClick("BackButton"); } Core.Data.guideManger.SetMainSceensDefaultPostion(); break; //点击任意地方后,强制返回主界面 case EventTypeDefine.Click_AnyWhereToMainScene: UICityFloorManager.Instance.ClickBack(); SQYChapterController.Instance.OnBtnBack(); break; //点击神龙 case EventTypeDefine.Click_ShenLong: FinalTrialMgr.GetInstance().m_NowTaskId = Core.Data.guideManger.LastTaskID; DBUIController.mDBUIInstance.OnBtnMainViewID(SQYMainController.CLICK_ShenLong); break; //点击6号龙珠 case EventTypeDefine.Click_SixStarBall: //Debug.Log(UIShenLongManager.Instance.GetDragonBallButton(5).name); UIShenLongManager.Instance.GetDragonBallButton(5).qiangDuoDragonBall(); break; //固定只推送一个机器人,点击抢夺按钮 case EventTypeDefine.Click_RobSixStarBall: if (QiangDuoPanelScript.Instance.ListCell.Count > 0) { QiangDuoPanelScript.Instance.ListCell[0].onFight(); } Core.Data.guideManger.HideGuide(); break; //返回龙珠主界面 case EventTypeDefine.Click_BackToShengLongMain: QiangDuoPanelScript.Instance.OnBtnClose(); break; //点击神龙合成按钮 case EventTypeDefine.Click_CallOfDragon: UIShenLongManager.Instance.clickCallDragon(); break; //选择奥义 case EventTypeDefine.Click_ChooseAoYi: UIShenLongManager.Instance.ClickYaoYi1(); break; //召唤神龙以后点击确定 case EventTypeDefine.Click_YesAtDragonUI: UIShenLongManager.Instance.BtnSelectedAoYiOk(); break; //和占卜婆婆说话<跳转打弗利萨> case EventTypeDefine.Click_FightWithFulisa: Core.Data.guideManger.HideGuide(); Object obj = PrefabLoader.loadFromUnPack("Ban/FeatureWar", false); GameObject go = GameObject.Instantiate(obj) as GameObject; RED.AddChild(go, DBUIController.mDBUIInstance._bottomRoot); AsyncTask.QueueOnMainThread(() => { SendBattleRequest(); }, 1F); break; //点击穿戴奥义 case EventTypeDefine.Click_EquipAoYi: UIDragonAltar d = UIShenLongManager.Instance.dragonAltar; if (d != null && d.aoYiSlotList.Count > 0) { d.aoYiSlotList[0].OnClicked(); } break; //选择第一个奥义 case EventTypeDefine.Click_SelectedFirstAoYi: if (UIShenLongManager.Instance.dragonAltar != null && UIShenLongManager.Instance.dragonAltar.selectAoYiAlert != null && UIShenLongManager.Instance.dragonAltar.selectAoYiAlert.List_AoYiSlots.Count > 0) { UIShenLongManager.Instance.dragonAltar.selectAoYiAlert.List_AoYiSlots[0].OnClicked(); } break; //点击确定穿戴这个奥义 case EventTypeDefine.Click_SureEquipAoYi: if (UIShenLongManager.Instance.dragonAltar != null && UIShenLongManager.Instance.dragonAltar.selectAoYiAlert != null) { UIShenLongManager.Instance.dragonAltar.selectAoYiAlert.OnSelectAoYi(); } break; //关闭组合技能显示板 case EventTypeDefine.Click_CloseCombinationSkillPanel: if (CombinationSkillPanelScript.Instance != null) { CombinationSkillPanelScript.Instance.DestroyPanel(); } break; //获得一个1级红宝石 case EventTypeDefine.Add_GetLv1RedGem: { ItemOfReward[] item = new ItemOfReward[] { new ItemOfReward() }; item[0].num = 1; item[0].ppid = -21; item[0].pid = 120201; Core.Data.itemManager.AddRewardToBag(item[0]); GetRewardSucUI.OpenUI(item, Core.Data.stringManager.getString(5047)); } break; //点击返回,返回主界面(并设置主界面位置) case EventTypeDefine.Click_BackTo3DMain: TeamUI.mInstance.m_teamView.OnBtnBack(); Core.Data.guideManger.SetMainSceensDefaultPostion(); break; //打开装备锻造屋 case EventTypeDefine.Click_OpenFrogingSystem: FrogingSystem.ForgingRoomUI.OpenUI(); DBUIController.mDBUIInstance.HiddenFor3D_UI(); break; //打开宝石合成界面 case EventTypeDefine.Click_OpenGemMosaic: FrogingSystem.ForgingRoomUI.Instance.GoTo(FrogingSystem.ForgingPage.Forging_Mosaic); break; //点击添加按钮 case EventTypeDefine.Click_AddEquipment: FrogingSystem.ForgingRoomUI.Instance.InlaySystem.ButtonClick("Equipment"); break; case EventTypeDefine.Click_LeftGemSlot: FrogingSystem.ForgingRoomUI.Instance.InlaySystem.ButtonClick("Btn_Hole5"); break; //任务弱引导(点击了主线任务按钮) case EventTypeDefine.Click_MainLineTask: UITask.Instance.OnBtnClick("Btn_MainLine"); break; //任务弱引导(点击了Go按钮) case EventTypeDefine.Click_TaskGoBtn: UITask.Instance.OnBtnClick("Btn_Jump"); break; //显示太阳和布尔玛 case EventTypeDefine.Click_ShowSunAndBuErMa: if (DBUIController.mDBUIInstance != null) { DBUIController.mDBUIInstance.ShowFor2D_UI(); DBUIController.mDBUIInstance.StartCoroutine("CheckSunState"); } break; case EventTypeDefine.Add_GetJinGuBang: { //NGUIDebug.Log("Add_GetJinGuBang"); if (Core.Data.itemManager.GetBagItem(-21) == null) { ItemOfReward[] item = new ItemOfReward[] { new ItemOfReward() }; item[0].num = 1; item[0].ppid = -21; item[0].lv = 1; item[0].pid = 40110; Core.Data.itemManager.AddRewardToBag(item[0]); GetRewardSucUI.OpenUI(item, Core.Data.stringManager.getString(5047)); } } break; case EventTypeDefine.Click_JuQingFB: if (JCPVEMainController.Instance != null) { JCPVEMainController.Instance.OnBtnClick("PVEType_Plot"); } break; case EventTypeDefine.Click_FirstGuanKa: { Core.Data.guideManger.HideGuide(); Core.Data.usrManager.UserConfig.cartoon = 1; if (JCPVEPlotController.Instance != null) { Core.Data.guideManger.HideGuide(); JCPVEPlotController.Instance.OnBuildingClick("60101"); } } break; case EventTypeDefine.Click_FightDesButton: if (JCPVEPlotDes.Instance != null) { JCPVEPlotDes.Instance.OnBtnClick("Btn_Fight"); } break; case EventTypeDefine.Click_FightButton: if (FightRoleSelectPanel.Instance != null) { FightRoleSelectPanel.Instance.OnBtnClick("Btn_Fight"); } UIGuide.Instance.hand.gameObject.SetActive(false); break; case EventTypeDefine.Click_SecondGuanKa: { if (JCPVEPlotController.Instance != null) { JCPVEPlotController.Instance.OnBuildingClick("60102"); } } break; case EventTypeDefine.Click_ExitPlotFB: { if (JCPVEPlotController.Instance != null) { JCPVEPlotController.Instance.OnBtnClick("Btn_Close"); } Core.Data.guideManger.SetMainSceensDefaultPostion(); } break; case EventTypeDefine.Click_ThirdGuaKa: if (JCPVEPlotController.Instance != null) { JCPVEPlotController.Instance.OnBuildingClick("60103"); } break; case EventTypeDefine.Click_FourthGuaKa: if (JCPVEPlotController.Instance != null) { JCPVEPlotController.Instance.OnBuildingClick("60104"); } break; case EventTypeDefine.Click_SelectSecondRoleAtFightPanel: if (FightRoleSelectPanel.Instance != null) { FightRoleSelectPanel.Instance.OnBtnClick("all_1"); } break; case EventTypeDefine.Click_SelectFristRoleAtFightPanel: if (FightRoleSelectPanel.Instance != null) { FightRoleSelectPanel.Instance.OnBtnClick("all_0"); AsyncTask.QueueOnMainThread(Core.Data.guideManger.AutoRUN, 0.5f); } break; case EventTypeDefine.Click_OpenTaskPage1: //第一次打开任务面板 GetTaskList.count = 0; UITask.Open(UITaskType.MainLine); break; case EventTypeDefine.Click_OpenTaskPage2: //第二次打开任务面板 GetTaskList.count = 1; //UITask.Open(UITaskType.MainLine); TopMenuUI.mInstance.OnBtnTask(); break; case EventTypeDefine.Click_CloseTaskPage: //关闭任务面板 UITask.Instance.OnBtnClick("Btn_Close"); break; case EventTypeDefine.Click_GetTaskRewardButton: //领取奖励按钮 UITask.Instance.OnBtnClick("Btn_GetReward"); Core.Data.guideManger.HideGuide(); break; case EventTypeDefine.Click_JuQingFB_Special: //重要: 点击剧情副本,但这里是特殊处理<因为这里会影响下一步到底是点第四关还是点第五关(默认是第四关)> if (Core.Data.newDungeonsManager.lastFloorId == 60104) { GuideData nextData = null; if (Core.Data.guideManger.ConfigData.TryGetValue(data.ID + 1, out nextData)) { nextData.ZoomX = 1f; nextData.ZoomY = 1f; nextData.MaskX = -182f; nextData.MaskY = -220f; nextData.TaskID = 155; } } if (JCPVEMainController.Instance != null) { JCPVEMainController.Instance.OnBtnClick("PVEType_Plot"); } break; case EventTypeDefine.Click_FifthGuaKa: //点击第五关 if (JCPVEPlotController.Instance != null) { JCPVEPlotController.Instance.OnBuildingClick("60105"); } break; } if (data.AutoNext == 1) { if (data.Dialogue == "null") { UIGuide.Instance.CompleteShelter(); } else { Core.Data.guideManger.HideGuide(); } } }
public void OnBtnTask() { UITask.Open(); }
void OnClick() { if (_game == null) { if (_gameVisible != null) { UIInformation.GetInstance().OnCancel(); _gameVisible.SetActive(false); } return; } if (_game.GetComponent <MonsterInfoUI> () != null) { MonsterInfoUI MonsterInfoUI = _game.GetComponent <MonsterInfoUI> (); MonsterInfoUI.OnClickClose(); } else if (_game.GetComponent <GetRewardSucUI> () != null) { // GetRewardSucUI RewardSucUI = _game.GetComponent <GetRewardSucUI> (); RewardSucUI.OnBtnOK(); } else if (_game.GetComponent <SelUserHeadUI> () != null) { SelUserHeadUI SelUserHead = _game.GetComponent <SelUserHeadUI> (); SelUserHead.OnClickExit(); } else if (_game.GetComponent <UIMessageMail> () != null) { UIMessageMail MessageMail = _game.GetComponent <UIMessageMail> (); MessageMail.OnBtnClick("Close"); } else if (_game.GetComponent <JCEquipmentDesInfoUI> () != null) // 装备查看 { JCEquipmentDesInfoUI JCEquipmentDesInfo = _game.GetComponent <JCEquipmentDesInfoUI> (); JCEquipmentDesInfo.OnXBtnClick(); } else if (_game.GetComponent <WXLActivityFestivalController> () != null) // 武者节日说明界面 { WXLActivityFestivalController WXLActivityFestival = _game.GetComponent <WXLActivityFestivalController> (); WXLActivityFestival.On_BtnClose(); //WXLActivityFestivalController } else if (_game.GetComponent <TrucePanelScript> () != null) // 神龙购买免战牌 { TrucePanelScript TrucePanel = _game.GetComponent <TrucePanelScript> (); TrucePanel.OnXBtnClick(); //TrucePanelScript } else if (_game.GetComponent <UIAnnounce> () != null) // 公告 { UIAnnounce uia = _game.GetComponent <UIAnnounce> (); uia.Back_OnClick(); } else if (_game.GetComponent <UIDateSignController> () != null) // 签到 { UIDateSignController uds = _game.GetComponent <UIDateSignController> (); uds.OnBackBtn(); } else if (_game.GetComponent <GemSyntheticSystemUI_View> () != null) // 宝石合成功能说明 { GemSyntheticSystemUI_View gss = _game.GetComponent <GemSyntheticSystemUI_View> (); gss.CloseDesp(); } else if (_game.GetComponent <LevelUpUI> () != null) { LevelUpUI lp = _game.GetComponent <LevelUpUI> (); lp.OnBtnOK(); } else if (_game.GetComponent <UIGambleController> () != null) { UIGambleController uc = _game.GetComponent <UIGambleController> (); uc.OnClose(); } else if (_game.GetComponent <UITask> () != null) { UITask uiT = _game.GetComponent <UITask> (); uiT.UIDestory(); } else if (_game != null) //直接干掉界面不需要调什么东西 { ComLoading.Close(); // 关闭界面关闭Comloading.Close(); UIInformation.GetInstance().OnCancel(); Destroy(_game); } else if (_gameVisible != null) //直接隐藏界面 { UIInformation.GetInstance().OnCancel(); _gameVisible.SetActive(false); } }
void TaskJumpBack2() { Core.Data.taskManager.JumpTaskID = -1; UITask.Open(); }