Пример #1
0
    protected override void UseAction(Action _action, float _time)
    {
        switch (_action.Type)
        {
        case ActionType.BSeekAndShoot:
            _currentBehavior = _action.Behavior;
            break;

        case ActionType.BSeekAndShootUnset:
            _currentBehavior = null;
            break;

        case ActionType.SawPlayer:
            SawPlayer(_action.Combat);
            break;

        case ActionType.Alert:
            Alert(_action);
            break;

        case ActionType.UnAlert:
            UnAlert(_action);
            break;

        case ActionType.Die:
            UnloadAll();
            _isDead = true;
            break;

        case ActionType.Activate:
            Activate(_action);
            break;

        case ActionType.Deactivate:
            Deactivate(_action);
            break;
        }
        if (_currentBehavior != null)
        {
            SetAction(_currentBehavior.UseAction(_action));
        }
        base.UseAction(_action, _time);
    }