12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- using SRF;
- using SRF.UI;
- using UnityEngine;
- namespace SRDebugger.UI.Other
- {
- [RequireComponent(typeof(StyleComponent))]
- public class DebugPanelBackgroundBehaviour : SRMonoBehaviour
- {
- private void Awake()
- {
- this._styleComponent = base.GetComponent<StyleComponent>();
- this._defaultKey = this._styleComponent.StyleKey;
- this.Update();
- }
- private void Update()
- {
- if (!this._isTransparent && Settings.Instance.EnableBackgroundTransparency)
- {
- this._styleComponent.StyleKey = this.TransparentStyleKey;
- this._isTransparent = true;
- }
- else if (this._isTransparent && !Settings.Instance.EnableBackgroundTransparency)
- {
- this._styleComponent.StyleKey = this._defaultKey;
- this._isTransparent = false;
- }
- }
- private string _defaultKey;
- private bool _isTransparent;
- private StyleComponent _styleComponent;
- public string TransparentStyleKey = string.Empty;
- }
- }
|