示例#1
0
        IEnumerator ChangePlayerShow(PlayerObj player)
        {
            yield return(null);

            if (null == player)
            {
                yield break;
            }

            if (!CoreEntry.gMorphMgr.IsMorphing)
            {
                if (PlayerData.Instance.RideData.RideState == 1)
                {
                    player.FuckHorse(PlayerData.Instance.RideData.RideID);
                }

                yield return(null);

                if (null == player)
                {
                    yield break;
                }
                //BagInfo baginfo = PlayerData.Instance.BagData.GetBagInfo(BagType.ITEM_BAG_TYPE_EQUIP);
                player.ChangeWeapon(PlayerData.Instance.GetWeaponModelID());

                yield return(null);

                if (null == player)
                {
                    yield break;
                }
                //player.ChangeWing(BagData.GetWingModelID(WingMgr.Instance.GetHasEquipWingId()));  //获取翅膀表id);
                player.ChangeWing(PlayerData.Instance.GetWingModelID());  //获取翅膀表id);
                yield return(null);
            }
            //法宝
            if (null == player)
            {
                yield break;
            }
            player.ShowMagicKey(PlayerData.Instance.MagicKeyDataMgr.GetMasterMagicKey());
            player.ShowMagicKeyByStar(PlayerData.Instance.MagicKeyDataMgr.GetMasterMagicKeyStar());

            //阵法
            if (null == player)
            {
                yield break;
            }
            player.ChangeZhenFa(PlayerData.Instance.BaseAttr.ZhenFa);
        }
示例#2
0
        void FroceToNormalAttack()
        {
            curSkillID = owner.GetNextNormalAttack(ref skillIndex);
            skillDesc  = owner.GetCurSkillDesc(curSkillID);

            owner.FaceTo(giver.thisGameObject.transform.position);
            PlayerObj playerObject = owner.GetComponent <PlayerObj>();

            if (playerObject != null)
            {
                playerObject.SelectTarget(giver);
            }
            owner.OnRunToAttack(curSkillID);
        }
示例#3
0
        /// <summary>
        /// 开始骑马。
        /// </summary>
        public void StartRide()
        {
            RideData rd = PlayerData.Instance.RideData;

            if (rd.RideState == 0)
            {
                ActorObj  actor  = CoreEntry.gActorMgr.GetPlayerActorByServerID(PlayerData.Instance.RoleID);
                PlayerObj player = actor as PlayerObj;
                if (player != null)
                {
                    player.FuckHorse(rd.RideID);
                }
                rd.RideState = 1;
            }
        }
示例#4
0
        public int ChooseSkillOld()
        {
            int nSkillID = -1;

            if (ArenaMgr.Instance.IsArenaFight)
            {
                nSkillID = ArenaMgr.Instance.ChooseSkillID(m_actor);
            }
            else
            {
                PlayerObj player    = m_actor as PlayerObj;
                int       nPriority = 0;
                if (player == null)
                {
                    return(nSkillID);
                }
                //优先使用技能
                foreach (KeyValuePair <int, int> e in player.m_skillBindsDict)
                {
                    if (player.IsInCoolDownTime(e.Value))
                    {
                        continue;
                    }

                    //选择优先级最高的
                    LuaTable skillDesc = ConfigManager.Instance.Skill.GetSkillConfig(e.Value);
                    if (skillDesc != null)
                    {
                        if (skillDesc.Get <int>("priority") > nPriority)
                        {
                            nPriority = skillDesc.Get <int>("priority");
                            nSkillID  = e.Value;
                        }
                    }
                }
            }

            //再使用普通技能
            if (nSkillID == -1)
            {
                nSkillID = PickUpANormalAttack();
            }

            return(nSkillID);
        }
示例#5
0
        public void Update(float dt)
        {
            if (mHPBarHideCount > 0)
            {
                mHPBarHideCount -= dt;
                if (mHPBarHideCount <= 0)
                {
                    mHPBarHideCount = 0;

                    //如果时被选中的对象则不隐藏血条
                    PlayerObj player = CoreEntry.gActorMgr.MainPlayer;
                    if (player == null || player.m_SelectTargetObject != Actor)
                    {
                        OnRemoveHPBar();
                    }
                }
            }
        }
