Exemplo n.º 1
0
    /// <summary>
    /// 激活行为.
    /// </summary>
    public override void Active()
    {
        base.Active();
        AssetInfo infor = AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_guaiwusiwang2"));

        if (infor.isDone() && null != infor.bundle)
        {
            GameObject fx = GameObject.Instantiate(infor.bundle.mainAsset) as GameObject;
            fx.transform.position = hero.transform.position;
            fx.transform.rotation = hero.transform.rotation;

            float _scale = hero.heroSetting.Scale;
            /*float _scale = hero.property.characterController.radius * hero.transform.localScale.y/ 0.6f;*/
            fx.transform.localScale = new Vector3(_scale, _scale, _scale);
            ParticleSystemScaleManager.instance.Scale(_scale, fx);
            if (null != hero.BodyGo)
            {
                hero.BodyGo.SetActive(false);
            }
        }
        else
        {
            ActionDie die = new ActionDie(hero);
            hero.ActiveAction = die;
            return;
        }
        hero.DispatchEvent(ControllerCommand.CLEAR_BUFF);
    }
Exemplo n.º 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);
            }
        }
Exemplo n.º 3
0
        public FighterStateMachine(
            Fighter fighter,
            float runSpeed
            ) : base()
        {
            Character.Anim.FighterAnimation  fighterAnimation  = fighter.GetComponent <Character.Anim.FighterAnimation> ();
            Character.Anim.MoveableAnimation moveableAnimation = fighter.GetComponent <Character.Anim.MoveableAnimation> ();
            CharacterController characterController            = fighter.GetComponent <CharacterController> ();

            mActionIdle   = new ActionIdle((int)eCharacterState.idle, moveableAnimation);
            mActionAttack = new ActionAttack((int)eCharacterState.attack, fighter);
            mActionRun    = new ActionRun((int)eCharacterState.run, moveableAnimation, fighter.transform, characterController, runSpeed);
            mActionDie    = new ActionDie((int)eCharacterState.die, fighterAnimation);

            addAction(mActionIdle);
            addAction(mActionAttack);
            addAction(mActionRun);
            addAction(mActionDie);

            startNewAction((int)eCharacterState.idle, false);
        }