private void onEnterGameClick(GameObject go)
        {
            BattleProxy.getInstance();

            Variant chas = muNetCleint.instance.charsInfoInst.getChas();

            if (chaSelectedIndex < 0 || chaSelectedIndex >= chas.Count)
            {
                return;
            }

            uint cid = chas[chaSelectedIndex]["cid"]._uint;

            UIClient.instance.dispatchEvent(
                GameEvent.Create(UI_EVENT.UI_ACT_SELECT_CHAR, this, GameTools.createGroup("cid", cid)));

            UIClient.instance.dispatchEvent(
                GameEvent.Create(UI_EVENT.UI_ACT_ENTER_GAME, this, GameTools.createGroup("cid", cid)));

            //GameObject audio = GameObject.Find("Audio");
            //GameObject.Destroy(audio);

            InterfaceMgr.getInstance().close(InterfaceMgr.A3_SELECTCHA);
            InterfaceMgr.getInstance().DisposeUI(InterfaceMgr.A3_SELECTCHA);
        }
Esempio n. 2
0
 //{
 //    set { minRange = value;/*Mathf.Max(value,1.5f); */}
 //    get { return minRange; }
 //}
 public override void Enter()
 {
     if (muNetCleint.instance.CurServerTimeStamp - exe_action_tm < xml_action_tm || SelfRole._inst.isPlayingSkill)
     {
         return;
     }
     BattleProxy.getInstance().addEventListener(BattleProxy.EVENT_SELF_KILL_MON, OnKillMon);
     //xml_action_tm = 0.0f;
     CHECK_AGAIN : CheckPK();
     if (!SelfRole.UnderPlayerAttack)
     {
         if (PlayerModel.getInstance().pk_state != PK_TYPE.PK_PEACE)
         {
             BaseRole plr = OtherPlayerMgr._inst.FindNearestEnemyOne(SelfRole._inst.m_curModel.transform.position, selector: EnemySelector, pkState: PlayerModel.getInstance().pk_state);
             if (plr != null)
             {
                 SelfRole._inst.m_LockRole = plr;
                 return;
             }
         }
         if ((SelfRole._inst.m_LockRole is ProfessionRole && PlayerModel.getInstance().pk_state == PK_TYPE.PK_PEACE) ||
             SelfRole._inst.m_LockRole == null)
         {
             MonsterRole mon = MonsterMgr._inst.FindNearestMonster(/*SelfRole.fsm.Autofighting ? StateInit.Instance.Origin :*/ SelfRole._inst.m_curModel.position);
             if (mon == null)
             {
                 SelfRole.fsm.ChangeState(StateIdle.Instance);
                 return;
             }
             SelfRole._inst.m_LockRole = mon;
         }
         else
         {
             if (SelfRole.fsm.Autofighting &&
                 Vector3.Distance(SelfRole._inst.m_LockRole.m_curModel.position.ConvertToGamePosition(), SelfRole._inst.m_curModel.position.ConvertToGamePosition()) > StateInit.Instance.Distance)
             {
                 SelfRole._inst.m_LockRole = null;
                 SelfRole.fsm.ChangeState(StateIdle.Instance);
             }
         }
         return;
     }
     else
     {
         if (SelfRole.LastAttackPlayer != null)
         {
             SelfRole._inst.m_LockRole = SelfRole.LastAttackPlayer;
         }
         else
         {
             SelfRole.UnderPlayerAttack = false;
             goto CHECK_AGAIN;
         }
     }
 }
Esempio n. 3
0
        override public void onClosed()
        {
            // 军团buff另加。监听事件EVENT_REMOVE
            A3_LegionProxy.getInstance().removeEventListener(A3_LegionProxy.EVENT_QUIT, Quit);
            // A3_LegionProxy.getInstance().removeEventListener(A3_LegionProxy.EVENT_REMOVE, Quit);
            A3_LegionProxy.getInstance().removeEventListener(A3_LegionProxy.EVENT_CREATE, Join);
            A3_LegionProxy.getInstance().removeEventListener(A3_LegionProxy.EVENT_DELETECLAN, Deleteclan);
            //宠物buff另加。监听事件
            //A3_PetProxy.getInstance().removeEventListener(A3_PetProxy.EVENT_GET_PET, OpenPet);//得到宠物
            A3_PetProxy.getInstance().removeEventListener(A3_PetProxy.CHANGE_PET, changePet);            //更换宠物
            A3_PetProxy.getInstance().removeEventListener(A3_PetProxy.EVENT_HAVE_PET, closePet);         //饲料到期
            A3_PetProxy.getInstance().removeEventListener(A3_PetProxy.EVENT_GET_LAST_TIME, get_pettime); //购买饲料

            BattleProxy.getInstance().removeEventListener(A3_PetProxy.EVENT_GET_LAST_TIME, reshbuff);
        }
