public void OnClickCompleteBtn(GameObject obj) { UIButton btn = obj.transform.GetComponent <UIButton>(); Globals.Instance.MTaskManager.mTaskDailyData.NextTaskId = (int)btn.Data; Globals.Instance.MTaskManager.challengeAgain = null; if (mCurrentfinishLv >= 2 || element.Progress_Count <= 0) { if (Globals.Instance.MTaskManager.mTaskDailyData.NextTaskId > 0) { GUIPhotoGraph guiPhoto = Globals.Instance.MGUIManager.GetGUIWindow <GUIPhotoGraph> (); if (guiPhoto != null) { guiPhoto.IsReturnMainScene = false; guiPhoto.Close(); } GUIGuoChang.Show(); Globals.Instance.MTaskManager.StartNextTask(Globals.Instance.MTaskManager.mTaskDailyData.NextTaskId); } else { GUIPhotoGraph guiPhoto = Globals.Instance.MGUIManager.GetGUIWindow <GUIPhotoGraph> (); if (guiPhoto != null) { guiPhoto.Close(); } } } else { NetSender.Instance.C2GSTaskSetCompleteReq(TaskID, mCurrentfinishLv); } }
private void OnClickGameEndBtn(GameObject obj) { UIToggle btn = obj.transform.GetComponent <UIToggle>(); int taskid = (int)btn.Data; if (taskid <= 0) { return; } GUIGuoChang.Show(); Globals.Instance.MGUIManager.CreateWindow <GUITaskTalkView>(delegate(GUITaskTalkView gui){ NGUITools.SetActive(this.gameObject, false); TaskConfig tk = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>(); TaskConfig.TaskObject element = null; bool hasData = tk.GetTaskObject(taskid, out element); if (!hasData) { return; } gui.PlayLocalTalk(element.Task_Talk_ID, delegate() { gui.DestroyThisGUI(); NGUITools.SetActive(this.gameObject, true); }); GUIGuoChang.SetTweenPlay(0, delegate() { }); }); }
private void TaskAcceptDeal(int taskid) { TaskConfig.TaskObject element = null; TaskConfig task = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>(); bool hasData = task.GetTaskObject(taskid, out element); if (!hasData) { return; } GUIGuoChang.Show(); if (element.Progress_Count <= 0) { GUIRadarScan.Show(); if (element.Is_End == 1) { if (element.Is_Perfect_End == 1) { NetSender.Instance.RequestTaskCompleteReq(taskid); } else { GUITaskTalkView taskview = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTalkView>(); if (taskview != null) { taskview.DestroyThisGUI(); } Globals.Instance.MGUIManager.CreateWindow <GUIGameOutcome>(delegate(GUIGameOutcome guiGameOutcome) { guiGameOutcome.EnterGameOutcome(taskid); GUIGuoChang.SetTweenPlay(0, delegate() {}); }); } } else { NetSender.Instance.RequestTaskCompleteReq(taskid); } } else { GUITaskTalkView taskview = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTalkView>(); if (taskview != null) { taskview.DestroyThisGUI(); } Globals.Instance.MGUIManager.CreateWindow <GUIPhotoGraph>(delegate(GUIPhotoGraph gui) { GUIGuoChang.SetTweenPlay(0, delegate() { // EliminationMgr.Instance.GameFieldAnimationEndStartGame (); }); GUIMain guimain = Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>(); if (guimain != null) { guimain.SetVisible(false); } gui.DrawReadyView(); }); } }
//================ 任务流程 ------------------------ // public void TravelTaskIDRes(int taskid) { // this.SetVisible(false); GUIGuoChang.Show(); GUIGameOutcome guiGameOutcome = Globals.Instance.MGUIManager.GetGUIWindow <GUIGameOutcome>(); if (guiGameOutcome != null) { guiGameOutcome.IsReturnMainScene = false; guiGameOutcome.Close(); } GUITravel guiTravel = Globals.Instance.MGUIManager.GetGUIWindow <GUITravel>(); if (guiTravel != null) { guiTravel.IsReturnMainScene = false; guiTravel.Close(); } GUIPhotoGraph guiPhotoGraph = Globals.Instance.MGUIManager.GetGUIWindow <GUIPhotoGraph>(); if (guiPhotoGraph != null) { guiPhotoGraph.IsReturnMainScene = false; guiPhotoGraph.Close(); } GUIMemory guiMemory = Globals.Instance.MGUIManager.GetGUIWindow <GUIMemory>(); if (guiMemory != null) { NGUITools.SetActive(guiMemory.gameObject, false); } Globals.Instance.MGUIManager.CreateWindow <GUITaskTalkView>(delegate(GUITaskTalkView gui){ TaskConfig tk = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>(); TaskConfig.TaskObject element = null; bool hasData = tk.GetTaskObject(taskid, out element); if (!hasData) { return; } gui.PlayLocalTalk(element.Task_Talk_ID, delegate() { TaskAcceptDeal(taskid); }); }); }
public void OnClickZhengRong(GameObject obj) { GUIGuoChang.Show(); Globals.Instance.MGUIManager.CreateWindow <GUIChangeAppearance>(delegate(GUIChangeAppearance gui){ NGUITools.SetActive(this.gameObject, false); GUIGuoChang.SetTweenPlay(0, delegate { gui.UpdateZeroStep(); }); gui.CloseChangeAppearanceEvent += delegate() { NGUITools.SetActive(this.gameObject, true); }; }); }
public void StartTask() { GUIGuoChang.Show(); Globals.Instance.MGUIManager.CreateWindow <GUIPhotoGraph>(delegate(GUIPhotoGraph gui) { GUIGuoChang.SetTweenPlay(0, delegate() { }); this.IsReturnMainScene = false; this.Close(); gui.DrawReadyView(); }); }
private void TaskAcceptDeal(sg.GS2C_Task_Accept_Res res) { if (!res.isSingleTask) { NetSender.Instance.RequestTaskInviteListReq(res.taskId); } else { Task.TaskObject element = null; Task task = Globals.Instance.MDataTableManager.GetConfig <Task>(); bool hasData = task.GetTaskObject(res.taskId, out element); if (!hasData) { return; } if (element.Progress_Count <= 0) { GUIGuoChang.Show(); Globals.Instance.MGUIManager.CreateWindow <GUIPhotoGraph>(delegate(GUIPhotoGraph photo){ // photo.WealthGroup.SetUpdateNow(false); NetSender.Instance.RequestTaskCompleteReq(res.taskId); }); } else { this.Close(); GUIGuoChang.Show(); Globals.Instance.MGUIManager.CreateWindow <GUIPhotoGraph>(delegate(GUIPhotoGraph gui) { GUIGuoChang.SetTweenPlay(0, delegate() { }); GUIMain guimain = Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>(); if (guimain != null) { guimain.SetVisible(false); } gui.DrawReadyView(); }); } } }
public void SetGameState(GameState state) { // Release last GameState logic if (_mGameState == GameState.GAME_STATE_COPY && state == GameState.GAME_STATE_BATTLE) { // Do not Release } else { if (_mCurrentGameStatus != null) { _mCurrentGameStatus.Release(); } } GameState lastState = _mGameState; _mGameState = state; _mLastGameStatus = _mCurrentGameStatus; _mGameNextState = GameState.GAME_STATE_INVALID; switch (_mGameState) { case GameState.GAME_STATE_INITIAL: { _mGameStatusPublisher.NotifyGameStateInitial(); break; } case GameState.GAME_STATE_LOADING: { _mGameStatusPublisher.NotifyGameStateLoading(); break; } case GameState.GAME_STATE_ROLE_CREATE: { //_mGameStatusPublisher.NotifyGameStateRoleCreate(); //long roleID = Globals.Instance.MGameDataManager.MActorData.PlayerID; //string testRoleName = "yingpan"; //string roleName = testRoleName + roleID.ToString(); //int gender = 1; //string avatarName = "AvatarMan1"; //int templateId = 1217001000; //int countryID = -1; //NetSender.Instance.RequestCreatePlayer(roleName, gender, countryID, avatarName, templateId); //break; GUIGuoChang.Show(); Globals.Instance.MGUIManager.CreateWindow <GUICreateRole> ( delegate(GUICreateRole gui) { GUIGuoChang.SetTweenPlay(0, delegate { gui.UpdateZeroStep(); }); } ); break; } case GameState.GAME_STATE_LOGIN: { _mGameStatusPublisher.NotifyGameStateLogin(); break; } case GameState.GAME_STATE_PORT: { _mGameStatusPublisher.NotifyGameStatePort(); //Globals.Instance.MTeachManager.NewQianZhiFinshed(); _mCurrentGameStatus = _pPortStatus; if (Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>() == null) { Globals.Instance.MGUIManager.CreateWindow <GUIMain>(delegate(GUIMain gui) { NetSender.Instance.GetLotteryInfoReq(); Globals.Instance.MGameDataManager.MActorData.NotifyWorthUpdate(); Globals.Instance.MGameDataManager.MActorData.NotifyPlayerInfoUpdate(); gui.SetUISceneStatus(GUIMain.ESceneType.PORT); if (!Globals.Instance.MTeachManager.IsOpenTeach) { gui.FunctionButtonState(); } TaskManager.ReadGameFinishDataFilename(); NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.Recharge); NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.GameInner); NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.PromotionGift); // if (GameDefines.OutputVerDefs == OutputVersionDefs.Windows) // { //// NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.Recharge); //// NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.GameInner); //// NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.PromotionGift); // } // else if (GameDefines.OutputVerDefs == OutputVersionDefs.AppStore) // { // #if UNITY_IPHONE // PlayerData actorData = Globals.Instance.MGameDataManager.MActorData; // string str = "101119" + Globals.Instance.MGameDataManager.MActorData.PlayerID.ToString(); // string str2 = actorData.BasicData.Name; // U3dAppStoreSender.LoginKTPlay(str,str2); // Debug.Log("IPHONE KTPlayLogin:"******"IPHONE CYLogin:"******"RequestVipStoreRechargeInfo"); //// NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.Recharge); //// NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.GameInner); //// NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.PromotionGift); // #endif // } // else if(GameDefines.OutputVerDefs==OutputVersionDefs.WPay) // { // PlayerData actorData = Globals.Instance.MGameDataManager.MActorData; // string str = "103214" + Globals.Instance.MGameDataManager.MActorData.PlayerID.ToString(); // string str2 = actorData.BasicData.Name; // AndroidSDKAgent.LoginKTPlay(str,str2); // Debug.Log("ANDROID KTPlayLogin:"******"x03") == 0) { Globals.Instance.MTeachManager.NewOpenTeach("x03", 1); } break; } case GameState.GAME_STATE_HOME: { _mCurrentGameStatus = _homeStatus; _mCurrentGameStatus.Initialize(); GUIBuildExplore guiBuildExplore = Globals.Instance.MGUIManager.GetGUIWindow <GUIBuildExplore>(); if (guiBuildExplore != null) { guiBuildExplore.Close(); } Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetVisible(false); break; } case GameState.GAME_STATE_COPY: { _mGameStatusPublisher.NotifyGameStateCopy(); _mCurrentGameStatus = _pCopyStatus; // Battle and Copy is mutex in some time if (lastState == GameState.GAME_STATE_BATTLE) { // When switch from BattleStatus, we need do something in CopyStatus _pCopyStatus.OnBattleEnd(_pBattleStatus.MBattleResult); } else { _mCurrentGameStatus.Initialize(); } Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetVisible(true); Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetUISceneStatus(GUIMain.ESceneType.COPY); /*GUIPublicWarn gui = Globals.Instance.MGUIManager.GetGUIWindow<GUIPublicWarn>(); * if (null != gui) * gui.SetVisible(true); */ GUITaskTrack GUITaskTrack = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTrack>(); if (null != GUITaskTrack) { GUITaskTrack.SetVisible(true); GUITaskTrack.UpdateData(); } break; } case GameState.GAME_STATE_BATTLE: { EnterPKBattleByPlayerDock = (lastState == GameState.GAME_STATE_PLAYER_DOCK); _mGameStatusPublisher.NotifyGameStateBattle(); _mCurrentGameStatus = _pBattleStatus; Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetVisible(false); //Globals.Instance.MGUIManager.GetGUIWindow<GUIPublicWarn>().SetVisible(false); GUITaskTrack GUITaskTrack = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTrack>(); if (null != GUITaskTrack) { GUITaskTrack.SetVisible(false); } _mCurrentGameStatus.Initialize(); break; } case GameState.GAME_STATE_PLAYER_DOCK: { _mCurrentGameStatus.Release(); _mCurrentGameStatus = _pPlayerDockStatus; _mCurrentGameStatus.Initialize(); Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetUISceneStatus(GUIMain.ESceneType.DOCK); break; } } }
public void TaskAcceptRes(sg.GS2C_Task_Accept_Res res) { if (res.talkId != null) { this.SetVisible(false); GUIMain guim = Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>(); if (guim != null) { guim.SetVisible(false); } GUIGuoChang.Show(); Globals.Instance.MGUIManager.CreateWindow <GUITaskTalkView>( delegate(GUITaskTalkView gui) { gui.PlayLocalTalk(res.talkId, delegate() { if (Globals.Instance.MTaskManager.challengeAgain != null) { Task tk = Globals.Instance.MDataTableManager.GetConfig <Task>(); Task.TaskObject element = null; bool hasData = tk.GetTaskObject(res.taskId, out element); if (!hasData) { return; } if (element.Progress_Count <= 0) { if (Globals.Instance.MTaskManager.challengeAgain.challengeAgainScene == 0) { NetSender.Instance.PlayerGetCompletedReq(Globals.Instance.MTaskManager.challengeAgain.cityId); } else if (Globals.Instance.MTaskManager.challengeAgain.challengeAgainScene == 1) { NetSender.Instance.RequestEnterCityReq(Globals.Instance.MTaskManager.mTaskDailyData.CurrentCityID); Globals.Instance.MTaskManager.challengeAgain = null; } } else { TaskAcceptDeal(res); if (guim != null) { guim.SetVisible(false); } } } else { TaskAcceptDeal(res); if (guim != null) { guim.SetVisible(false); } } }); GUIGuoChang.SetTweenPlay(0, delegate() { }); } ); } else { TaskAcceptDeal(res); } }
protected override void Awake() { if (null == Globals.Instance.MGUIManager) { return; } base.Awake(); base.enabled = true; Globals.Instance.MSceneManager.ChangeCameraActiveState(SceneManager.CameraActiveState.TASKCAMERA); if (SoundManager.CurrentPlayingMusicAudio != null) { Destroy(SoundManager.CurrentPlayingMusicAudio.gameObject); SoundManager.CurrentPlayingMusicAudio = null; } for (int i = 0; i < 6; i++) { for (int j = 0; j < ClothTypeNum[i].Length; j++) { MPropItemDic.Add(ClothTypeNum[i][j], MPropItemLst[i]); } } UIEventListener.Get(BackBtn.gameObject).onClick += delegate(GameObject go) { EliminationMgr.Instance.GameStatus = GameStatusEnum.Pause; Globals.Instance.MGUIManager.CreateGUIDialog(delegate(GUIDialog gui){ gui.SetDialogType(EDialogType.CommonType, null); gui.SetText("确定放弃?"); gui.CancelEvent += delegate() { EliminationMgr.Instance.GameFieldAnimationEndStartGame(); }; }, EDialogStyle.DialogOkCancel, delegate() { EliminationMgr.Instance.GameStatus = GameStatusEnum.GameOver; }); }; UIEventListener.Get(StartBtn.gameObject).onClick += delegate(GameObject go) { GameInfo.SetActive(true); TotalMagicObj.SetActive(true); BgInfo.transform.localPosition = new Vector3(0f, 780f, 0f); ReadyInfo.SetActive(false); foreach (KeyValuePair <int, PropItem> v in MPropItemDic) { v.Value.UpdateInfo(); } MCharacterCustomizeOne.gameObject.SetActive(false); EliminationMgr.Instance.GameFieldAnimationEndStartGame(); }; UIEventListener.Get(ChangleClothBtn.gameObject).onClick += delegate(GameObject go) { Globals.Instance.MGUIManager.CreateWindow <GUIChangeCloth>(delegate(GUIChangeCloth Change) { this.IsReturnMainScene = false; this.Close(); NGUITools.SetActive(Change.ChangeBtn.gameObject, false); UISprite exitBtn = Change.ExitBtn.gameObject.GetComponent <UISprite>(); exitBtn.spriteName = "ButtonFanhui3Normol"; Change.ExitBtn.normalSprite = "ButtonFanhui3Normol"; Change.ExitBtn.hoverSprite = "ButtonFanhui3Normol"; Change.ExitBtn.pressedSprite = "ButtonFanhui3Normol"; Change.ExitBtn.disabledSprite = "ButtonFanhui3Normol"; Change.CloseChangeClothEvent += delegate() { GUIGuoChang.Show(); Globals.Instance.MGUIManager.CreateWindow <GUIPhotoGraph>(delegate(GUIPhotoGraph gui) { GUIGuoChang.SetTweenPlay(0, delegate() { }); GUIMain guimain = Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>(); if (guimain != null) { guimain.SetVisible(false); } gui.DrawReadyView(); }); }; }); }; taskConfig = Globals.Instance.MDataTableManager.GetConfig <TaskConfig> (); }
public void UpdateMainTask() { if (mPlayerDate.MainTaskIDList.Count > 0) { AllFunctionBtn.transform.localScale = Vector3.zero; GotoBtn.transform.localScale = Vector3.one; if (mPlayerDate.MainTaskIDList.Count > 1) { if (!(mPlayerDate.MainTaskIDList[0].taskState == (int)TaskManager.TaskState.PASS) && !(mPlayerDate.MainTaskIDList[0].taskState == (int)TaskManager.TaskState.UNPASS)) { GUIGuoChang.Show(); // NetSender.Instance.RequestTaskAcceptReq(mPlayerDate.MainTaskIDList[0].taskId,0); Globals.Instance.MTaskManager.StartNextTask(mPlayerDate.MainTaskIDList[0].taskId); } else { ShowTaskSettlement(mPlayerDate.MainTaskIDList[0]); } } else { if (!(mPlayerDate.MainTaskIDList[0].taskState == (int)TaskManager.TaskState.PASS) && !(mPlayerDate.MainTaskIDList[0].taskState == (int)TaskManager.TaskState.UNPASS)) { if (NowCheckGuideTask(mPlayerDate.MainTaskIDList[0].taskId)) { return; } if (mPlayerDate.MainTaskIDList[0].taskId != mMainTaskID) { mMainTaskID = mPlayerDate.MainTaskIDList[0].taskId; TaskConfig.TaskObject taskObject = null; bool ishas = taskConfig.GetTaskObject(mMainTaskID, out taskObject); if (!ishas) { return; } if (taskObject.Is_Delay == 0 || mPlayerDate.MainTaskIDList[0].passCount > 0) { GUIGuoChang.Show(); // NetSender.Instance.RequestTaskAcceptReq(mPlayerDate.MainTaskIDList[0].taskId,0); Globals.Instance.MTaskManager.StartNextTask(mPlayerDate.MainTaskIDList[0].taskId); return; } MainTaskLabel.text = taskObject.Task_Desc; } } else { ShowTaskSettlement(mPlayerDate.MainTaskIDList[0]); } } } else { AllFunctionBtn.transform.localScale = Vector3.one; GotoBtn.transform.localScale = Vector3.zero; MainTaskLabel.text = ""; if (UpdateTimeLine) { GUIRadarScan.Show(); NetSender.Instance.C2GSTaskPlaceReq((int)TaskManager.TaskCategory.CHANGEDATE, -1); } } UpdateTimeLine = false; }