UnityBiz/Assets/scripts/GUI/GameplayUI/MouseSensitivityController.cs

26 lines
671 B
C#
Raw Normal View History

2024-08-08 18:54:26 +00:00
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<7A>o<EFBFBD><6F> myszy zmieniona na: " + mouseSensitivity);
}
}