Reorganize scripts into subfolders by responsibility
Move scripts under Assets/Scripts/ into Components, GameMode, Helper, Network, Enum, Struct and ScriptableObject folders. Pure file moves (plus folder .meta files); no code changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
382bfb36df
commit
e23fae0c50
126 files changed
+112
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// Binds a UI Slider (and optional value label) to the global MouseSensitivity
|
||||
/// multiplier. The slider's range is authored in the inspector (0.1 - 4.0);
|
||||
/// this only reads/writes the value so scene-side range edits are respected.
|
||||
public class MouseSensitivitySlider : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Slider slider;
|
||||
[Tooltip("Optional TMP label showing the current multiplier (e.g. \"1,00\").")]
|
||||
[SerializeField] private TMP_Text valueLabel;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (!slider) return;
|
||||
slider.SetValueWithoutNotify(MouseSensitivity.Multiplier);
|
||||
UpdateLabel(MouseSensitivity.Multiplier);
|
||||
slider.onValueChanged.AddListener(OnSliderChanged);
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
if (slider) slider.onValueChanged.RemoveListener(OnSliderChanged);
|
||||
}
|
||||
|
||||
void OnSliderChanged(float value)
|
||||
{
|
||||
MouseSensitivity.Multiplier = value;
|
||||
UpdateLabel(value);
|
||||
}
|
||||
|
||||
void UpdateLabel(float value)
|
||||
{
|
||||
if (valueLabel) valueLabel.text = value.ToString("0.00");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user