UnityBiz/Assets/scripts/GUI/GameplayUI/MouseSensitivityController.cs
2024-08-08 20:54:26 +02:00

26 lines
671 B
C#

using UnityEngine;
using UnityEngine.UI;
public class MouseSensitivityController : MonoBehaviour
{
public Slider sensitivitySlider;
private float mouseSensitivity = 1f;
void Start()
{ sensitivitySlider.value = mouseSensitivity;
sensitivitySlider.onValueChanged.AddListener(OnSensitivityChanged);
}
void Update()
{
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity;
float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity;
}
public void OnSensitivityChanged(float value)
{
mouseSensitivity = value;
Debug.Log("Czu³oœæ myszy zmieniona na: " + mouseSensitivity);
}
}