feat: add bootstrap architecture and common utilities for Unity project

- Add GameLifetimeScope for dependency injection with Zenject
- Implement boot flow service with entry point and interfaces
- Create boot state machine (Splash, Menu, Load states)
- Add UI views for boot screens
- Add common services base class and interface
- Implement generic state machine controller
- Add base UI view components and ViewModel interface
- Update SampleScene.unity
- Add BootSettings asset

Добавлена архитектура bootstrap и общие утилиты для Unity проекта:
- Добавлен GameLifetimeScope для внедрения зависимостей (Zenject)
- Реализован сервис потока загрузки с точкой входа и интерфейсами
- Создана машина состояний загрузки (Splash, Menu, Load состояния)
- Добавлены UI представления для экранов загрузки
- Добавлены базовые классы сервисов и интерфейс IService
- Реализован контроллер машины состояний
- Добавлены базовые компоненты UI вида и интерфейс ViewModel
- Обновлена сцена SampleScene.unity
- Добавлен ассет BootSettings
This commit is contained in:
2026-05-27 03:56:38 +07:00
parent 6c46b3043a
commit 4435a2c6b6
57 changed files with 937 additions and 0 deletions
@@ -0,0 +1,43 @@
using QuizPleaseTest.Boot.Flow;
using QuizPleaseTest.Boot.Settings;
using QuizPleaseTest.Boot.States;
using QuizPleaseTest.Boot.UI;
using QuizPleaseTest.Common.Services;
using QuizPleaseTest.Common.StateMachine;
using UnityEngine;
using VContainer;
using VContainer.Unity;
namespace QuizPleaseTest.Boot.Composition
{
public class GameLifetimeScope : LifetimeScope
{
[field: SerializeField] public BootSettings BootSettings { get; private set; }
[field: SerializeField] public SplashUIView SplashView { get; private set; }
[field: SerializeField] public LoadingUIView LoadingView { get; private set; }
[field: SerializeField] public MenuUIView MenuView { get; private set; }
protected override void Configure(IContainerBuilder builder)
{
builder.RegisterInstance(BootSettings);
builder.RegisterComponent(SplashView);
builder.RegisterComponent(LoadingView);
builder.RegisterComponent(MenuView);
builder.Register<BootFlowService>(Lifetime.Singleton)
.As<IBootFlowService>()
.As<IService>();
builder.Register<BootStatesController>(Lifetime.Singleton)
.As<IStatesController<BootStateCode>>()
.AsSelf();
builder.Register<SplashState>(Lifetime.Singleton);
builder.Register<LoadState>(Lifetime.Singleton);
builder.Register<MenuState>(Lifetime.Singleton);
builder.RegisterEntryPoint<BootstrapEntryPoint>();
}
}
}