示例#6
0
        //西游网用户轨迹日志 20181023
        public void TrackGameUser(float x, float y)
        {
            return;

            if (bSDK && mSKDType == 1)
            {
                PlayerObj obj = CoreEntry.gActorMgr.MainPlayer;
                if (obj == null)
                {
                    return;
                }
                //if (!obj.isJoystickMove) return;

                string          ic         = "TrackEvent";
                string          cat        = "User";
                string          act        = "Track";
                string          channel_id = XYSDK.Instance.getMasterID();                                                               // 渠道ID
                string          app_id     = XYSDK.Instance.GetAppID();                                                                  //应用ID
                string          server_id  = SG.Account.Instance.ServerId.ToString();                                                    //服务器ID
                string          cserver_id = SG.Account.Instance.ServerId.ToString();                                                    //当前服务器ID
                LuaTable        G          = LuaMgr.Instance.GetLuaEnv().Global;
                string          user_id    = "" + G.GetInPath <int>("ModelManager.LoginModel.userID");                                   //用户ID
                string          role_id    = PlayerData.Instance.RoleID.ToString();                                                      //角色ID
                string          role_name  = WWW.EscapeURL("[" + Account.Instance.ServerId.ToString() + "]" + PlayerData.Instance.Name); //角色名称
                string          client_ip  = Account.Instance.GetExtranetIPAddress();                                                    //客户端IP
                System.TimeSpan ts         = System.DateTime.UtcNow - new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
                long            lt         = (long)ts.TotalSeconds;
                string          event_time = lt.ToString();                                                                                                                    //事件时间
                string          log_id     = Bundle.Md5Tool.Md5Sum(channel_id + app_id + server_id + "UserTrack" + event_time + user_id + role_id + Random.Range(1, 1000000)); //日志ID
                string          map_type   = CoreEntry.gGameMgr.GetCurSceneType().ToString();                                                                                  //地图类型
                string          map_id     = MainRole.Instance.mapid.ToString();                                                                                               //地图ID
                string          x_value    = x.ToString();                                                                                                                     //X坐标
                string          y_value    = "0";                                                                                                                              //y坐标
                string          z_value    = y.ToString();                                                                                                                     //z坐标
                string          track_id   = startIDscene;                                                                                                                     //追踪ID

                string url = string.Format("http://analytics.52xiyou.com/mg.json?ic={0}&cat={1}&act={2}&channel_id={3}&app_id={4}&server_id={5}&cserver_id={6}&user_id={7}&role_id={8}&role_name={9}&client_ip={10}&event_time={11}&log_id={12}&map_type={13}&map_id={14}&x_value={15}&y_value={16}&z_value={17}&track_id={18}",
                                           ic, cat, act, channel_id, app_id, server_id, cserver_id,
                                           user_id, role_id, role_name, client_ip,
                                           event_time, log_id, map_type, map_id, x_value, y_value, z_value, track_id);
                //Debug.Log(url);
                MonoInstance.Instance.StartCoroutine(HttpGet(url));
            }
        }
示例#7
0
        private void DoMorphing(long serverID, int changeID)
        {
            LuaTable changeCfg = ConfigManager.Instance.Actor.GetChangeConfig(changeID);

            if (null == changeCfg)
            {
                return;
            }

            mMorChangeDict[serverID] = changeID;

            if (serverID == MainRole.Instance.serverID)
            {
                if (isMorphing)
                {
                    return;
                }
                isMorphing      = true;
                morphModelID    = changeCfg.Get <int>("model_id");
                morphModelScale = changeCfg.Get <float>("scale");
                PlayerObj actor = CoreEntry.gActorMgr.MainPlayer;
                if (actor != null)
                {
                    //StateParameter param = new StateParameter();
                    //param.state = ACTOR_STATE.AS_FIT;
                    //actor.RequestChangeState(param);
                    //this.Invoke("MeMorphingBegin", actor.GetActionLength("fit"));
                    MeMorphingBegin();
                }
            }
            else
            {
                mMorDict[serverID] = true;
                OtherMorphingBegin(serverID, changeID, changeCfg.Get <float>("scale"));
            }

            EventParameter parameter = EventParameter.Get();

            parameter.longParameter = serverID;
            parameter.intParameter  = changeID;
            CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_SC_CHANGE_BEGIN, parameter);
        }