Esempio n. 4
0
 public static bool canline()
 {
     print("两次攻击的时间间隔是:" + (NetClient.instance.CurServerTimeStamp - BattleProxy.getInstance().hurt_old_time));
     if (BattleProxy.getInstance().hurt_old_time != -1)
     {
         if (NetClient.instance.CurServerTimeStamp - BattleProxy.getInstance().hurt_old_time > XMLMgr.instance.GetSXML("comm.leave_atk_time").getInt("val"))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(true);
     }
 }
Esempio n. 5
0
 public override void Exit()
 {
     BattleProxy.getInstance().removeEventListener(BattleProxy.EVENT_SELF_KILL_MON, OnKillMon);
 }
Esempio n. 6
0
        private void a3_scene_loaded()
        {
            MapProxy.getInstance().changingMap = false;

            if (!grmap_loading)
            {
                return;
            }

            //   PlayerNameUIMgr.getInstance().Clear();

            //清空音效
            //MediaClient.instance.clearMusic();

            SceneCamera.Init();
            if (SelfRole._inst != null)
            {
                SelfRole._inst.dispose();
            }

            debug.Log("初始化角色");
            SelfRole.Init();

            SelfRole._inst.m_unIID             = PlayerModel.getInstance().iid;
            SelfRole._inst.m_curModel.position = PlayerModel.getInstance().enter_map_pos;
            SelfRole._inst.setNavLay(NavmeshUtils.listARE[1]);
            //debug.Log("地图加载后的坐标为" + SelfRole._inst.m_curModel.position);


            Time.fixedDeltaTime = 0.02f;

            GameObject svr = GameObject.Find("SVR_DATA");

            if (svr != null)
            {
                GameObject.Destroy(svr);
            }

            //主城添加一个z轴的18高度,防止初始化判断在阻挡外面。加了高度后虽然在阻挡外面,但hit返回的xy值正常,z值调整为正常
            float z = 0f;

            if (curSvrConf["id"] == 10 || GRMap.curSvrConf["id"] == 24)
            {
                z = 18f;
            }
            SelfRole._inst.setPos(new Vector3(PlayerModel.getInstance().mapBeginX, z, PlayerModel.getInstance().mapBeginY));

            if (PlayerModel.getInstance().mapBeginroatate > 0f)
            {
                SelfRole._inst.setRoleRoatate(PlayerModel.getInstance().mapBeginroatate);
                PlayerModel.getInstance().mapBeginroatate = 0f;
            }

            DoAfterMgr.instacne.addAfterRender(() =>
            {
                if (MapModel.getInstance().CheckAutoPlay())
                {
                    SelfRole.fsm.StartAutofight();
                }
            });


            GameRoomMgr.getInstance().onChangeLevel(curSvrConf, curSvrMsg);
            grmap_loading = false;

            if (!fristloaded)
            {
                if (showid.Contains(curSvrConf["id"]))
                {
                    InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMAPUI);
                }
                else
                {
                    if (curSvrConf.ContainsKey("pk_hint") && curSvrConf["pk_hint"] == 1)
                    {
                        InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_PKMAPUI);
                        showid.Add(curSvrConf["id"]);
                    }
                    else
                    {
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_PKMAPUI);
                    }
                }
            }
            //打开魔炼之地
            if (a3_fb_finish.ismlzd)
            {
                ArrayList dl = new ArrayList();
                dl.Add("mlzd");
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ACTIVE, dl);
                a3_fb_finish.ismlzd = false;
            }
            if (curSvrConf.ContainsKey("pk_lock"))
            {
                InterfaceMgr.doCommandByLua("a1_low_fightgame.refreskCanPk", "ui/interfaces/low/a1_low_fightgame", false);
            }
            else
            {
                InterfaceMgr.doCommandByLua("a1_low_fightgame.refreskCanPk", "ui/interfaces/low/a1_low_fightgame", true);
            }

            if (a1_gamejoy.inst_skillbar != null)
            {
                if (GRMap.curSvrConf["id"] == 10 || GRMap.curSvrConf["id"] == 24)
                {
                    a1_gamejoy.inst_skillbar.ShowCombatUI(false);
                }
                else
                {
                    a1_gamejoy.inst_skillbar.ShowCombatUI(true);
                }
            }

            if (a3_liteMinimap.instance)
            {
                a3_liteMinimap.instance.refreshMapname();
            }
            InterfaceMgr.doCommandByLua("a1_high_fightgame.refreshMapname", "ui/interfaces/high/a1_high_fightgame", null);

            if (a1_gamejoy.inst_skillbar != null)
            {
                a1_gamejoy.inst_skillbar.refreshAllSkills(SelfRole.s_bStandaloneScene ? 0 : -1);
            }

            if (curSvrConf.ContainsKey("music"))
            {
                MediaClient.instance.PlayMusicUrl("audio_map_" + curSvrConf["music"], null, true);
            }

            fristloaded = false;

            OtherPlayerMgr._inst.onMapLoaded();
            MonsterMgr._inst.onMapLoaded();
            NpcMgr.instance.onMapLoaded();
            BattleProxy.getInstance().onMapLoaded();
        }