Files
BABA_YAGA/Assets/Invector-3rdPersonController/Basic Locomotion/Scripts/Generic/Utils/vRandomFloat.cs
2026-05-30 09:16:35 +07:00

24 lines
621 B
C#

using UnityEngine;
namespace Invector.Utils
{
public class vRandomFloat : MonoBehaviour
{
public bool randomValue = true;
[vHideInInspector("randomValue")]
public float min;
public float max;
public bool setOnStart;
public UnityEngine.UI.Slider.SliderEvent onSet;
private void Start()
{
if (setOnStart) Set();
}
// Start is called before the first frame update
public void Set()
{
if (randomValue) onSet.Invoke(Random.Range(min, max));
else onSet.Invoke(max);
}
}
}