public override void Active()
    {
        base.Active();
        if (null == hero.BodyGo)
        {
            return;
        }
        KSkillDisplay skillDisplay = KConfigFileManager.GetInstance().GetSkillDisplay(hero.property.lastHitSkillId, hero.property.tabID);
        Vector3       forward      = hero.Position - attacker.Position;

        forward.Normalize();
        hero.transform.position = hero.transform.position + (Vector3.up * 0.2f);
        if (!Bind())
        {
            ActionMonsterDie action = new ActionMonsterDie(hero);
            action.attacker    = attacker;
            action.IsPushStack = false;
            hero.DispatchEvent(ControllerCommand.SetActiveAction, action);
            hero.transform.position = hero.transform.position - (Vector3.up * 0.2f);
            return;
        }

        hero.BodyGo.animation.Stop();
        float _f = 10f;

        _rootRB.velocity        = forward * skillDisplay.PhysicsVelocity * Random.Range(0.8f, 1.2f);
        _rootRB.velocity       += Vector3.up * skillDisplay.PhysicsVelocityUp * Random.Range(0.8f, 1.2f);
        _rootRB.angularVelocity = new Vector3(0, Random.Range(30f, 60f), 0);
    }
Beispiel #2
0
        public void ToDead(SceneEntity killer)
        {
            if (null != killer)
            {
                KingSoftCommonFunction.LootAt(Owner.gameObject, killer.gameObject);
            }
            Owner.property.fightHp = 0;

            if (Owner.HeroType == KHeroObjectType.hotMonster)
            {
                if (null != killer && killer.property.isMainHero)
                {
                    HitPanelView.GetInstance().hit();
                }
                KSkillDisplay skillDisplay = KConfigFileManager.GetInstance().GetSkillDisplay(Owner.property.lastHitSkillId, Owner.property.tabID);
                if (Owner.property.lastAttackEvent == (byte)KAttackEvent.aeCrit || skillDisplay.DeadType == KSkillDisplay.DEAD_TYPE.BOMB)
                {
                    ActionBomb action = new ActionBomb(Owner);
                    action.IsPushStack = false;
                    Owner.DispatchEvent(ControllerCommand.SetActiveAction, action);
                }
                else if (skillDisplay.DeadType == KSkillDisplay.DEAD_TYPE.PHYSICS)
                {
                    ActionPlysiceDie action = new ActionPlysiceDie(Owner);
                    action.attacker    = killer;
                    action.IsPushStack = false;
                    Owner.DispatchEvent(ControllerCommand.SetActiveAction, action);
                }
                else
                {
                    ActionMonsterDie action = new ActionMonsterDie(Owner);
                    action.attacker    = killer;
                    action.IsPushStack = false;
                    Owner.DispatchEvent(ControllerCommand.SetActiveAction, action);
                }
                //ActionBomb
            }
            else
            {
                ActionDie action = new ActionDie(Owner);
                action.IsPushStack = false;
                Owner.DispatchEvent(ControllerCommand.SetActiveAction, action);
            }
        }