override protected void Model_Loaded_Over() { m_unLegionID = (uint)LOGION_DEF.LNDF_PLAYER; if (m_bUserSelf) { //SelfHurtPoint shtt = m_curPhy.gameObject.AddComponent<SelfHurtPoint>(); //shtt.m_selfRole = this; ismyself = true; } else { //OtherHurtPoint ohtt = m_curPhy.gameObject.AddComponent<OtherHurtPoint>(); //ohtt.m_otherRole = this; ismyself = false; } //roleName = "我是主角"; PlayerNameUIMgr.getInstance().show(this); m_proAvatar.Init_PA(m_eMPProfession, m_strMPAvatarPath, "l_", m_curGameObj.layer, EnumMaterial.EMT_EQUIP_L, m_curModel); //if (m_isMain && viewType != VIEW_TYPE_ALL) // refreshViewType(VIEW_TYPE_ALL); }
public void Init(string prefab_path, int layer, Vector3 pos, bool isUser = false) { base.Init(prefab_path, layer, pos, 0f, isUser); this.m_unLegionID = 2u; bool bUserSelf = this.m_bUserSelf; if (bUserSelf) { MonsterPlayer.ismyself = true; } else { MonsterPlayer.ismyself = false; } PlayerNameUIMgr.getInstance().show(this); base.curhp = (base.maxHp = 2000); this.m_proAvatar = new ProfessionAvatar(); this.m_proAvatar.Init(this.m_strAvatarPath, "l_", this.m_curGameObj.layer, EnumMaterial.EMT_EQUIP_L, this.m_curModel, ""); bool flag = this.m_isMain && this.viewType != BaseRole.VIEW_TYPE_ALL; if (flag) { base.refreshViewType(BaseRole.VIEW_TYPE_ALL); } }
private void onViewAvatar_Change(Variant v) { debug.Log("PPP" + v.dump()); uint num = v["iid"]; bool flag = v.ContainsKey("serial_kp"); if (flag) { bool flag2 = v["iid"] == ModelBase <PlayerModel> .getInstance().iid; if (flag2) { bool flag3 = SelfRole._inst != null; if (flag3) { ModelBase <PlayerModel> .getInstance().serial = v["serial_kp"]; SelfRole._inst.serial = v["serial_kp"]; PlayerNameUIMgr.getInstance().refreserialCount(SelfRole._inst, v["serial_kp"]); } } } bool flag4 = v.ContainsKey("strike_back_tm"); if (flag4) { bool flag5 = v["iid"] == ModelBase <PlayerModel> .getInstance().iid; if (flag5) { bool flag6 = v.ContainsKey("strike_back_tm"); if (flag6) { bool flag7 = SelfRole._inst != null; if (flag7) { SelfRole._inst.hidbacktime = v["strike_back_tm"]; bool flag8 = v["strike_back_tm"] == 0; if (flag8) { ModelBase <PlayerModel> .getInstance().hitBack = 0u; PlayerNameUIMgr.getInstance().refresHitback(SelfRole._inst, 0, true); } else { ModelBase <PlayerModel> .getInstance().hitBack = SelfRole._inst.hidbacktime - (uint)NetClient.instance.CurServerTimeStamp; PlayerNameUIMgr.getInstance().refresHitback(SelfRole._inst, (int)(SelfRole._inst.hidbacktime - (uint)NetClient.instance.CurServerTimeStamp), true); } } } } } else { OtherPlayerMgr._inst.refreshPlayerInfo(v); } }
void Start() { int npc_id = -1; int.TryParse(gameObject.name, out npc_id); if (NpcMgr.instance.xNpc.ContainsKey(npc_id)) { m_strModelPath = NpcMgr.instance.xNpc[npc_id].model; GAMEAPI.ABModel_LoadGameObject(m_strModelPath, Model_LoadedOK, null); } SXML ncpxml = XMLMgr.instance.GetSXML("npcs"); SXML xml = ncpxml.GetNode("npc", "id==" + id); if (xml != null) { name = xml.getString("name"); } BoxCollider box = GetComponent <BoxCollider>(); if (box == null) { box = gameObject.AddComponent <BoxCollider>(); box.center = new Vector3(0, 1.2f, 0); box.size = new Vector3(1, 2, 1); } headOffset = box.center; headOffset.y = headOffset.y + (box.size.y / 2); if (nav) { NavMeshAgent move = GetComponent <NavMeshAgent>(); if (move == null) { move = gameObject.AddComponent <NavMeshAgent>(); } move.speed = 0.1f; move.avoidancePriority = 0; move.walkableMask = NavmeshUtils.allARE; } gameObject.layer = EnumLayer.LM_NPC; NpcMgr.instance.addRole(this); headNub = transform.Find("headnub"); if (headNub == null) { headNub = transform.Find("Bip001 HeadNub"); } PlayerNameUIMgr.getInstance().show(this); }
private void Start() { BoxCollider boxCollider = base.GetComponent <BoxCollider>(); bool flag = boxCollider == null; if (flag) { boxCollider = base.gameObject.AddComponent <BoxCollider>(); boxCollider.center = new Vector3(0f, 1.2f, 0f); boxCollider.size = new Vector3(1f, 2f, 1f); } this.headOffset = boxCollider.center; this.headOffset.y = this.headOffset.y + boxCollider.size.y / 2f; bool flag2 = this.nav; if (flag2) { NavMeshAgent navMeshAgent = base.GetComponent <NavMeshAgent>(); bool flag3 = navMeshAgent == null; if (flag3) { navMeshAgent = base.gameObject.AddComponent <NavMeshAgent>(); } navMeshAgent.speed = 0.1f; navMeshAgent.avoidancePriority = 0; navMeshAgent.walkableMask = NavmeshUtils.allARE; } this.anim = base.GetComponent <Animator>(); base.gameObject.layer = EnumLayer.LM_NPC; NpcMgr.instance.addRole(this); this.headNub = base.transform.Find("headnub"); bool flag4 = this.headNub == null; if (flag4) { this.headNub = base.transform.Find("Bip001 HeadNub"); } PlayerNameUIMgr.getInstance().show(this); }
void onViewAvatar_Change(Variant v) { //debug.Log("有人在我旁边换装了!!!~~~~~~~~~~~~~~~~~~~~~~~~"); //debug.Log("有人在我旁边换装了!!!~~~~~~~~~~~~~~~~~~~~~~~~"); //debug.Log("有人在我旁边换装了!!!~~~~~~~~~~~~~~~~~~~~~~~~"); debug.Log("周围人状态变化:" + v.dump()); uint iid = v["iid"]; if (v.ContainsKey("serial_kp")) { if (v["iid"] == PlayerModel.getInstance().iid) { if (SelfRole._inst != null) { PlayerModel.getInstance().serial = v["serial_kp"]; SelfRole._inst.serial = v["serial_kp"]; PlayerNameUIMgr.getInstance().refreserialCount(SelfRole._inst, v["serial_kp"]); } } } if (v.ContainsKey("strike_back_tm")) { //反击buff时间戳玩家自己 if (v["iid"] == PlayerModel.getInstance().iid) { if (v.ContainsKey("strike_back_tm")) { if (SelfRole._inst != null) { SelfRole._inst.hidbacktime = v["strike_back_tm"]; if (v["strike_back_tm"] == 0) { PlayerModel.getInstance().hitBack = 0; PlayerNameUIMgr.getInstance().refresHitback(SelfRole._inst, 0, true); } else { PlayerModel.getInstance().hitBack = SelfRole._inst.hidbacktime - (uint)NetClient.instance.CurServerTimeStamp; PlayerNameUIMgr.getInstance().refresHitback(SelfRole._inst, (int)(SelfRole._inst.hidbacktime - (uint)NetClient.instance.CurServerTimeStamp), true); } //debug.Log("时间1:" + SelfRole._inst.hidbacktime + "时间2:" + (uint)NetClient.instance.CurServerTimeStamp); //debug.Log("玩家自己受到时间:" + (int)(SelfRole._inst.hidbacktime - (uint)NetClient.instance.CurServerTimeStamp)); } } } else { OtherPlayerMgr._inst.refreshPlayerInfo(v); } } else { OtherPlayerMgr._inst.refreshPlayerInfo(v, false); } if (v.ContainsKey("title_sign")) { if (v["iid"] != PlayerModel.getInstance().iid) { int title_sign = v["title_sign"]._int; uint cid = v["cid"]._uint; bool ishow = false; if (v.ContainsKey("title_sign_display")) { ishow = v["title_sign_display"]; } PlayerNameUIMgr.getInstance().SetOtherTitle(cid, title_sign, ishow); } } //人物修改名字 if (v.ContainsKey("name")) { if (v["iid"] == PlayerModel.getInstance().iid) { PlayerModel.getInstance().name = v["name"]; if (SelfRole._inst != null) { SelfRole._inst.roleName = v["name"]; PlayerNameUIMgr.getInstance().refresName(SelfRole._inst); InterfaceMgr.getInstance().close(InterfaceMgr.A3_CHANGE_NAME); } } else { ProfessionRole otherRole = OtherPlayerMgr._inst.GetOtherPlayer(v["iid"]); otherRole.roleName = v["name"]; PlayerNameUIMgr.getInstance().refresName(otherRole); } } }
public void OnRefreshTitle() { PlayerNameUIMgr.getInstance().refreshTitlelv(this, this.title_id); }
public void dispose() { PlayerNameUIMgr.getInstance().hide(this); }
public void onAttchange(Variant msgData) { debug.Log("onAttchange::" + msgData.dump()); BaseRole role = getRole(msgData["iid"]); if (role == null) { return; } //if (msgData.ContainsKey("hpadd") && msgData["hpadd"].ContainsKey("die") && msgData["hpadd"]["die"]._bool) // role.Die(msgData); bool isUser = role.m_isMain; if (msgData.ContainsKey("speed") && role is ProfessionRole) { var pro = (role as ProfessionRole); pro.speed = msgData["speed"]._int; if (isUser) { PlayerModel.getInstance().speed = pro.speed; } } uint frm_iid = 0; LGAvatarGameInst frm_lc = null; if (msgData.ContainsKey("hpchange")) { Variant hpchanged = msgData["hpchange"]; int hpchange = hpchanged["hpchange"]; int curhp = hpchanged["hp_left"]; Variant d = new Variant(); if (isUser) { PlayerModel.getInstance().modHp(curhp); } if (hpchange > 0) { role.modHp(curhp); if (isUser) { FightText.play(FightText.HEAL_TEXT, role.getHeadPos(), hpchange); } if (healEff == null) { healEff = GAMEAPI.ABFight_LoadPrefab("FX_comFX_fuwenFX_FX_fuwen_chuyong"); } if (healEff != null && role is ProfessionRole) { GameObject fx_inst = GameObject.Instantiate(healEff) as GameObject; GameObject.Destroy(fx_inst, 1f); fx_inst.transform.SetParent(role.m_curModel, false); } if (msgData.ContainsKey("rune_ids")) { List <Variant> l = msgData["rune_ids"]._arr; foreach (Variant rune_id in l) { FightText.play(FightText.ADD_IMG_TEXT, role.getHeadPos(), hpchange, false, rune_id); } } } else if (hpchange < 0) { frm_iid = hpchanged["frm_iid"]; BaseRole frm = RoleMgr._instance.getRole(frm_iid); if (msgData.ContainsKey("rune_ids")) { Variant rune = msgData["rune_ids"]; if (rune.Count > 0) { int id_rune = rune[0]; List <Variant> l = msgData["rune_ids"]._arr; foreach (Variant rune_id in l) { role.onServerHurt(-hpchange, curhp, hpchanged["die"], frm, id_rune); } } } } } if (msgData.ContainsKey("mpchange")) { Variant mpchanged = msgData["mpchange"]; int mpchange = mpchanged["mpchange"]; int curmp = mpchanged["mp_left"]; if (isUser) { PlayerModel.getInstance().modMp(curmp); } } if (msgData.ContainsKey("pk_state")) { int pkstate = msgData["pk_state"]; switch (pkstate) { case 0: role.m_ePK_Type = PK_TYPE.PK_PEACE; break; case 1: role.m_ePK_Type = PK_TYPE.PK_PKALL; break; case 2: role.m_ePK_Type = PK_TYPE.PK_TEAM; break; case 3: role.m_ePK_Type = PK_TYPE.PK_LEGION; break; case 4: role.m_ePK_Type = PK_TYPE.PK_HERO; break; case 5: role.m_ePK_Type = PK_TYPE.Pk_SPOET; break; } ; } if (msgData.ContainsKey("clanid")) { role.m_unLegionID = msgData["clanid"]; } if (msgData.ContainsKey("teamid")) { role.m_unTeamID = msgData["teamid"]; if (isUser) { PlayerModel.getInstance().teamid = role.m_unTeamID; PlayerNameUIMgr.getInstance().refeshHpColor(); } else { PlayerNameUIMgr.getInstance().refeshHpColor(role); } } if (msgData.ContainsKey("rune_ids")) { List <Variant> l = msgData["rune_ids"]._arr; foreach (Variant rune_id in l) { GameObject eff = EffMgr.getRuneEff(rune_id._int); if (eff != null) { GameObject fx_inst = GameObject.Instantiate(eff) as GameObject; GameObject.Destroy(fx_inst, 2f); fx_inst.transform.SetParent(role.m_curModel, false); } } //if (!msgData.ContainsKey("hpchange")) //{ // foreach (Variant rune_id in l) // { // FightText.play(FightText.IMG_TEXT, role.getHeadPos(), 0, false, rune_id); // } //} } if (msgData.ContainsKey("sprite_flag")) { uint call = msgData["sprite_flag"]; uint iid = msgData["iid"]; var vv = MonsterMgr._inst.getMonster(iid); if (vv != null) { SkinnedMeshRenderer render = vv.m_curModel.FindChild("body").GetComponent <SkinnedMeshRenderer>(); switch (call) { case 0: foreach (var v in render.sharedMaterials) { v.shader = Shader.Find("A3/A3_Char_Streamer_H"); v.SetColor("_RimColor", new Color(0, 0, 0, 0)); v.SetFloat("_RimWidth", 0f); } break; case 1: render.sharedMaterial = U3DAPI.U3DResLoad <Material>("default/monster_1021_heite_gold"); break; } } } if (isUser == false) { if (msgData.ContainsKey("dress")) { var _role = role as ProfessionRole; _role.rideId = msgData.getValue("dress")._int; if (msgData.getValue("mount")._uint == (uint)RIDESTATE.UP && _role != null) { _role.ridestate = RIDESTATE.UP; if (_role.invisible == false && _role.dianjiTime == -1 && _role.isUp == false) { _role.ChangeRideState(true); } //_role.set_Ride( msgData.getValue( "dress" )._int); } else if (msgData.getValue("mount")._uint == ( uint )RIDESTATE.Down && _role != null) { _role.ridestate = RIDESTATE.Down; _role.Remove_Ride(); } } } //其他玩家坐骑切换 //if (msgData.ContainsKey("speed")) // role.modSpeed(msgData["speed"]._int); //if (msgData.ContainsKey("maxhp")) //{ // int maxhp = msgData["maxhp"]; // role.modMaxHp(maxhp); // if (isUser) // { // PlayerModel.getInstance().max_hp = maxhp; // } //} //if (msgData.ContainsKey("maxdp")) // role.modMaxDp(msgData["maxdp"]._int); //if (msgData.ContainsKey("in_pczone")) //{ // if (role.isMainPlayer()) // { // if (msgData["in_pczone"]._bool) // { // // lgGeneral.PKStateChange(0);需要切换pk模式 lucisa // } // lguiMain.PczoneChange(msgData["in_pczone"]._bool); // } // this.in_pczone = msgData["in_pczone"]._bool; //} //if (msgData.ContainsKey("follow")) //{ // this.follow = msgData["follow"]._bool; //} //if (msgData.ContainsKey("ghost")) //{ // this.ghost = msgData["ghost"]._bool; //} //if (msgData.ContainsKey("ride_mon_id")) //{ // this.ride_mon = msgData["ride_mon_id"];//坐骑 lucisa //} }
public void refreshViewData1(Variant v) { int carr = v["carr"]; if (v.ContainsKey("eqp")) { m_roleDta.m_BodyID = 0; m_roleDta.m_BodyFXID = 0; m_roleDta.m_EquipColorID = 0; m_roleDta.m_Weapon_LID = 0; m_roleDta.m_Weapon_LFXID = 0; m_roleDta.m_Weapon_RID = 0; m_roleDta.m_Weapon_RFXID = 0; foreach (Variant p in v["eqp"]._arr) { a3_ItemData data = a3_BagModel.getInstance().getItemDataById(p["tpid"]); if (data.equip_type == 3) { int bodyid = (int)data.tpid; int bodyFxid = p["intensify"]; m_roleDta.m_BodyID = bodyid; m_roleDta.m_BodyFXID = bodyFxid; uint colorid = 0; if (p.ContainsKey("colour")) { colorid = p["colour"]; } m_roleDta.m_EquipColorID = colorid; } if (data.equip_type == 6) { int weaponid = (int)data.tpid; int weaponFxid = p["intensify"]; switch (carr) { case 2: m_roleDta.m_Weapon_RID = weaponid; m_roleDta.m_Weapon_RFXID = weaponFxid; break; case 3: m_roleDta.m_Weapon_LID = weaponid; m_roleDta.m_Weapon_LFXID = weaponFxid; break; case 5: m_roleDta.m_Weapon_LID = weaponid; m_roleDta.m_Weapon_LFXID = weaponFxid; m_roleDta.m_Weapon_RID = weaponid; m_roleDta.m_Weapon_RFXID = weaponFxid; break; } } } } if (v.ContainsKey("wing")) { m_roleDta.m_WindID = v["wing"]; m_roleDta.m_WingFXID = v["wing"]; } //军衔SS if (v.ContainsKey("ach_title")) { title_id = v["ach_title"]; isactive = v["title_display"]._bool; PlayerNameUIMgr.getInstance().refreshTitlelv(this, title_id); } if (v.ContainsKey("lvl")) { lvl = v["lvl"]; } if (v.ContainsKey("combpt")) { combpt = v["combpt"]; } if (v.ContainsKey("clname")) { clanName = v["clname"]; } ArrayList arry = new ArrayList(); arry.Add(m_unCID); arry.Add(combpt); if (FriendProxy.getInstance() != null) { FriendProxy.getInstance().reFreshProfessionInfo(arry); } // if (OtherPlayerMgr._inst.VIEW_PLAYER_TYPE == 1 || m_isMain) //refreshViewType(VIEW_TYPE_ALL); //onRefresh_ViewType(); set_weaponl(m_roleDta.m_Weapon_LID, m_roleDta.m_Weapon_LFXID); set_weaponr(m_roleDta.m_Weapon_RID, m_roleDta.m_Weapon_RFXID); set_wing(m_roleDta.m_WindID, m_roleDta.m_WingFXID); set_body(m_roleDta.m_BodyID, m_roleDta.m_BodyFXID); }
public void refreshViewData1(Variant v) { int num = v["carr"]; bool flag = v.ContainsKey("eqp"); if (flag) { this.m_roleDta.m_BodyID = 0; this.m_roleDta.m_BodyFXID = 0; this.m_roleDta.m_EquipColorID = 0u; this.m_roleDta.m_Weapon_LID = 0; this.m_roleDta.m_Weapon_LFXID = 0; this.m_roleDta.m_Weapon_RID = 0; this.m_roleDta.m_Weapon_RFXID = 0; foreach (Variant current in v["eqp"]._arr) { a3_ItemData itemDataById = ModelBase <a3_BagModel> .getInstance().getItemDataById(current["tpid"]); bool flag2 = itemDataById.equip_type == 3; if (flag2) { int tpid = (int)itemDataById.tpid; int bodyFXID = current["intensify"]; this.m_roleDta.m_BodyID = tpid; this.m_roleDta.m_BodyFXID = bodyFXID; uint equipColorID = 0u; bool flag3 = current.ContainsKey("colour"); if (flag3) { equipColorID = current["colour"]; } this.m_roleDta.m_EquipColorID = equipColorID; } bool flag4 = itemDataById.equip_type == 6; if (flag4) { int tpid2 = (int)itemDataById.tpid; int num2 = current["intensify"]; switch (num) { case 2: this.m_roleDta.m_Weapon_RID = tpid2; this.m_roleDta.m_Weapon_RFXID = num2; break; case 3: this.m_roleDta.m_Weapon_LID = tpid2; this.m_roleDta.m_Weapon_LFXID = num2; break; case 5: this.m_roleDta.m_Weapon_LID = tpid2; this.m_roleDta.m_Weapon_LFXID = num2; this.m_roleDta.m_Weapon_RID = tpid2; this.m_roleDta.m_Weapon_RFXID = num2; break; } } } } bool flag5 = v.ContainsKey("wing"); if (flag5) { this.m_roleDta.m_WindID = v["wing"]; this.m_roleDta.m_WingFXID = v["wing"]; } bool flag6 = v.ContainsKey("ach_title"); if (flag6) { base.title_id = v["ach_title"]; base.isactive = v["title_display"]._bool; PlayerNameUIMgr.getInstance().refreshTitlelv(this, base.title_id); } bool flag7 = v.ContainsKey("lvl"); if (flag7) { this.lvl = v["lvl"]; } bool flag8 = v.ContainsKey("combpt"); if (flag8) { this.combpt = v["combpt"]; } bool flag9 = v.ContainsKey("clname"); if (flag9) { this.clanName = v["clname"]; } ArrayList arrayList = new ArrayList(); arrayList.Add(this.m_unCID); arrayList.Add(this.combpt); bool flag10 = BaseProxy <FriendProxy> .getInstance() != null; if (flag10) { BaseProxy <FriendProxy> .getInstance().reFreshProfessionInfo(arrayList); } base.refreshViewType(BaseRole.VIEW_TYPE_ALL); this.onRefreshViewType(); }