This commit is contained in:
Hubert Mattusch 2023-11-20 12:29:56 +01:00
parent 7131c14d99
commit 858bfaa0ae
3 changed files with 4 additions and 5 deletions

View File

@ -36,7 +36,7 @@ namespace NEG.UI.Area
public void OpenWindow(IWindow window, object data = null) => DefaultWindowSlot.AttachWindow(window, data);
private void Awake()
protected virtual void Awake()
{
if (setAsDefaultArea)
UiManager.Instance.CurrentArea = this;
@ -50,10 +50,8 @@ namespace NEG.UI.Area
private void OnDestroy()
{
#if !SERVER
if (ReferenceEquals(UiManager.Instance.CurrentArea, this))
UiManager.Instance.CurrentArea = null;
#endif
}
public void TryUseBack(ref IControllable.BackUsed backUsed) => OnBackUsed?.Invoke(backUsed);

View File

@ -77,13 +77,11 @@ namespace NEG.UI.UnityUi.Buttons
protected virtual void Awake()
{
#if !SERVER
button.onClick.AddListener(OnClicked);
if (groupButtonSettings == null)
MonoUiManager.Instance.DefaultUiSettings.Apply(this);
else
groupButtonSettings.Apply(this);
#endif
}
private void Start() => OnDeselect(null);

View File

@ -1,4 +1,5 @@
using KBCore.Refs;
using NEG.UI.UnityUi.Window;
using NegUtils.NEG.UI;
using System;
using UnityEngine;
@ -10,6 +11,8 @@ namespace NEG.UI.UnityUi
public IControllable Controllable => controllable.Value;
[SerializeField, Self] protected InterfaceRef<IControllable> controllable;
protected MonoWindow ControllableAsWindow => (MonoWindow)controllable.Value;
protected virtual void Awake()
{