UI Update, volumes
This commit is contained in:
1 parent
e2d0974b3c
commit
0f0c8bab43
100 files changed
+10862
-734
No files matched your search
@@ -1,16 +1,22 @@
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Code.Infrastructure.UI.Panels
|
||||
{
|
||||
public class LogoPanel : UIPanel
|
||||
{
|
||||
{
|
||||
[SerializeField] private Image image;
|
||||
[SerializeField] private Color shownColor;
|
||||
[SerializeField] private Color hiddenColor;
|
||||
public override void Open()
|
||||
{
|
||||
Debug.Log("Logo panel opened");
|
||||
{
|
||||
image.DOColor(shownColor, 1f);
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
image.DOColor(hiddenColor, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ namespace Code.Infrastructure.UI
|
||||
{
|
||||
UniTaskVoid LoadPanel(UIPanelType panelType);
|
||||
void ReleasePanel(UIPanel panel);
|
||||
Canvas Canvas { get; }
|
||||
}
|
||||
|
||||
public class UIFactory : IDisposable, IUIFactory
|
||||
@@ -26,8 +27,11 @@ namespace Code.Infrastructure.UI
|
||||
private AsyncOperationHandle<IList<UIPanelSettingsConfig>> _configsHandle;
|
||||
private AsyncOperationHandle<CanvasSettingsConfig> _canvasSettingsHandle;
|
||||
private CanvasSettingsConfig _canvasConfig;
|
||||
|
||||
private GameObject _canvas;
|
||||
|
||||
public Canvas Canvas { get; private set; }
|
||||
|
||||
public UIFactory(IConfigLocator configLocator, EventBus.EventBus eventBus)
|
||||
{
|
||||
_eventBus = eventBus;
|
||||
@@ -63,6 +67,8 @@ namespace Code.Infrastructure.UI
|
||||
|
||||
_canvas = await Addressables.InstantiateAsync(_canvasConfig.Prefab).ToUniTask();
|
||||
UnityEngine.Object.DontDestroyOnLoad(_canvas);
|
||||
|
||||
Canvas = _canvas.GetComponent<Canvas>();
|
||||
|
||||
_eventBus.RaiseEvent<IUIInitializedHandle>(ui => ui.UIInitialized());
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Code.Infrastructure.UI
|
||||
void ClosePanel(UIPanelType uiPanelType);
|
||||
void TryLoadPanel(UIPanelType uiPanelType);
|
||||
void TryRemovePanel(UIPanelType panelType);
|
||||
void SetCanvasCamera(UnityEngine.Camera camera);
|
||||
}
|
||||
|
||||
public class UIService : IUIPanelLoadedHandle, IUIService
|
||||
@@ -30,15 +31,18 @@ namespace Code.Infrastructure.UI
|
||||
eventBus.Subscribe(this);
|
||||
}
|
||||
|
||||
public void SetCanvasCamera(UnityEngine.Camera camera)
|
||||
{
|
||||
_factory.Canvas.worldCamera = camera;
|
||||
}
|
||||
|
||||
public void OpenPanel(UIPanelType uiPanelType)
|
||||
{
|
||||
_loadedPanels[uiPanelType].gameObject.SetActive(true); // TODO Братуха реально реши надо вкл\выкл или это очередная хренооптимизация
|
||||
_loadedPanels[uiPanelType].Open();
|
||||
_loadedPanels[uiPanelType].Open();
|
||||
}
|
||||
|
||||
public void ClosePanel(UIPanelType uiPanelType)
|
||||
{
|
||||
_loadedPanels[uiPanelType].gameObject.SetActive(false);
|
||||
{
|
||||
_loadedPanels[uiPanelType].Close();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user