public void PlayLocalTalk(int talkID, TalkCallBackDelegate talkCallBackDelegate) { ResetData(); if (taskTalksIDDic.ContainsKey(talkID)) { talkList = taskTalksIDDic[talkID]; mTalkCallBackDelegate = talkCallBackDelegate; SetText(talkList[curIndex]); GUIGuoChang.SetTweenPlay(0, delegate() { }); } }
public void UpdateData(int taskid, TalkCallBackDelegate talkCallBackDelegate) { ResetData(); TaskConfig taskConfig = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>(); Dictionary <int, TaskConfig.TaskObject> taskObjectDic; taskConfig.GeTaskObjectList(out taskObjectDic); CurTask = taskObjectDic[taskid]; for (int i = 0; i < Globals.Instance.MTaskManager._mUnfinishList.Count; i++) { if (taskid == Globals.Instance.MTaskManager._mUnfinishList[i].Task_ID) { CurState = Globals.Instance.MTaskManager._mUnfinishList[i].State; } } int talkid = CurTask.Task_Talk_ID; Globals.Instance.M3DItemManager.EZ3DItemParent.localScale = Vector3.zero; mTalkCallBackDelegate = talkCallBackDelegate; if (taskTalksIDDic.ContainsKey(talkid)) { talkList = taskTalksIDDic[talkid]; SetText(talkList[curIndex]); //TalkAniIn(); if (GameStatusManager.Instance.MGameState == GameState.GAME_STATE_COPY) { GameStatusManager.Instance.MCurrentGameStatus.Pause(); } } }
private void PressedButton(GameObject obj) { // tzz added // the talk list will be null if used in Teach scene // check TeachFirstEnterGame.cs for detail if (mTypewriterEffect == null) { return; } if (mTypewriterEffect.IsTypewriterIng()) { mTypewriterEffect.FinishTypewriter(); return; } if (mMustPlayEffect) { if (FinishedTipSprite.gameObject.active) { if (talkList[curIndex].effectIDTail > 0) { ///设置 SpriteScenePreground效果的//// TweenGroupConfig tweenGroupConfig = Globals.Instance.MDataTableManager.GetConfig <TweenGroupConfig>(); if (tweenGroupConfig.IsPregroundGroup("SpriteScenePreground", talkList[curIndex].effectIDTail)) { GameObject priorGameObj = Globals.Instance.MSceneManager.mTaskCamera.transform.Find("SpriteScenePreground").gameObject; if (priorGameObj != null) { NGUITools.SetActive(priorGameObj, true); } } TweenGroup tweenGroup = textureBackgroundScene.GetComponent <TweenGroup>(); if (tweenGroup == null) { tweenGroup = textureBackgroundScene.gameObject.AddComponent <TweenGroup>(); } tweenGroup.setTweenGroupID(talkList[curIndex].effectIDTail); tweenGroup.playTweenAnimation(); tweenGroup.TweenFinishedEvents += OnTweenGroupFinishendEvent; NGUITools.SetActive(TaskDialogGameObject, false); } } return; } if (talkList == null || talkList.Count == 0 || curIndex >= talkList.Count || mAniPlayIng /*|| CurTask == null*/) { if (mForTZZDelegate != null) { mForTZZDelegate(); } return; } //对话结束 if (curIndex == talkList.Count - 1) { if (CurTask == null) { // DestroyThisGUI(); if (mTalkCallBackDelegate != null) { mTalkCallBackDelegate(); mTalkCallBackDelegate = null; } return; } int nCurTaskID = CurTask.Task_ID; if (!mClentTask) { if (!ProcessorTaskBefoeFinished(nCurTaskID)) { SendTaskMessage(); } } // DestroyThisGUI(); if (mTalkCallBackDelegate != null) { mTalkCallBackDelegate(); mTalkCallBackDelegate = null; } if (GameStatusManager.Instance.MGameState == GameState.GAME_STATE_COPY) { GameStatusManager.Instance.MCurrentGameStatus.Resume(); } //TalkAniOut(); return; } else { if (talkList[curIndex].talkTpye == (int)TALKTYE.TALK4) { NGUITools.SetActive(TaskDialogGameObject, false); if (talkList[curIndex].effectIDTail > 0) { ///设置 SpriteScenePreground效果的//// TweenGroupConfig tweenGroupConfig = Globals.Instance.MDataTableManager.GetConfig <TweenGroupConfig>(); if (tweenGroupConfig.IsPregroundGroup("SpriteScenePreground", talkList[curIndex].effectIDTail)) { GameObject priorGameObj = Globals.Instance.MSceneManager.mTaskCamera.transform.Find("SpriteScenePreground").gameObject; if (priorGameObj != null) { NGUITools.SetActive(priorGameObj, true); } } TweenGroup tweenGroup = textureBackgroundScene.GetComponent <TweenGroup>(); if (tweenGroup == null) { tweenGroup = textureBackgroundScene.gameObject.AddComponent <TweenGroup>(); } tweenGroup.setTweenGroupID(talkList[curIndex].effectIDTail); tweenGroup.playTweenAnimation(); tweenGroup.TweenFinishedEvents += OnCGTweenGroupFinishendEvent; mMustPlayEffect = true; curIndex++; return; } } curIndex++; } SetText(talkList[curIndex]); }