36 lines
651 B
C#
36 lines
651 B
C#
using UnityEngine;
|
|
|
|
[ExecuteInEditMode]
|
|
public class BarOptionsGUIMulti : MonoBehaviour
|
|
{
|
|
public Rect position = new Rect(10f, 100f, 200f, 100f);
|
|
|
|
public GameObject[] energyBars;
|
|
|
|
public GUISkin skin;
|
|
|
|
public float valueF = 0.25f;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
}
|
|
|
|
private void OnGUI()
|
|
{
|
|
GUILayout.BeginArea(position);
|
|
GUILayout.Label("Change Value:");
|
|
valueF = GUILayout.HorizontalSlider(valueF, 0f, 1f);
|
|
GUILayout.EndArea();
|
|
GameObject[] array = energyBars;
|
|
foreach (GameObject gameObject in array)
|
|
{
|
|
EnergyBar component = gameObject.GetComponent<EnergyBar>();
|
|
component.ValueF = valueF;
|
|
}
|
|
}
|
|
}
|