示例#8
0
        /// <summary>
        /// 显示装备改变效果。
        /// </summary>
        /// <param name="id">装备ID。</param>
        public void ShowEquipChange(int id)
        {
            LuaTable cfg = ConfigManager.Instance.BagItem.GetItemConfig(id);

            if (cfg == null)
            {
                return;
            }

            //判断装备位置
            int pos = cfg.Get <int>("pos");

            if (pos <= 10)
            {
                PlayerObj player = CoreEntry.gActorMgr.MainPlayer;
                if (player != null)
                {
                    player.ShowEquipChange();
                }
            }
        }
示例#9
0
        private void MeMorphingBegin()
        {
            PlayerObj actor = CoreEntry.gActorMgr.MainPlayer;

            if (null == actor)
            {
                return;
            }
            Vector3 prePos = actor.transform.position;

            //var isWild = TaskMgr.IsWildTask;
            //var isAuto = AutoAIRunner.IsInAutoMode_Ex;
            //AutoAIRunner.StopAll();

            if (PlayerData.Instance.RideData.RideState == 1)
            {
                //PlayerData.Instance.RideData.mRideState = 0;
                PlayerData.Instance.RideData.SendChangeRideStateRequest(0);
                CoreEntry.gActorMgr.MainPlayer.GetDownHorse();
            }
            CoreEntry.gActorMgr.RemoveActor(actor);

            GameObject obj = CoreEntry.gSceneLoader.LoadPlayer(morphModelID);

            if (null != obj)
            {
                obj.transform.position    = prePos;
                obj.transform.eulerAngles = actor.transform.eulerAngles;
                obj.transform.localScale  = new Vector3(Scale, Scale, Scale);
            }

            //if (isAuto)
            //{
            //    AutoAIRunner.Init();
            //    TaskMgr.IsWildTask = isWild;
            //    AutoAIRunner.SetAutoFight(true, null);
            //}
            //else if (TaskMgr.LastClickTaskID > 0)
            //{
            //    AutoAIRunner.Init();
            //    AutoAIRunner.SetAutoTask(true);
            //}

            actor.RecycleObj();
            actor.HideBlobShadow();

            //ReSetSkills(0);
            CoreEntry.gActorMgr.MainPlayer.ReBindSkill();
            CoreEntry.gActorMgr.MainPlayer.RebindSkillButton();

            GameObject mEffectObj = CoreEntry.gGameObjPoolMgr.Instantiate(mUIEffectPath);

            if (null != mEffectObj)
            {
                SceneEfxPool efx = mEffectObj.GetComponent <SceneEfxPool>();
                if (efx == null)
                {
                    efx = mEffectObj.AddComponent <SceneEfxPool>();
                }
                if (efx != null)
                {
                    efx.Init(transform.position, 2.0f);
                }

                PanelBase mainPanel = MainPanelMgr.Instance.GetPanel("UIMain");
                if (mainPanel != null)
                {
                    mEffectObj.transform.SetParent(mainPanel.transform);
                    mEffectObj.transform.localPosition = Vector3.zero;
                    mEffectObj.transform.localScale    = Vector3.one;
                }
            }
            mEffectObj = CoreEntry.gGameObjPoolMgr.Instantiate(mPlayerEffectPath);
            if (null != mEffectObj)
            {
                SceneEfxPool efx = mEffectObj.GetComponent <SceneEfxPool>();
                if (efx == null)
                {
                    efx = mEffectObj.AddComponent <SceneEfxPool>();
                }
                if (efx != null)
                {
                    efx.Init(transform.position, 2.0f);
                }

                if (null != obj)
                {
                    mEffectObj.transform.position = obj.transform.position;
                }
            }

            PlayerObj mainObj = CoreEntry.gActorMgr.MainPlayer;

            if (null != mainObj)
            {
                //mainObj.ChangeWeapon(PlayerData.Instance.GetWeaponModelID());
                StateParameter param = new StateParameter();
                param.state = ACTOR_STATE.AS_ENTER;
                mainObj.RequestChangeState(param);
            }
        }
