Passion & UI

This commit is contained in:
SoulliesOfficial
2026-06-12 17:11:39 -04:00
parent 7bc1e1722c
commit 6d7ebc5825
3444 changed files with 865284 additions and 463132 deletions

View File

@@ -0,0 +1,34 @@
using UnityEngine;
using UnityEngine.UI;
namespace Michsky.UI.Shift
{
public class SliderGamepadManager : MonoBehaviour
{
[Header("Slider")]
public float changeValue = 0.5f;
Slider sliderObject;
[Header("Input")]
public string horizontalAxis = "Xbox Right Stick Horizontal";
void Start()
{
try { sliderObject = gameObject.GetComponent<Slider>(); }
catch { Debug.LogWarning("Slider is missing. Sliding via gamepad won't work."); }
}
void Update()
{
if (sliderObject != null)
{
float h = Input.GetAxis(horizontalAxis);
if (h == 1)
sliderObject.value += changeValue;
else if (h == -1)
sliderObject.value -= changeValue;
}
}
}
}