diff --git a/Assets/GadGame/Scenes/Scene 5.unity b/Assets/GadGame/Scenes/Scene 5.unity index 8dd892a..3430bda 100644 --- a/Assets/GadGame/Scenes/Scene 5.unity +++ b/Assets/GadGame/Scenes/Scene 5.unity @@ -1246,7 +1246,6 @@ MonoBehaviour: GameTime: 60 _basket: {fileID: 1254852291} _lerp: 10 - _speed: 10 _spawnTime: 0.5 _bombChange: 0.2 _spawnArea: @@ -1255,7 +1254,7 @@ MonoBehaviour: y: 7 width: 4.5 height: 1 - _gravityScaleRange: {x: 0.1, y: 0.5} + _gravityScaleRange: {x: 0.05, y: 0.2} _canvas: {fileID: 1939570966} _time: {fileID: 1230716510} _score: {fileID: 1901652404} diff --git a/Assets/GadGame/Scripts/MiniGame/MiniGameController.cs b/Assets/GadGame/Scripts/MiniGame/MiniGameController.cs index fc3afc7..15a6858 100644 --- a/Assets/GadGame/Scripts/MiniGame/MiniGameController.cs +++ b/Assets/GadGame/Scripts/MiniGame/MiniGameController.cs @@ -73,10 +73,12 @@ namespace GadGame.MiniGame { //640x480; var inputData = DataReceiver.Instance.DataReceived.PosPoint; - var inputNormalize = new Vector2(inputData.x / 230, inputData.y / 480); - var input = new Vector2(); - input.x = Mathf.Lerp(0, _canvas.pixelRect.width, inputNormalize.x); - input.y = -Mathf.Lerp(0, _canvas.pixelRect.height, inputNormalize.y); + var inputNormalize = new Vector2((inputData.x - 213.33f)/ 213.33f, inputData.y / 480); + var input = new Vector2 + { + x = Mathf.Lerp(0, _canvas.pixelRect.width, inputNormalize.x), + y = -Mathf.Lerp(0, _canvas.pixelRect.height, inputNormalize.y) + }; if (input != Vector2.zero) { var mousePos = input; @@ -85,7 +87,9 @@ namespace GadGame.MiniGame pos.x *= -1; pos.y = currentPosition.y; pos.z = 0; - _basket.position = Vector3.Lerp(currentPosition, pos, _lerp * Time.deltaTime); + currentPosition= Vector3.Lerp(currentPosition, pos, _lerp * Time.deltaTime); + currentPosition.x = Mathf.Clamp(currentPosition.x, -2.25f, 2.25f); + _basket.position = currentPosition; } }