示例#10
0
        void Update()
        {
            //add by lzp

            if (!MapMgr.Instance.InMainCity)
            {
                if (!CoreEntry.GameStart || !CoreEntry.InFightScene)
                {
                    return;
                }
            }


            if (true == IsMouseOverUI())
            {
                return;
            }

            Vector3 touchPos = Vector3.zero;

            if (Application.platform == RuntimePlatform.WindowsEditor)
            {
                //if (Input.GetMouseButtonDown(1))
                //{


                //    HitBack();
                //    //Invoke("HitBack",0.3f);
                //}
                if (Input.GetMouseButtonDown(0))
                {
                    touchPos = Input.mousePosition;


                    {
                        ////取消自动战斗
                        //PlayerObj player = CoreEntry.gActorMgr.MainPlayer ;
                        //if (player != null && CoreEntry.gGameMgr.AutoFight)
                        //{
                        //        CoreEntry.gGameMgr.StopAutoTask();
                        //    CoreEntry.gGameMgr.AutoFight = false;
                        //        player.CancleAutoSet();
                        //}
                    }
                }
            }
            else if (Input.touchCount > 0)
            {
                int   count = Input.touchCount;
                Touch touch = Input.GetTouch(count - 1);
                touchPos = touch.position;

                // PlayerObj player = CoreEntry.gActorMgr.MainPlayer;

                //{

                //        // 取消自动战斗
                //        CoreEntry.gGameMgr.StopAutoTask();
                //        if (player != null && CoreEntry.gGameMgr.AutoFight)
                //         player.CancleAutoSet();


                //}


                //    PlayerObj player = CoreEntry.gTeamMgr.MainPlayer.GetComponent<PlayerObj>();
                //   player.m_bAutoMove = false;
            }


            if (touchPos != Vector3.zero)
            {
                if (CoreEntry.gCameraMgr.MainCamera == null)
                {
                    return;
                }

                Ray ray = CoreEntry.gCameraMgr.MainCamera.ScreenPointToRay(touchPos);
                //Ray uiRay = CoreEntry.uiMgr.uiCamera.ScreenPointToRay(touchPos);
                //if (Physics.Raycast(uiRay, 1000.0f, uiLayerMask))
                //{
                //    return;
                //}
                PlayerObj player = CoreEntry.gActorMgr.MainPlayer;

                //{
                //    //取消自动战斗

                //    if (player != null && CoreEntry.gGameMgr.AutoFight)
                //        player.CancleAutoSet();

                //}


                player.m_bAutoMove = false;

                PlayerAutoMove playerMove = player.GetComponent <PlayerAutoMove>();
                if (playerMove)
                {
                    playerMove.Stop(true);
                }


                RaycastHit rayCastHit;

                if (Physics.Raycast(ray, out rayCastHit, 1000.0f, groundLayerMask))
                {
                    if (m_callbackMove != null)
                    {
                        m_callbackMove(rayCastHit.point);
                    }
                }
                else
                {
                    //如果没取到,就使用NAVMESH
                    NavMeshHit hit;
                    if (NavMesh.SamplePosition(CoreEntry.gCameraMgr.MainCamera.ScreenToWorldPoint(touchPos), out hit, 100.0f, -1))
                    {
                        if (null != m_callbackMove)
                        {
                            m_callbackMove(hit.position);
                        }
                    }
                }
            }
            else
            {
                PlayerObj player = CoreEntry.gActorMgr.MainPlayer;
                if (player != null)
                {
                    player.m_bAutoMove = true;
                }
            }
        }