예제 #1
0
        void ShowEnterEfx()
        {
            GameObject enterFx = CoreEntry.gGameObjPoolMgr.Instantiate("Effect/scence/sf_effect/sf_playstart_vfx");

            if (null != enterFx)
            {
                enterFx.transform.parent        = transform;
                enterFx.transform.localPosition = Vector3.zero;
                enterFx.transform.localRotation = Quaternion.identity;
                enterFx.transform.localScale    = Vector3.one;
                SceneEfxPool efx = enterFx.GetComponent <SceneEfxPool>();

                if (efx == null)
                {
                    efx = enterFx.AddComponent <SceneEfxPool>();
                }
                if (efx != null)
                {
                    //CoreEntry.gAudioMgr.PlayUISound(900007, enterFx);
                    efx.Init(transform.position, 2.5f);
                }
            }
        }
예제 #2
0
        public void ZhuanSheng()
        {
            GameObject mLvupEffectObj = CoreEntry.gGameObjPoolMgr.Instantiate("Effect/skill/buff/fx_buff_zhuansheng");

            if (null != mLvupEffectObj)
            {
                mLvupEffectObj.transform.parent        = transform;
                mLvupEffectObj.transform.localPosition = Vector3.zero;
                mLvupEffectObj.transform.localRotation = Quaternion.identity;
                mLvupEffectObj.transform.localScale    = Vector3.one;
                SceneEfxPool efx = mLvupEffectObj.GetComponent <SceneEfxPool>();

                if (efx == null)
                {
                    efx = mLvupEffectObj.AddComponent <SceneEfxPool>();
                }
                if (efx != null)
                {
                    //CoreEntry.gAudioMgr.PlayUISound(900007, mLvupEffectObj);
                    efx.Init(transform.position, 5f);
                }
            }
        }
예제 #3
0
        void OnLevelUp(GameEvent ge, EventParameter parameter)
        {
            GameObject mLvupEffectObj = CoreEntry.gGameObjPoolMgr.Instantiate("Effect/skill/buff/fx_buff_shengji");

            if (null != mLvupEffectObj)
            {
                mLvupEffectObj.transform.parent        = transform;
                mLvupEffectObj.transform.localPosition = Vector3.zero;
                mLvupEffectObj.transform.localRotation = Quaternion.identity;
                mLvupEffectObj.transform.localScale    = Vector3.one;
                SceneEfxPool efx = mLvupEffectObj.GetComponent <SceneEfxPool>();

                if (efx == null)
                {
                    efx = mLvupEffectObj.AddComponent <SceneEfxPool>();
                }
                if (efx != null)
                {
                    CoreEntry.gAudioMgr.PlayUISound(900007, mLvupEffectObj);
                    efx.Init(transform.position, 1.5f);
                }
            }
        }
예제 #4
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);
            }
        }
