32 lines
590 B
C#
32 lines
590 B
C#
using UnityEngine;
|
|
|
|
public class CanvasGroupUtils : MonoBehaviour
|
|
{
|
|
public UnityEngine.UI.Graphic[] graphics;
|
|
public bool useOverrideColor = false;
|
|
public Color overrideColor = Color.white;
|
|
|
|
|
|
void OnValidate()
|
|
{
|
|
RefreshColor();
|
|
}
|
|
|
|
|
|
void Update()
|
|
{
|
|
RefreshColor();
|
|
}
|
|
|
|
|
|
void RefreshColor(){
|
|
if(useOverrideColor)
|
|
{
|
|
foreach(var graphic in graphics)
|
|
{
|
|
graphic.color = new Color(overrideColor.r, overrideColor.g, overrideColor.b, overrideColor.a);
|
|
}
|
|
}
|
|
}
|
|
}
|