Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     // We need the movement set up first before reading in inputs and moving the cursor.
     if (movement != null)
     {
         inputMove.ReadInput();
         movement.Move(inputMove.HorizontalInput, inputMove.VerticalInput);
     }
 }
Beispiel #2
0
    public void Update()
    {
        _moveInput.ReadInput();
        _moveInput.Tick(_transform, _sensivity);

        _transform.position = new Vector3(
            Mathf.Clamp(_transform.position.x, ParallaxCamera.ParallaxBoundary.xMin + _playerBoundaryOffset, ParallaxCamera.ParallaxBoundary.xMax - _playerBoundaryOffset),
            Mathf.Clamp(_transform.position.y, ParallaxCamera.ParallaxBoundary.yMin + _playerBoundaryOffset, ParallaxCamera.ParallaxBoundary.yMax - _playerBoundaryOffset),
            _transform.position.z);

        ParallaxCamera.CameraTransform.position = ParallaxCamera.CameraTransform.position.With(x: _transform.position.x * ParallaxCamera.TranslationCoefficient);
    }