Beispiel #1
0
        public override void OnDeath(int actionID)
        {
            if (IsGolem)
            {
                if (golem != null)
                {
                    golem.Dying();
                }
                if (golemFx != null)
                {
                    golemFx.Dying();
                }
            }
            else
            {
                base.OnDeath(actionID);
            }
            try
            {
                if (sfxHandler)
                {
                    sfxHandler.RemoveAllFX();
                    if (m_monsterData != null && m_monsterData.dieFx != null)
                    {
                        foreach (var item in m_monsterData.dieFx)
                        {
                            sfxHandler.HandleFx(item);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
            if (motor)
            {
                motor.gravity = 0;
            }
            if (Actor)
            {
                var cc = Actor.GetComponent <Collider>() as CharacterController;
                if (cc)
                {
                    cc.radius = 0;
                }
            }
            #region Shader

            if (m_monsterData != null && ShaderData.dataMap.ContainsKey(m_monsterData.shader) &&
                GameObject && GameObject.GetComponentsInChildren <SkinnedMeshRenderer>(true) != null)
            {
                fadeTimer = TimerHeap.AddTimer((uint)(m_monsterData.deadTime - 500), 0, () =>
                {
                    MogoFXManager.Instance.AlphaFadeOut(GameObject, 0.3f);
                });
            }

            #endregion
        }
Beispiel #2
0
    public virtual void OnDeath(int skillID)
    {
        if (golemAni != null)
        {
            golemAni.Dying();
        }

        if (golemFx != null)
        {
            golemFx.Dying();
        }

        containers.Remove(transform);
        containerRange.Remove(transform);
    }
Beispiel #3
0
        override public void OnDeath(int actionID)
        {
            if (IsGolem)
            {
                golem.Dying();
                if (golemFx != null)
                {
                    golemFx.Dying();
                }

                EventDispatcher.TriggerEvent <uint>(Events.FrameWorkEvent.AOIDelEvtity, ID);
            }
            else
            {
                //if (currentMotionState == MotionState.HIT)
                //{//受击状态不做死亡表现,受击完再表现
                //    return;
                //}

                MogoFXManager.Instance.RemoveEnemyInScreen(ID);

                BillboardLogicManager.Instance.RemoveBillboard(ID);
                StopMove();

                if (motor)
                {
                    motor.CancleLookAtTarget();
                    motor.gravity = 0;
                }

                battleManger.OnDead(actionID);
                try
                {
                    if (sfxHandler)
                    {
                        sfxHandler.RemoveAllFX();
                        if (m_monsterData != null && m_monsterData.dieFx != null)
                        {
                            foreach (var item in m_monsterData.dieFx)
                            {
                                sfxHandler.HandleFx(item);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    LoggerHelper.Except(ex);
                }
                if (motor)
                {
                    motor.gravity = 0;
                }
                if (Actor)
                {
                    var cc = Actor.collider as CharacterController;
                    if (cc)
                    {
                        cc.radius = 0;
                    }
                }

                #region Shader

                if (m_monsterData != null && GameObject)
                {
                    if (ShaderData.dataMap.ContainsKey(m_monsterData.shader) &&
                        GameObject.GetComponentsInChildren <SkinnedMeshRenderer>(true) != null)
                    {
                        fadeTimer = TimerHeap.AddTimer((uint)(m_monsterData.deadTime - beginFadeOutTimeForward) > 0 ? (uint)(m_monsterData.deadTime - beginFadeOutTimeForward) : 0, 0, () =>
                        {
                            MogoFXManager.Instance.AlphaFadeOut(GameObject, fadeOutTime);
                        });
                    }
                }

                #endregion

                TimerHeap.AddTimer <EntityParent>((uint)m_monsterData.deadTime, 0, (e_) =>
                {
                    EventDispatcher.TriggerEvent <uint>(Events.FrameWorkEvent.AOIDelEvtity, ID);
                }, this);
            }
        }