예제 #1
0
        private void ChangeCameraPosition(float xOffset, float yOffset)
        {
            if (xOffset != 0)
            {
                if (yOffset != 0)
                {
                    XYCameraPosition cameraPosition = _gameValueService.GetXYCameraPosition();

                    float newXPosition = cameraPosition.XPosition + xOffset;
                    float newYPosition = cameraPosition.YPosition + yOffset;

                    _gameValueService.SetCameraPosition(newXPosition, newYPosition);
                }
                else
                {
                    float xCameraPosition = _gameValueService.GetXCameraPosition();
                    _gameValueService.SetXCameraPosition(xCameraPosition + xOffset);
                }
            }
            else if (yOffset != 0)
            {
                float yCameraPosition = _gameValueService.GetYCameraPosition();
                _gameValueService.SetYCameraPosition(yCameraPosition + yOffset);
            }
        }