Files
beyond/Assets/ThirdParty/Invector-3rdPersonController/Basic Locomotion/Scripts/Generic/vSetRandomFloat.cs
2024-11-20 15:21:28 +01:00

26 lines
678 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Invector
{
public class vSetRandomFloat : 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);
}
}
}