Развитие системы растений
This commit is contained in:
1 parent
1b578067f3
commit
ba49ef5015
218 files changed
+70415
-1519
No files matched your search
@@ -7,10 +7,7 @@ namespace Code.Infrastructure.App
|
||||
{
|
||||
public enum AppStates
|
||||
{
|
||||
Bootstrap,
|
||||
Gameplay,
|
||||
MainMenu,
|
||||
Platformer
|
||||
Bootstrap
|
||||
}
|
||||
|
||||
public class AppStateMachineContext
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Code.Calendar.Constants;
|
||||
using Code.Calendar.DataStructures;
|
||||
using Code.Infrastructure.Audio;
|
||||
using Code.Infrastructure.Configs;
|
||||
using Code.Infrastructure.Input;
|
||||
@@ -8,7 +10,6 @@ using Reflex.Core;
|
||||
using Reflex.Enums;
|
||||
using Reflex.Injectors;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using Resolution = Reflex.Enums.Resolution;
|
||||
|
||||
namespace Code.Infrastructure.App
|
||||
@@ -20,7 +21,10 @@ namespace Code.Infrastructure.App
|
||||
IUIPanelLoaded,
|
||||
IAudioSourcePoolInitializedHandle,
|
||||
IAudioConfigsLoadedHandle,
|
||||
ILayerMasksInitializedHandle
|
||||
ILayerMasksInitializedHandle,
|
||||
ITaskServiceHandle,
|
||||
IPlantsServiceInitHandle,
|
||||
IConstantImagesServiceHandle
|
||||
{
|
||||
public void InstallBindings(ContainerBuilder containerBuilder)
|
||||
{
|
||||
@@ -50,18 +54,29 @@ namespace Code.Infrastructure.App
|
||||
Resolution.Eager);
|
||||
containerBuilder.RegisterType(typeof(AudioService), new[] { typeof(IAudioService) }, Lifetime.Singleton,
|
||||
Resolution.Eager);
|
||||
|
||||
containerBuilder.RegisterType(typeof(TaskService), new[] { typeof(ITaskService) }, Lifetime.Singleton,
|
||||
Resolution.Eager);
|
||||
containerBuilder.RegisterType(typeof(PlantService), new[] { typeof(IPlantService) }, Lifetime.Singleton,
|
||||
Resolution.Eager);
|
||||
|
||||
containerBuilder.RegisterType(typeof(ConstantImagesService), Lifetime.Singleton,
|
||||
Resolution.Eager);
|
||||
}
|
||||
|
||||
private void InitLoadings()
|
||||
{
|
||||
// UIFactory
|
||||
// UIFactory =
|
||||
// Logo
|
||||
// Scene configs
|
||||
// Input service
|
||||
// Audio Factory
|
||||
// Audio Pool
|
||||
// Scene configs =
|
||||
// Input service
|
||||
// Audio Factory =
|
||||
// Audio Pool =
|
||||
// Layer masks
|
||||
_initialLoading = new Loading(7, () => EssentialLoadEnded(_thatRightContainer));
|
||||
// Tasks =
|
||||
// Plants =
|
||||
// CIS =
|
||||
_initialLoading = new Loading(10, () => EssentialLoadEnded(_thatRightContainer));
|
||||
|
||||
}
|
||||
|
||||
@@ -81,9 +96,7 @@ namespace Code.Infrastructure.App
|
||||
private void EssentialLoadEnded(Container container)
|
||||
{
|
||||
container.Resolve<EventBus.EventBus>().Unsubscribe(this);
|
||||
container.Resolve<AppStateMachine>().SwitchState(AppStates.Bootstrap)
|
||||
.AllowStateTransition(AppStates.Gameplay)
|
||||
.AllowStateTransition(AppStates.Platformer);
|
||||
container.Resolve<AppStateMachine>().SwitchState(AppStates.Bootstrap);
|
||||
container.Resolve<AppStateMachineContext>().StateMachine = container.Resolve<AppStateMachine>();
|
||||
}
|
||||
|
||||
@@ -96,8 +109,7 @@ namespace Code.Infrastructure.App
|
||||
{
|
||||
_initialLoading.DoProgress();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void UIInitialized()
|
||||
{
|
||||
_initialLoading.DoProgress();
|
||||
@@ -138,5 +150,26 @@ namespace Code.Infrastructure.App
|
||||
{
|
||||
_initialLoading.DoProgress();
|
||||
}
|
||||
|
||||
public void TasksLoaded()
|
||||
{
|
||||
_initialLoading.DoProgress();
|
||||
}
|
||||
|
||||
public void TasksSaved()
|
||||
{ }
|
||||
|
||||
public void PlantsLoaded()
|
||||
{
|
||||
_initialLoading.DoProgress();
|
||||
}
|
||||
|
||||
public void PlantsSaved()
|
||||
{ }
|
||||
|
||||
public void ImagesLoaded()
|
||||
{
|
||||
_initialLoading.DoProgress();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,8 @@ namespace Code.Infrastructure.App.States
|
||||
_eventBus.Subscribe(this);
|
||||
|
||||
Context.UIService.TryRemovePanel(UIPanelType.Logo);
|
||||
|
||||
Context.UIService.TryRemovePanel(UIPanelType.Loading);
|
||||
Context.UIService.TryLoadPanel(UIPanelType.PlantAdd);
|
||||
// Context.AudioFactory.LoadAudioClips(AudioNames.UISounds);
|
||||
}
|
||||
|
||||
@@ -33,9 +34,9 @@ namespace Code.Infrastructure.App.States
|
||||
|
||||
public void UILoaded(UIPanelType uiPanelType)
|
||||
{
|
||||
// if (uiPanelType != UIPanelType.DebugSceneChooser) return;
|
||||
//
|
||||
// Context.UIService.OpenPanel(uiPanelType);
|
||||
if (uiPanelType != UIPanelType.PlantAdd) return;
|
||||
|
||||
Context.UIService.OpenPanel(uiPanelType);
|
||||
}
|
||||
public void OnReadyToPlay(AudioNames groupName)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user