예제 #5
0
        protected override void CalculateDamage()
        {
            CancelInvoke("CalculateDamage");

            //bool isDamageSuccess = false;

            List <GameObject> targetList = new List <GameObject>();

            LuaTable skillDesc = ConfigManager.Instance.Skill.GetSkillConfig(m_skillBase.m_skillID);


            // 把自己添加进去
            targetList.Insert(0, m_skillBase.m_actor.gameObject);

            //复制目标队列
            List <ActorObj> actors = CoreEntry.gActorMgr.GetAllMonsterActors();

            GameObject[] objList  = new GameObject[actors.Count];
            float[]      fDisList = new float[objList.Length];
            for (int i = 0; i < objList.Length; i++)
            {
                objList[i]  = actors[i].gameObject;
                fDisList[i] = Vector3.Distance(m_skillBase.m_actor.transform.position, objList[i].transform.position);
            }

            // 按距离排序,否则特效的效果会不好
            // 冒泡排序
            for (int i = 1; i < objList.Length; i++)
            {
                for (int j = objList.Length - 1; j >= i; j--)
                {
                    if (fDisList[j] < fDisList[j - 1])
                    {
                        float tmp = fDisList[j - 1];
                        fDisList[j - 1] = fDisList[j];
                        fDisList[j]     = tmp;

                        GameObject tmpObj = objList[j - 1];
                        objList[j - 1] = objList[j];
                        objList[j]     = tmpObj;
                    }
                }
            }

            for (int i = 0; i < objList.Length; i++)
            {
                GameObject obj       = objList[i];
                ActorObj   actorBase = (obj.GetComponent <ActorObj>());

                if (!m_skillBase.m_actor.IsSkillAim((sbyte)m_skillBase.m_skillDesc.Get <int>("faction_limit"), actorBase))
                {
                    continue;
                }

                //按伤害范围算出受伤害对象,具体有没有伤害,还要看对应的属性(免疫等)
                bool isSkillSuccess = m_skillMgr.IsSkillDamageRange(skillDesc.Get <int>("effect_1"), targetList[targetList.Count - 1].transform, // 已最后一个受击者为中立
                                                                    obj.transform, actorBase.GetColliderRadius());
                //伤害对象
                if (isSkillSuccess)
                {
                    targetList.Add(obj);
                }
            }

            //是否持续伤害
            if (m_oneDamageInfo.isRepeatedly && m_repeateKeep > 0)
            {
                Invoke("CalculateDamage", m_oneDamageInfo.damageDiff / m_skillBase.m_speed);
                --m_repeateKeep;
            }

            if (targetList.Count > 1)
            {
                //GameObject obj1 = Instantiate(CoreEntry.gResLoader.LoadResource("Effect/scence/fx_shandianlian")) as GameObject;//CoreEntry.gGameObjPoolMgr.InstantiateEffect("Effect/scence/fx_shandianlian");
                GameObject        obj1     = CoreEntry.gGameObjPoolMgr.InstantiateEffect("Effect/scence/fx_shandianlian");
                EfxLightningChain lighting = obj1.GetComponent <EfxLightningChain>();
                lighting.Init(this, targetList);

                SceneEfxPool efx1 = obj1.GetComponent <SceneEfxPool>();
                if (efx1 == null)
                {
                    efx1 = obj1.AddComponent <SceneEfxPool>();
                }

                efx1.Init(Vector3.zero, 2f);
            }
        }
예제 #6
0
        //private GameObject m_cylinderObj = null;

        public override void OnEnter(ActorObj actorBase)
        {
            m_state = ACTOR_STATE.AS_ENTER;

            m_actor = actorBase;

            string enterAction = m_actor.enterAction;


            ////删除挂点
            //Transform cylinderTransform = this.gameObject.transform.FindChild("Cylinder002");
            //if (cylinderTransform != null)
            //{
            //    m_cylinderObj = cylinderTransform.gameObject;
            //    m_cylinderObj.active = true;
            //}

            float endTime = m_actor.GetActionLength(enterAction);

            //if (endTime > 0.5f)
            //{
            //    endTime = endTime - 0.2f;
            //}


            if (enterAction == "stand")
            {
                endTime = 0.5f;
            }


            if (endTime == 0)
            {
                endTime = 0.5f;
            }


            m_actor.PlayAction(enterAction, false);

            //播放特效
            string enterEfx = "";// m_actor.actorCreatureDisplayDesc.enterEfx;

            if (CoreEntry.IsMobaGamePlay() == false && enterEfx != "")
            {
                if (m_actor.mActorType == ActorType.AT_MONSTER || m_actor.mActorType == ActorType.AT_MECHANICS)
                {
                    enterEfx = "Effect/skill/remain/fx_xiaobingchuxian01";
                }
                if (m_actor.mActorType == ActorType.AT_BOSS)
                {
                    enterEfx = "Effect/skill/remain/fx_bosschuxian";
                }

                if (enterEfx.Length > 0)
                {
                    GameObject efxObj = CoreEntry.gGameObjPoolMgr.InstantiateEffect(enterEfx);
                    //GameObject efxObj = (GameObject)Instantiate(CoreEntry.gResLoader.LoadResource(enterEfx));//CoreEntry.gGameObjPoolMgr.InstantiateEffect(enterEfx);
                    if (efxObj != null)
                    {
                        SceneEfxPool efx = null;
                        if (efxObj)
                        {
                            efx = efxObj.GetComponent <SceneEfxPool>();
                        }
                        if (efx == null)
                        {
                            efx = efxObj.AddComponent <SceneEfxPool>();
                        }
                        efx.Init(m_actor.transform.position, endTime);
                    }
                }
            }



            //无敌状态,受击没反映
            float immuneTime = endTime;

            //if (m_actor.actorCreatureDisplayDesc.enterImmuneKeepTime > 0)
            //{
            //    immuneTime = m_actor.actorCreatureDisplayDesc.enterImmuneKeepTime;
            //}
            m_actor.RecoverHealth(immuneTime);

            //硬直状态,自己不能切换状态
            m_isNonControl = true;

            Invoke("EndEnterState", endTime);

            //去掉碰撞
            m_actor.CancelCollider();
        }