Exemplo n.º 1
0
    //public CarState NetWork()
    //{
    //    if(_network == null)
    //    {
    //        return _state;
    //    }
    //    return _state;
    //}

    // 加速処理
    private void Accelerator()
    {
        if (_controlle.AccelerateObject())
        {
            _nowVelocity += _speed;
            SetVelocity();
        }
        else
        {
            if (_nowVelocity > 0)
            {
                _nowVelocity -= _speed;
                if (_nowVelocity < 0)
                {
                    _nowVelocity = 0;
                }
            }
        }
    }