Exemple #1
0
 public void IsHitSomeone(ActionController owner, AttackUnit attackUnit, FC_DAMAGE_TYPE damageType, ActionController target)
 {
     HandleHitTarget.HandleHit(owner, attackUnit, damageType, target);
     _curBombPosition = BOMB_POSITION.AT_HIT_TARGET;
     if (_shakePos == SHAKE_POS.AT_HIT_TARGET)
     {
         CameraController.Instance.StartCameraEffect(EnumCameraEffect.none, _shakeLevel, false);
     }
 }
Exemple #2
0
    public override bool HandleCommand(ref FCCommand ewd)
    {
        switch (ewd._cmd)
        {
        case FCCommand.CMD.ATTACK_HIT_TARGET:
        {
            ActionController target = ewd._param1 as ActionController;
            HandleHitTarget.HandleHit(_owner, this, _damageType, target);

            if (GetAttackInfo()._hitType == AttackHitType.ForceBack)
            {
                AIAgent aiAgent = _owner.gameObject.GetComponentInChildren <AIAgent>();
                if (aiAgent != null)
                {
                    aiAgent.AddHitBackList(target);
                }
            }
            if (_hitSound != "")
            {
                SoundManager.Instance.PlaySoundEffect(_hitSound);
            }
        }
        break;

        case FCCommand.CMD.ATTACK_OUT_OF_RANGE:
        {
            ActionController target = ewd._param1 as ActionController;

            if (GetAttackInfo()._hitType == AttackHitType.ForceBack)
            {
                AIAgent aiAgent = _owner.gameObject.GetComponentInChildren <AIAgent>();
                if (aiAgent != null)
                {
                    if (!GameManager.Instance.IsPVPMode)
                    {
                        aiAgent.RemoveHitBackList(target);
                    }
                }
            }
        }
        break;
        }
        return(true);
    }