AxibugEmuOnline/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/XMBOptionBgChanger.cs

32 lines
799 B
C#
Raw Normal View History

2024-12-11 21:21:27 +08:00
using AxibugEmuOnline.Client.ClientCore;
using Coffee.UIExtensions;
using UnityEngine;
namespace AxibugEmuOnline.Client
{
public class XMBOptionBgChanger : MonoBehaviour
{
public UIGradient gradient;
private void OnEnable()
{
App.settings.BgColor.OnColorChanged += BgColor_OnColorChanged;
var color = App.settings.BgColor.CurrentColor;
gradient.color1 = color.color1;
gradient.color2 = color.color2;
}
private void OnDisable()
{
App.settings.BgColor.OnColorChanged -= BgColor_OnColorChanged;
}
private void BgColor_OnColorChanged(XMBColor color)
{
gradient.color1 = color.color1;
gradient.color2 = color.color2;
}
}
}