UI upd
This commit is contained in:
1 parent
0f0c8bab43
commit
b7527d8d68
40 files changed
+2636
-795
No files matched your search
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d6b79a067be4ebc97601337f35b808a
|
||||
timeCreated: 1769346033
|
||||
@@ -0,0 +1,17 @@
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Code.Debug
|
||||
{
|
||||
public class SceneChooser : MonoBehaviour
|
||||
{
|
||||
[Inject] private SceneLoader _sceneLoader;
|
||||
|
||||
public void ChooseScene(int id)
|
||||
{
|
||||
_sceneLoader.LoadSceneAsync((SceneId)id, LoadSceneMode.Single).Forget();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72527bc5589647428bb4575953d13a90
|
||||
timeCreated: 1769346042
|
||||
@@ -1,4 +1,5 @@
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.UI;
|
||||
using Reflex.Attributes;
|
||||
|
||||
namespace Code.Infrastructure.App
|
||||
@@ -14,6 +15,7 @@ namespace Code.Infrastructure.App
|
||||
{
|
||||
[Inject] public SceneLoader.SceneLoader SceneLoader { get; set; }
|
||||
[Inject] public CameraStateMachine Camera { get; set; }
|
||||
[Inject] public IUIService UIService { get; set; }
|
||||
}
|
||||
|
||||
[Generators.StateMachine(typeof(AppStateMachineContext),typeof(AppStates))]
|
||||
|
||||
@@ -116,8 +116,7 @@ namespace Code.Infrastructure.App
|
||||
_ui2CamLoading.DoProgress();
|
||||
_initialLoading.DoProgress();
|
||||
|
||||
_thatRightContainer.Resolve<IUIService>().TryLoadPanel(UIPanelType.Logo);
|
||||
_thatRightContainer.Resolve<IUIService>().TryLoadPanel(UIPanelType.Loading);
|
||||
_thatRightContainer.Resolve<IUIService>().TryLoadPanel(UIPanelType.Logo);
|
||||
}
|
||||
|
||||
public void UILoaded(UIPanelType uiPanelType)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Code.Infrastructure.UI;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
@@ -9,7 +10,7 @@ namespace Code.Infrastructure.App.States
|
||||
{
|
||||
[State(typeof(AppStates),typeof(AppStateMachineContext))]
|
||||
[StateRaisingEvent]
|
||||
public partial class BootstrapState : IOnGameplaySceneLoadedHandler
|
||||
public partial class BootstrapState : IOnGameplaySceneLoadedHandler, IUIPanelLoaded
|
||||
{
|
||||
private EventBus.EventBus _eventBus;
|
||||
public BootstrapState(AppStateMachineContext context, EventBus.EventBus eventBus) : base(context,eventBus)
|
||||
@@ -21,11 +22,14 @@ namespace Code.Infrastructure.App.States
|
||||
protected override void OnEnterState()
|
||||
{
|
||||
_eventBus.Subscribe(this);
|
||||
Context.SceneLoader.LoadSceneAsync(SceneId.Gameplay, LoadSceneMode.Single).Forget();
|
||||
|
||||
Context.UIService.TryLoadPanel(UIPanelType.DebugSceneChooser);
|
||||
// Context.SceneLoader.LoadSceneAsync(SceneId.Gameplay, LoadSceneMode.Single).Forget();
|
||||
}
|
||||
|
||||
protected override void OnExitState()
|
||||
{
|
||||
Context.UIService.TryRemovePanel(UIPanelType.DebugSceneChooser);
|
||||
_eventBus.Unsubscribe(this);
|
||||
}
|
||||
|
||||
@@ -33,5 +37,12 @@ namespace Code.Infrastructure.App.States
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void UILoaded(UIPanelType uiPanelType)
|
||||
{
|
||||
if (uiPanelType != UIPanelType.DebugSceneChooser) return;
|
||||
|
||||
Context.UIService.OpenPanel(uiPanelType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 117e5c36ac3f47b2bff18075759dd50e
|
||||
timeCreated: 1769344255
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public class AudioFactory
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc45c23918ed446681564b467668304b
|
||||
timeCreated: 1769344269
|
||||
@@ -60,7 +60,7 @@ namespace Code.Infrastructure.EventBus
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
UnityEngine.Debug.LogError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Code.Infrastructure.SceneLoader
|
||||
public enum SceneId
|
||||
{
|
||||
MainMenu,
|
||||
Gameplay
|
||||
Gameplay,
|
||||
SoundTest
|
||||
}
|
||||
}
|
||||
@@ -38,10 +38,16 @@ namespace Code.Infrastructure.SceneLoader
|
||||
public async UniTaskVoid LoadSceneAsync(SceneId id, LoadSceneMode loadMode)
|
||||
{
|
||||
await Addressables.LoadSceneAsync(_sceneInfos[id].SceneAsset, loadMode);
|
||||
|
||||
|
||||
_scenesActions[id]();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async UniTaskVoid UnloadSceneAsync(SceneId id)
|
||||
{
|
||||
// TODO НЕВОЗМОЖНО ВЫГРУЗИТЬ БЛЯДСКИЕ СЦЕНЫ
|
||||
// await Addressables.UnloadSceneAsync(_sceneInfos[])
|
||||
}
|
||||
|
||||
private AsyncOperationHandle<IList<SceneInfoConfig>> _configHandle;
|
||||
|
||||
private async UniTaskVoid LoadConfigs(string configReferences)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace Code.Infrastructure.UI.Panels
|
||||
{
|
||||
public class DamnEmptyPanel : UIPanel
|
||||
{
|
||||
public override void Open()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce4e618236c441ca857ad458fa13e09d
|
||||
timeCreated: 1769347387
|
||||
@@ -1,12 +1,13 @@
|
||||
using System.ComponentModel;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Code.Infrastructure.UI
|
||||
{
|
||||
public abstract class UIPanel : MonoBehaviour
|
||||
{
|
||||
[field: Category("UIPanel")] public bool InjectMeSenpai { get; protected set; }
|
||||
|
||||
[SerializeField] protected bool injectMeSenpai;
|
||||
public bool InjectMeSenpai => injectMeSenpai;
|
||||
public abstract void Open();
|
||||
public abstract void Close();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Code.Infrastructure.UI
|
||||
{
|
||||
Logo,
|
||||
Loading,
|
||||
DebugSceneChooser,
|
||||
DebugMenu
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user