private void createMapNpcs() { if (SelfRole.s_bStandaloneScene) { return; } joinWorldInfo jinfo = this.g_mgr.g_netM.getObject(OBJECT_NAME.DATA_JOIN_WORLD) as joinWorldInfo; Variant pinfo = jinfo.mainPlayerInfo; uint mapid = jinfo.mapid; Variant conf = ( this.g_mgr.g_gameConfM.getObject(OBJECT_NAME.CONF_SERVER_MAP) as SvrMapConfig ).getSingleMapConf(mapid); if (conf == null || !conf.ContainsKey("n")) { return; } Variant npcs = conf["n"]; foreach (Variant n in npcs._arr) { int nid = int.Parse(n["nid"]); Variant npc = ( this.g_mgr.g_gameConfM.getObject(OBJECT_NAME.CONF_SERVER_NPC) as SvrNPCConfig ).get_npc_data(nid); if (npc == null) { //DebugTrace.print( "map[ "+mapid+" ] npc[ "+nid +" ] no data ERR!" ); continue; } LGAvatarNpc ct = new LGAvatarNpc(this.g_mgr); _npcs[nid.ToString()] = ct; if (npc.ContainsKey("defdid")) { ct.dialogId = npc["defdid"]; } Variant info = new Variant(); info["x"] = n["x"]._int / GameConstant.GEZI_TRANS_UNITYPOS; info["y"] = n["y"]._int / GameConstant.GEZI_TRANS_UNITYPOS; info["nid"] = n["nid"]; info["name"] = npc["name"]; info["octOri"] = n["r"]; ct.initData(info); ct.init(); } }
public void moveToNpc(int npcid) { LGAvatarNpc npc = LGNpcs.instance.getNpc(npcid); bool flag = npc != null; if (flag) { this.onSelectNpc(npc); } }
public void onSelectNpc(LGAvatarNpc npc) { Variant v = npc.viewInfo; //npc.doTalk(); //return; //switch (npc.npcid) //{ // case 90001: // if (FunctionOpenMgr.instance.checkLv(FunctionOpenMgr.FB_STORY, true)) // { // ArrayList list = new ArrayList(); // //list.Add(TaskModel.getInstance().isNeedToOpenMapId); // //list.Add(TaskModel.getInstance().isNeedToOpenTiLi); // InterfaceMgr.getInstance().open(InterfaceMgr.FB_3D, list); // // InterfaceMgr.getInstance().open(InterfaceMgr.FB, list); // } // break; // case 90004: // if (FunctionOpenMgr.instance.checkLv(FunctionOpenMgr.MYTH_SHOP, true)) // InterfaceMgr.getInstance().open(InterfaceMgr.STICAL); // break; // case 90005: // if (FunctionOpenMgr.instance.checkLv(FunctionOpenMgr.EQUIP_JINJIE, true)) // { // InterfaceMgr.getInstance().open(InterfaceMgr.EQUIP); // } // break; // case 90006: // if (FunctionOpenMgr.instance.checkLv(FunctionOpenMgr.FAMILY, true)) // { // InterfaceMgr.getInstance().open(InterfaceMgr.FAMILY); // } // break; //} }
private void createMapNpcs() { bool s_bStandaloneScene = SelfRole.s_bStandaloneScene; if (!s_bStandaloneScene) { joinWorldInfo joinWorldInfo = this.g_mgr.g_netM.getObject("DATA_JOIN_WORLD") as joinWorldInfo; Variant mainPlayerInfo = joinWorldInfo.mainPlayerInfo; uint mapid = joinWorldInfo.mapid; Variant singleMapConf = (this.g_mgr.g_gameConfM.getObject("SvrMap") as SvrMapConfig).getSingleMapConf(mapid); bool flag = singleMapConf == null || !singleMapConf.ContainsKey("n"); if (!flag) { Variant variant = singleMapConf["n"]; foreach (Variant current in variant._arr) { int npcid = int.Parse(current["nid"]); Variant variant2 = (this.g_mgr.g_gameConfM.getObject("SvrNPC") as SvrNPCConfig).get_npc_data(npcid); bool flag2 = variant2 == null; if (!flag2) { LGAvatarNpc lGAvatarNpc = new LGAvatarNpc(this.g_mgr); this._npcs[npcid.ToString()] = lGAvatarNpc; bool flag3 = variant2.ContainsKey("defdid"); if (flag3) { lGAvatarNpc.dialogId = variant2["defdid"]; } Variant variant3 = new Variant(); variant3["x"] = (float)current["x"]._int / 1.666f; variant3["y"] = (float)current["y"]._int / 1.666f; variant3["nid"] = current["nid"]; variant3["name"] = variant2["name"]; variant3["octOri"] = current["r"]; lGAvatarNpc.initData(variant3); lGAvatarNpc.init(); } } } } }
public void onSelectNpc(LGAvatarNpc npc) { bool flag = base.IsDie(); if (!flag) { npc.faceToAvatar(this); bool flag2 = Vector3.Distance(npc.pGameobject.transform.position, base.pGameobject.transform.position) <= 1f; if (flag2) { base.RotationToPt(npc.x, npc.y); this._reach_to_npc(npc); } else { base.movePosSingle(npc.x, npc.y, delegate(Variant info) { this._reach_to_npc(npc); }, null, 1f, npc); } } }
public void beginTalk(LGAvatarNpc npc) { curIdx = 0; // dialog.showTalk(this); }
public void onSelectNpc(LGAvatarNpc npc) { Variant viewInfo = npc.viewInfo; }
public void beginTalk(LGAvatarNpc npc) { this.curIdx = 0; }