示例#1
0
    private void ResetCar()
    {
        var resetPosition =
            MagicSingleton.GetStartPosition();

        _observedData.SetVelocity(0);
        _observedData.SetRotationVelocity(0);
        _observedData.SetAcceleration(0);
        _observedData.SetPosition(resetPosition);
        gameObject.transform.position = resetPosition;
    }
示例#2
0
    public PlayerConfiguration Configure()
    {
        _data.CarData = DefaultCarData();
        _carModel     = new CarModel(_data.CarData);
        var carInstance  = _assetService.GetAssetInstance(AssetCatalogue.Car01);
        var carPresenter = carInstance.GetComponent <CarPresenter>();

        carPresenter.Init(_data.CarData);

        var weaponPresenter = carInstance.GetComponent <WeaponPresenter>();

        weaponPresenter.Init(_data.CarData.WeaponData);
        var pos     = carPresenter.transform.position;
        var carView = carPresenter.gameObject.GetComponent <CarView>();

        carView.MainColor = _colors.Dequeue();

        carPresenter.transform.position = MagicSingleton.GetStartPosition();
        _carModel.UpdatePosition(_data.CarData.Position);
        return(this);
    }