/// <summary> /// 指引开启关闭任务引导特效 /// </summary> protected void CloseTaskGuideByFunction(OpenNewFunctionGuideRef _data) { //Debug.Log("指引开启关闭任务引导特效"); for (int i = 0,max=taskList.Count; i < max; i++) { if(taskList[i] != null)taskList[i].ShowFx(false); } }
/// <summary> /// 调用设置位置填充区域 /// </summary> void CallLockSizePosition() { refData = new OpenNewFunctionGuideRef(); if (box != null) { Vector3 v2 = new Vector3(box.size.x, box.size.y, 0); SetLockSizePositon(v2); } }
protected override void OnOpen() { //Debug.Log("打开引导窗口"); base.OnOpen(); if (GameCenter.noviceGuideMng.RefData != null) { refData = GameCenter.noviceGuideMng.RefData; } //在界面开启的时候显示展示引导 Show(); UIEventListener.Get(box.gameObject).onClick += OnClickBtn; }
/// <summary> /// 展示指引 /// </summary> void Show() { nextData = null; next = false; if (refData == null) { Debug.LogError("OpenNewFunctionGuideRef refData === null !"); return; } SetScale(); if (allLock != null) { allLock.SetActive(refData.TypeOne); } if (box != null) { Vector3 boxPos = refData.TypeTwo ? SetData(refData.rect.position, refData.anchor) : Vector3.zero; box.transform.localPosition = boxPos; box.size = refData.TypeTwo ? GetPos(refData.rect.size) : new Vector3(uiroot.manualWidth, uiroot.activeHeight, 0); SetLockSizePositon(refData.TypeTwo ? box.size : Vector3.zero); if (allLock != null) { allLock.transform.localPosition = boxPos; } } if (lab != null) { lab.text = refData.Text; lab.width = (int)(refData.Textone.x); lab.height = (int)(refData.Textone.y); Vector3 btnBgPos = SetData(refData.Texttwo, refData.anchor); lab.transform.localPosition = btnBgPos; if (btnBg != null) { btnBg.transform.localPosition = btnBgPos; btnBg.width = (int)(refData.Textone.x); btnBg.height = (int)(refData.Textone.y); } } if (arrow != null) { arrow.gameObject.SetActive(refData.Arrow != 0); arrow.transform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, (float)refData.Arrow)); arrow.transform.localPosition = SetData(refData.ArrowPoint, refData.anchor); } if (effect != null) { effect.transform.localPosition = SetData(refData.effectPoint, refData.anchor); } CancelInvoke("TrusteeshipClickBtn"); Invoke("TrusteeshipClickBtn", 10.0f); }
void OnClickBtn(GameObject go) { //Debug.Log("当前引导的ID:" + refData.id); CancelInvoke("TrusteeshipClickBtn"); if (refData == null) { CloseUI(); return; } if (!string.IsNullOrEmpty(refData.Button)) { GameObject games = GameObject.Find(refData.Button); if (games == null) { Transform ta = uiroot.transform.Find(refData.Button); if (ta != null) { games = ta.gameObject; } } if (games != null) { games.SendMessage("OnClick", SendMessageOptions.DontRequireReceiver); } } nextData = ConfigMng.Instance.GetOpenNewFunctionGuideRef(refData.type, refData.step + 1); if (nextData != null) { //GameCenter.uIMng.ReleaseGUI(GUIType.NEWGUID); //指引延时处理 if (refData.time != 0) { SetDelayPos(); CancelInvoke("RecoveryStepDelay"); Invoke("RecoveryStepDelay", refData.time); } else { next = true; } } else { CloseUI(); } //新手引导关闭副本同时关闭提示 if (refData.id == 78 || refData.id == 94 || refData.id == 96) { //GameCenter.uIMng.ReleaseGUI(GUIType.MESSAGE); GameCenter.messageMng.ClearAllMsg(); } }
/// <summary> /// 开启指引 /// </summary> public void OpenGuide(int _type, int _step = 1) { //Debug.Log("OpenGuide(int _type, int _step = 1)"); if (_type == 100022 || _type == 100029 || _type == 100030) { return;//去掉退出副本引导 } OpenNewFunctionGuideRef guideData = ConfigMng.Instance.GetOpenNewFunctionGuideRef(_type, _step); if (guideData == null) { Debug.LogError("没有找到Type = " + _type + ",Step = " + _step + "的指引数据!"); return; } OpenGuide(guideData); }
/// <summary> /// 开启指引 /// </summary> public void OpenGuide(OpenNewFunctionGuideRef _guideData) { //Debug.Log("OpenGuide(OpenNewFunctionGuideRef _guideData)"); GameCenter.uIMng.ReleaseGUI(GUIType.NEWGUID); if (_guideData == null) { return; } if (!startGuide) { startGuide = true; } if (UpdateGuideData != null) { UpdateGuideData(_guideData); } }
void OnSpecilGuild(OpenNewFunctionGuideRef _data) { //Debug.Log("普通攻击和技能特殊引导"); guid = _data; if (_data.type == 100001 || _data.type == 100002) { GameCenter.curMainPlayer.CancelCommands(); if (GameCenter.curMainPlayer.CurFSMState != MainPlayer.EventType.AI_DART_CTRL && GameCenter.curMainPlayer.CurFSMState != MainPlayer.EventType.AI_FIGHT_CTRL) { GameCenter.curMainPlayer.GoAutoFight(); } } if (funcInfo != null && funcInfo.SceneID > 0)//指引完毕如果有传送点,则传送 { CloseAll(); GameCenter.mainPlayerMng.C2STaskFly(funcInfo.SceneID); } }
void OnClickBtn(GameObject go) { CancelInvoke("TrusteeshipClickBtn"); if (refData == null) { CloseUI(); return; } if (!string.IsNullOrEmpty(refData.Button)) { GameObject games = GameObject.Find(refData.Button); if (games == null) { Transform ta = uiroot.transform.Find(refData.Button); if (ta != null) { games = ta.gameObject; } } if (games != null) { games.SendMessage("OnClick", SendMessageOptions.DontRequireReceiver); } } nextData = ConfigMng.Instance.GetOpenNewFunctionGuideRef(refData.type, refData.step + 1); if (nextData != null) { //指引延时处理 if (refData.time != 0) { SetDelayPos(); CancelInvoke("RecoveryStepDelay"); Invoke("RecoveryStepDelay", refData.time); } else { next = true; } } else { CloseUI(); } }
/// <summary> /// 合成红点 /// </summary> //void CheckBackPackSynthesis(){ // if (!GameCenter.mainPlayerMng.isFirstOpenBackSynUI) return; // FDictionary synths = ConfigMng.Instance.GetBlendRefTable(); // foreach(BlendRef refa in synths.Values){ // int count = GameCenter.inventoryMng.GetNumberByType(refa.needItems[0].eid); // if(refa.needItems.Count > 0 && count/(refa.needItems.Count * refa.needItems[0].count) > 0){ // GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.SYNTHETIC,true); // return ; // } // } // GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.SYNTHETIC,false); //} /// <summary> /// 技能红点 /// </summary> //void InitData() //{ // if (GameCenter.guildSkillMng != null) // GameCenter.guildSkillMng.SetSkillRed(); #endregion #region 功能开启与指引交互逻辑 void UpdateGuideData(OpenNewFunctionGuideRef _data) { //Debug.Log("功能开启与指引"); if (_data != null && _data.close) { GameCenter.uIMng.SwitchToSubUI(SubGUIType.NONE); GameCenter.uIMng.SwitchToUI(GUIType.NONE); GameCenter.uIMng.ShowSkill(true); GameCenter.uIMng.ShowMenu(false); GameCenter.uIMng.ShowMapMenu(true); } CloseAll(); GameCenter.curMainPlayer.GoNormal(); //if(mainGuide != null && !mainGuide.gameObject.activeSelf){ if (_data == null) { return; } GameCenter.noviceGuideMng.RefData = _data; EventDelegate.Remove(GameCenter.noviceGuideMng.OnGuideOver, OnGuideOver); EventDelegate.Add(GameCenter.noviceGuideMng.OnGuideOver, OnGuideOver); //mainGuide.OpenUI(); GameCenter.uIMng.GenGUI(GUIType.NEWGUID, true); }