26 lines
671 B
C#
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<7A>o<EFBFBD><6F> myszy zmieniona na: " + mouseSensitivity);
|
|||
|
}
|
|||
|
}
|