public static NewbieTeachMgr getInstance() { if (_instance == null) { _instance = new NewbieTeachMgr(); } return(_instance); }
public static NewbieTeachMgr getInstance() { bool flag = NewbieTeachMgr._instance == null; if (flag) { NewbieTeachMgr._instance = new NewbieTeachMgr(); } return(NewbieTeachMgr._instance); }
public void showDesc(string desc) { int num = desc.IndexOf(":"); bool flag = num < 0; if (flag) { InterfaceMgr.getInstance().close(InterfaceMgr.DIALOG); } else { dialog.curType = desc.Substring(0, num); dialog.curDesc = desc.Substring(num + 1, desc.Length - num - 1); bool flag2 = dialog.curType == "0" || dialog.curType == "1"; if (flag2) { this.OnShowAvatar(true); InterfaceMgr.getInstance().open(InterfaceMgr.NPC_TALK, null, false); } else { bool flag3 = dialog.curType == "2" || dialog.curType == "3"; if (flag3) { this.OnShowAvatar(false); InterfaceMgr.getInstance().open(InterfaceMgr.NPC_TASK_TALK, null, false); } else { bool flag4 = dialog.curType == "-1"; if (flag4) { this.OnShowAvatar(false); InterfaceMgr.getInstance().open(InterfaceMgr.NPC_TASK_TALK, null, false); } else { bool flag5 = dialog.curType == "newbie"; if (flag5) { dialog.continuedo = !dialog.isLastDesc; InterfaceMgr.getInstance().close(InterfaceMgr.DIALOG); NewbieTeachMgr.getInstance().add(dialog.curDesc, -1); } } } } } }
public void showDesc(string desc) { int idx = desc.IndexOf(":"); if (idx < 0) { InterfaceMgr.getInstance().close(InterfaceMgr.DIALOG); return; } curType = desc.Substring(0, idx); curDesc = desc.Substring(idx + 1, desc.Length - idx - 1); if (curType == "0" || curType == "1") { OnShowAvatar(true); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.NPC_TALK); } else if (curType == "2" || curType == "3") { OnShowAvatar(false); //TODO 其他的对话设置 InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.NPC_TASK_TALK); } else if (curType == "-1") { OnShowAvatar(false); //TODO 打开功能窗口 InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.NPC_TASK_TALK); } else if (curType == "newbie") { continuedo = !isLastDesc; InterfaceMgr.getInstance().close(InterfaceMgr.DIALOG); NewbieTeachMgr.getInstance().add(curDesc, -1); } }
public void initNewbieData() { if (inited) { return; } string str = FileMgr.loadString(FileMgr.TYPE_NEWBIE, "n"); if (str != "") { string[] arr = str.Split(','); for (int i = 0; i < arr.Length; i++) { doneId[int.Parse(arr[i])] = 1; } } inited = true; List <SXML> xml = XMLMgr.instance.GetSXMLList("newbie.n"); //SXML xmls = xml.GetNode("skill"); if (xml != null) { foreach (SXML x in xml) { int id = x.getInt("id"); if (getDoneId(id)) { continue; } NewbieTeachMgr.getInstance().add(x.getString("p"), id); } } }
public void initNewbieData() { bool flag = this.inited; if (!flag) { string text = FileMgr.loadString(FileMgr.TYPE_NEWBIE, "n"); bool flag2 = text != ""; if (flag2) { string[] array = text.Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { NewbieModel.doneId[int.Parse(array[i])] = 1; } } this.inited = true; List <SXML> sXMLList = XMLMgr.instance.GetSXMLList("newbie.n", ""); bool flag3 = sXMLList != null; if (flag3) { foreach (SXML current in sXMLList) { int @int = current.getInt("id"); bool flag4 = NewbieModel.getDoneId(@int); if (!flag4) { NewbieTeachMgr.getInstance().add(current.getString("p"), @int); } } } } }
public virtual void onTriggerHanlde() { bool flag = this.type == 1; if (flag) { bool flag2 = this.paramInts.Count == 0; if (!flag2) { MonsterMgr._inst.AddMonster(this.paramInts[0], base.transform.position, 0u, base.transform.localEulerAngles.y, 0, 0, null); } } else { bool flag3 = this.type == 2; if (flag3) { bool flag4 = this.paramGo.Count == 0; if (!flag4) { foreach (GameObject current in this.paramGo) { current.SetActive(true); } } } else { bool flag5 = this.type == 3; if (flag5) { bool flag6 = this.paramGo.Count == 0; if (!flag6) { foreach (GameObject current2 in this.paramGo) { HiddenItem component = current2.GetComponent <HiddenItem>(); bool flag7 = component != null; if (flag7) { component.hide(); } else { current2.SetActive(false); } } } } else { bool flag8 = this.type == 4; if (flag8) { bool flag9 = this.paramInts.Count == 0; if (!flag9) { int num = 0; for (int i = 0; i < this.paramInts.Count; i++) { num += NavmeshUtils.listARE[this.paramInts[i]]; } bool flag10 = num == 0; if (!flag10) { SelfRole._inst.setNavLay(num); } } } else { bool flag11 = this.type == 5; if (flag11) { bool flag12 = this.paramGo.Count == 0; if (!flag12) { Transform transform = this.paramGo[0].transform; for (int j = 0; j < transform.childCount; j++) { GameObject gameObject = transform.GetChild(j).gameObject; gameObject.AddComponent <BrokenIten>(); } } } else { bool flag13 = this.type == 6; if (flag13) { bool flag14 = this.paramGo.Count == 0; if (!flag14) { bool flag15 = this.paramFloat.Count == 0; if (!flag15) { bool flag16 = this.paramBool; if (flag16) { InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_HIDE_ALL); joystick.instance.stopDrag(); } this.paramGo[1].SetActive(true); SceneCamera.changeAniCamera(this.paramGo[0], this.paramFloat[0]); } } } else { bool flag17 = this.type == 8; if (flag17) { bool flag18 = this.paramGo.Count == 0; if (!flag18) { this.paramGo[0].SetActive(true); HiddenItem component2 = this.paramGo[0].GetComponent <HiddenItem>(); bool flag19 = component2 != null; if (flag19) { component2.hide(); } else { this.paramGo[0].SetActive(false); } } } else { bool flag20 = this.type == 9; if (flag20) { bool flag21 = this.paramFloat.Count < 2; if (!flag21) { bool flag22 = this.paramInts.Count < 1; if (!flag22) { SceneCamera.cameraShake(this.paramFloat[0], this.paramInts[0], this.paramFloat[1]); } } } else { bool flag23 = this.type == 10; if (flag23) { bool flag24 = this.paramFloat.Count < 1; if (!flag24) { bool flag25 = this.paramGo.Count < 1; if (!flag25) { GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.paramGo[0]); gameObject2.transform.SetParent(SelfRole._inst.m_curModel, false); UnityEngine.Object.Destroy(gameObject2, this.paramFloat[0]); } } } else { bool flag26 = this.type == 11; if (flag26) { bool flag27 = this.paramStr.Count < 1; if (!flag27) { List <string> ldialog = this.paramStr; NpcRole npc = null; bool flag28 = this.paramGo != null && this.paramGo.Count > 0 && this.paramGo[0] != null; if (flag28) { npc = this.paramGo[0].GetComponent <NpcRole>(); } DoAfterMgr.instacne.addAfterRender(delegate { dialog.showTalk(ldialog, null, npc, false); }); } } else { bool flag29 = this.type == 12; if (flag29) { bool flag30 = this.paramStr.Count < 1; if (!flag30) { bool flag31 = this.paramGo == null || this.paramGo.Count == 0 || this.paramGo[0] == null; if (flag31) { SelfRole._inst.m_curAni.SetTrigger(this.paramStr[0]); } else { Animator component3 = this.paramGo[0].GetComponent <Animator>(); bool flag32 = component3 != null; if (flag32) { component3.SetTrigger(this.paramStr[0]); } } } } else { bool flag33 = this.type == 13; if (flag33) { bool flag34 = this.paramStr.Count < 1; if (!flag34) { NewbieTeachMgr.getInstance().add(this.paramStr, -1); } } else { bool flag35 = this.type == 14; if (flag35) { bool flag36 = !this.paramBool; if (flag36) { InterfaceMgr.getInstance().floatUI.transform.localScale = Vector3.zero; bool flag37 = joystick.instance != null; if (flag37) { joystick.instance.OnDragOut(null); } } else { InterfaceMgr.getInstance().floatUI.transform.localScale = Vector3.one; } } else { bool flag38 = this.type == 15; if (flag38) { TriggerHanldePoint.lGo = this.paramGo; } else { bool flag39 = this.type == 16; if (flag39) { bool flag40 = this.paramGo.Count == 0; if (!flag40) { foreach (GameObject current3 in this.paramGo) { TriggerHanldePoint component4 = current3.GetComponent <TriggerHanldePoint>(); bool flag41 = component4 != null; if (flag41) { component4.onTriggerHanlde(); } } } } else { bool flag42 = this.type == 17; if (flag42) { bool flag43 = maploading.instance != null; if (flag43) { maploading.instance.closeLoadWait(0.5f); } } } } } } } } } } } } } } } } } }
virtual public void onTriggerHanlde() { // MonsterMgr._inst.AddMonster(transform); if (type == 1) { if (paramInts.Count == 0) { return; } MonsterMgr._inst.AddMonster(paramInts[0], transform.position, 0, transform.localEulerAngles.y); } else if (type == 2)//enable { if (paramGo.Count == 0) { return; } foreach (GameObject go in paramGo) { go.SetActive(true); } } else if (type == 3)//unenable { if (paramGo.Count == 0) { return; } foreach (GameObject go in paramGo) { HiddenItem hideitem = go.GetComponent <HiddenItem>(); if (hideitem != null) { hideitem.hide(); } else { go.SetActive(false); } } } else if (type == 4)//nav { if (paramInts.Count == 0) { return; } int idx = 0; for (int i = 0; i < paramInts.Count; i++) { idx += NavmeshUtils.listARE[paramInts[i]]; } if (idx == 0) { return; } SelfRole._inst.setNavLay(idx); } else if (type == 5) { if (paramGo.Count == 0) { return; } Transform con = paramGo[0].transform; for (int i = 0; i < con.childCount; i++) { GameObject tempgi = con.GetChild(i).gameObject; tempgi.AddComponent <BrokenIten>(); } } else if (type == 6) { if (paramGo.Count == 0) { return; } if (paramFloat.Count == 0) { return; } if (paramBool) { InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_HIDE_ALL); a1_gamejoy.inst_joystick.stopDrag(); } paramGo[1].SetActive(true); SceneCamera.changeAniCamera(paramGo[0], paramFloat[0]); } else if (type == 8) { if (paramGo.Count == 0) { return; } paramGo[0].SetActive(true); HiddenItem hideitem = paramGo[0].GetComponent <HiddenItem>(); if (hideitem != null) { hideitem.hide(); } else { paramGo[0].SetActive(false); } } else if (type == 9) { if (paramFloat.Count < 2) { return; } if (paramInts.Count < 1) { return; } SceneCamera.cameraShake(paramFloat[0], paramInts[0], paramFloat[1]); } else if (type == 10)//eff { if (paramFloat.Count < 1) { return; } if (paramGo.Count < 1) { return; } GameObject tempGo = GameObject.Instantiate(paramGo[0]) as GameObject; tempGo.transform.SetParent(SelfRole._inst.m_curModel, false); Destroy(tempGo, paramFloat[0]); } else if (type == 11)//dialog { if (dialogid <= 0) { return; } SXML ncpxml = XMLMgr.instance.GetSXML("dialog"); SXML xml = ncpxml.GetNode("dialog", "id==" + dialogid); List <string> lstr = new List <string>(); if (xml != null) { List <SXML> l = new List <SXML>(); l = xml.GetNodeList("log"); foreach (SXML s in l) { lstr.Add(s.getString("value")); } } List <string> ldialog = lstr; NpcRole npc = null; if (paramGo != null && paramGo.Count > 0 && paramGo[0] != null) { npc = paramGo[0].GetComponent <NpcRole>(); } DoAfterMgr.instacne.addAfterRender(() => { dialog.showTalk(ldialog, null, npc); }); } else if (type == 12)//act { if (paramStr.Count < 1) { return; } if (paramGo == null || paramGo.Count == 0 || paramGo[0] == null) { SelfRole._inst.m_curAni.SetTrigger(paramStr[0]); } else { Animator anim = paramGo[0].GetComponent <Animator>(); if (anim != null) { anim.SetTrigger(paramStr[0]); } } } else if (type == 13)//newbiecode { if (waitCodesid == 0) { return; } NewbieTeachMgr.getInstance().add(1, waitCodesid, -1); } else if (type == 14)//floatui { if (!paramBool) { //InterfaceMgr.getInstance().floatUI.transform.localScale = Vector3.zero; InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_STORY); if (a1_gamejoy.inst_joystick != null) { a1_gamejoy.inst_joystick.OnDragOut(); } } else { InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL); //InterfaceMgr.getInstance().floatUI.transform.localScale = Vector3.one; } } else if (type == 15)//gos { lGo = paramGo; } else if (type == 16)//group { if (paramGo.Count == 0) { return; } foreach (GameObject go in paramGo) { TriggerHanldePoint tri = go.GetComponent <TriggerHanldePoint>(); if (tri != null) { tri.onTriggerHanlde(); } } } else if (type == 17) { //延迟0.5秒关闭loading界面。解决avatar一闪和一些初始化的东西卡住的问题 if (maploading.instance != null) { maploading.instance.closeLoadWait(0.5f); } } }