예제 #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);
     }
 }
예제 #2
0
    protected void ActiveLogic(RangerAgent.FirePort rfp)
    {
        if (GameManager.Instance.IsPVPMode)
        {
            _canHitAll = true;
        }

        _curBombPosition = BOMB_POSITION.AT_DEAD;
        if (_moveAgent != null)
        {
            _moveAgent.enabled = true;
        }
        if (_bulletDisplayers != null)
        {
            if (_bulletDisplayers.Length == 1)
            {
                _currentEffectIndex = 0;
            }
            else if (_bulletDisplayers.Length > 1)
            {
                _currentEffectIndex = Random.Range(0, _bulletDisplayers.Length - 1);
            }
            if (_currentEffectIndex >= 0)
            {
                _bulletDisplayers[_currentEffectIndex].StartEffect();
            }
        }
        if (_sfxFireName != "")
        {
            Debug.Log("bullet +" + _sfxFireName);
            SoundManager.Instance.PlaySoundEffect(_sfxFireName);
        }
        ActiceLogicSelf(rfp);
        if (_firePortLifeInIdx > -1)
        {
            FireByPort(_firePortLifeInIdx);
        }
        if (_hasGEffect)
        {
            EffectByGravity(_gSpeed, null, _gDirection, 999, false, false);
        }
        if (_damageReceiver != null && !_needNotHitID)
        {
            _damageReceiver._hitID = GameManager.GainHitID();
        }
        if (_shakePos == SHAKE_POS.AT_BEGIN)
        {
            CameraController.Instance.StartCameraEffect(EnumCameraEffect.none, _shakeLevel, false);
        }
        StartCoroutine(STATE());
    }
예제 #3
0
    public override bool HandleCommand(ref FCCommand ewd)
    {
        switch (ewd._cmd)
        {
        case FCCommand.CMD.ATTACK_HIT_WALL:
            if (!_deadByLifeOver)
            {
                _curBombPosition = BOMB_POSITION.AT_HIT_WALL;
                Dead();
            }

            break;

        case FCCommand.CMD.ATTACK_HIT_GROUND:
            if (_shakePos == SHAKE_POS.AT_HIT_GROUND)
            {
                CameraController.Instance.StartCameraEffect(EnumCameraEffect.none, _shakeLevel, false);
            }
            if (_moveAgent != null)
            {
                _moveAgent.IsOnGround = true;
            }
            if (!_deadByLifeOver && _moveAgent.IsOnGround)
            {
                _curBombPosition = BOMB_POSITION.AT_HIT_GROUND;

                Dead();
            }

            break;

        case FCCommand.CMD.ATTACK_HIT_TARGET:
        {
            ActionController target = ewd._param1 as ActionController;
            IsHitSomeone(_owner, this, _damageType, target);
        }
        break;
        }
        return(true);
    }