UI Started

This commit is contained in:
ThomasCharester committed 2026-01-21 10:58:05 +03:00
1 parent a3cd3e86a1
commit 12a27f85c5
26 files changed
+478 -24

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="singleClickDiffPreview" value="1" />
<option name="vcsConfiguration" value="3" />
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+130
View File
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="7a4e4e1b-6c5f-4c8d-968e-512e90aa8c7c" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI.meta" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIFactory.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIFactory.cs.meta" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIPanel.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIPanel.cs.meta" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIPanelSettings.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIPanelSettings.cs.meta" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIPanelType.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIPanelType.cs.meta" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIService.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/UI/UIService.cs.meta" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Code/Example.meta" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Code/Infrastructure/Camera/CameraFactory.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Code/Infrastructure/Camera/CameraFactory.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/CameraSettingsConfig.Generated.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/CameraSettingsConfig.Generated.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/Code.Infrastructure.App.AppStateMachine.Generated.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/Code.Infrastructure.App.AppStateMachine.Generated.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/Code.Infrastructure.Camera.CameraStateMachine.Generated.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/Code.Infrastructure.Camera.CameraStateMachine.Generated.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/ConfigLocator.Generated.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/ConfigLocator.Generated.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/GameCameraConfig.Generated.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/GameCameraConfig.Generated.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/InputServiceConfig.Generated.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/InputServiceConfig.Generated.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/SceneInfoConfig.Generated.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/SceneInfoConfig.Generated.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/SystemConfigsReferences.Generated.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/UnityCodeGen.Generated/SystemConfigsReferences.Generated.cs" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$PROJECT_DIR$/Library/PackageCache/com.cysharp.unitask@a85b92a8e443/Runtime/UniTaskScheduler.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Library/PackageCache/com.unity.addressables@45e9abf44299/Runtime/AddressablesImpl.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://C:/TEMP/SourceGeneratedDocuments/1A3209B82D230FF4FE3E50D7/InfraGens/Code.Infrastructure.Generators.SceneLoaderGenerator/SceneLoader.Generated.g.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://C:/TEMP/SourceGeneratedDocuments/1A3209B82D230FF4FE3E50D7/InfraGens/StateMachineGenerator/Code.Infrastructure.App.AppStateMachine.StateMachine.Generated.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://C:/TEMP/SourceGeneratedDocuments/1A3209B82D230FF4FE3E50D7/InfraGens/StateMachineGenerator/Code.Infrastructure.App.States.BootstrapState.State.Generated.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://C:/TEMP/SourceGeneratedDocuments/1A3209B82D230FF4FE3E50D7/InfraGens/StateMachineGenerator/Code.Infrastructure.Camera.CameraStateMachine.StateMachine.Generated.cs" root0="FORCE_HIGHLIGHTING" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 2
}</component>
<component name="ProjectId" id="38WaBM3xnp06hWLmWixBiTqujw8" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "NotLiminalPCG",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor">
<configuration name="Start Unity" type="RunUnityExe" factoryName="Unity Executable">
<option name="EXE_PATH" value="C:\Program Files\Unity\Hub\Editor\6000.3.1f1\Editor\Unity.exe" />
<option name="PROGRAM_PARAMETERS" value="-projectPath A:\Projects\Infra -debugCodeOptimization" />
<option name="WORKING_DIRECTORY" value="A:\Projects\Infra" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<method v="2" />
</configuration>
<configuration name="Unit Tests (batch mode)" type="RunUnityExe" factoryName="Unity Executable">
<option name="EXE_PATH" value="C:\Program Files\Unity\Hub\Editor\6000.3.1f1\Editor\Unity.exe" />
<option name="PROGRAM_PARAMETERS" value="-runTests -batchmode -projectPath A:\Projects\Infra -testResults Logs/results.xml -logFile Logs/Editor.log -testPlatform EditMode -debugCodeOptimization" />
<option name="WORKING_DIRECTORY" value="A:\Projects\Infra" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<method v="2" />
</configuration>
<configuration name="Attach to Unity Editor &amp; Play" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="UNITY_ATTACH_AND_PLAY" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost">
<option name="allowRunningInParallel" value="false" />
<option name="listenPortForConnections" value="false" />
<option name="pid" />
<option name="projectPathOnTarget" />
<option name="selectedOptions">
<list />
</option>
<method v="2" />
</configuration>
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost">
<option name="allowRunningInParallel" value="false" />
<option name="listenPortForConnections" value="false" />
<option name="pid" />
<option name="projectPathOnTarget" />
<option name="selectedOptions">
<list />
</option>
<method v="2" />
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="7a4e4e1b-6c5f-4c8d-968e-512e90aa8c7c" name="Changes" comment="" />
<created>1768917644200</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1768917644200</updated>
<workItem from="1768917645584" duration="9243000" />
<workItem from="1768978880434" duration="3201000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="true" />
<component name="UnityProjectDiscoverer">
<option name="hasUnityReference" value="true" />
<option name="unityProject" value="true" />
<option name="unityProjectFolder" value="true" />
</component>
<component name="UnityUnitTestConfiguration" currentTestLauncher="Both" />
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>
</project>
-3
View File
@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 07cf07a937934e0094469237b5865b60
timeCreated: 1766350980
@@ -20,8 +20,7 @@ namespace Code.Infrastructure.Camera
private string _cameraConfigsLabel; private string _cameraConfigsLabel;
private EventBus.EventBus _eventBus; private EventBus.EventBus _eventBus;
private UnityEngine.Camera _camera; private UnityEngine.Camera _camera;
private IDisposable _disposableImplementation;
public CameraFactory(IConfigLocator configLocator, EventBus.EventBus eventBus) public CameraFactory(IConfigLocator configLocator, EventBus.EventBus eventBus)
{ {
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f00c637597e248c9b6df168e80ab4ea2
timeCreated: 1768978928
@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Code.Infrastructure.Configs;
using Code.Infrastructure.EventBus;
using Cysharp.Threading.Tasks;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
namespace Code.Infrastructure.UI
{
public interface IUIFactory
{
UniTaskVoid LoadPanel(UIPanelType panelType);
void ReleasePanel(UIPanel panel);
}
public class UIFactory : IDisposable, IUIFactory
{
private Dictionary<UIPanelType, UIPanelSettingsConfig> _configs;
private string _configsLabel;
private EventBus.EventBus _eventBus;
private AsyncOperationHandle<IList<UIPanelSettingsConfig>> _configsHandle;
public UIFactory(IConfigLocator configLocator, EventBus.EventBus eventBus)
{
_eventBus = eventBus;
_configsLabel = configLocator.TryGetManyConfigAssetReferences<UIPanelSettingsConfig>();
LoadConfigs().Forget();
}
public async UniTaskVoid LoadPanel(UIPanelType panelType)
{
var panel = (await Addressables.InstantiateAsync(_configs[panelType]).ToUniTask()).GetComponent<UIPanel>();
_eventBus.RaiseEvent<IUIPanelLoadedHandle>(ui => ui.UIPanelLoaded(panel, panelType));
}
public void ReleasePanel(UIPanel panel)
{
Addressables.ReleaseInstance(panel.gameObject);
}
private async UniTaskVoid LoadConfigs()
{
_configsHandle = Addressables.LoadAssetsAsync<UIPanelSettingsConfig>(_configsLabel);
await _configsHandle.ToUniTask();
_configs = _configsHandle.Result.ToDictionary(c => c.UIPanelType);
_eventBus.RaiseEvent<IUIInitializedHandle>(ui => ui.UIInitialized());
}
public void Dispose()
{
Addressables.Release(_configsHandle);
}
}
public interface IUIInitializedHandle : IGlobalSubscriber
{
void UIInitialized();
}
public interface IUIPanelLoadedHandle : IGlobalSubscriber
{
void UIPanelLoaded(UIPanel panel, UIPanelType panelType);
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8447b81247b24f1b869b0067aeeff0b8
timeCreated: 1768979324
+13
View File
@@ -0,0 +1,13 @@
using System.ComponentModel;
using UnityEngine;
namespace Code.Infrastructure.UI
{
public abstract class UIPanel : MonoBehaviour
{
[field: Category("UIPanel")] public bool InjectMeSenpai { get; protected set; }
public abstract void Open();
public abstract void Close();
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4464e0158e044f5985c45cb73250cf43
timeCreated: 1768980188
@@ -0,0 +1,12 @@
using Code.Infrastructure.Generators;
using UnityEngine.AddressableAssets;
namespace Code.Infrastructure.UI
{
[Config("Configs/UI/UIPanelSettings", true)]
public class UIPanelSettings
{
[ToConfig] public AssetReference Prefab;
[ToConfig] public UIPanelType UIPanelType;
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 996c214bb8624a64b6c563f0c13320ac
timeCreated: 1768979468
@@ -0,0 +1,9 @@
namespace Code.Infrastructure.UI
{
public enum UIPanelType
{
Logo,
Loading,
DebugMenu
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e33d3007130a4cbbac8a5e962d5c4806
timeCreated: 1768979170
@@ -0,0 +1,66 @@
using System.Collections.Generic;
using Reflex.Core;
using Reflex.Extensions;
using Reflex.Injectors;
using UnityEngine.SceneManagement;
namespace Code.Infrastructure.UI
{
public interface IUIService
{
void OpenPanel(UIPanelType uiPanelType);
void ClosePanel(UIPanelType uiPanelType);
void TryLoadPanel(UIPanelType uiPanelType);
void TryRemovePanel(UIPanelType panelType);
}
public class UIService : IUIPanelLoadedHandle, IUIService
{
private Dictionary<UIPanelType, UIPanel> _loadedPanels = new();
private EventBus.EventBus _eventBus;
private IUIFactory _factory;
public UIService(EventBus.EventBus eventBus, IUIFactory factory)
{
_eventBus = eventBus;
_factory = factory;
eventBus.Subscribe(this);
}
public void OpenPanel(UIPanelType uiPanelType)
{
_loadedPanels[uiPanelType].gameObject.SetActive(true); // TODO Братуха реально реши надо вкл\выкл или это очередная хренооптимизация
_loadedPanels[uiPanelType].Open();
}
public void ClosePanel(UIPanelType uiPanelType)
{
_loadedPanels[uiPanelType].gameObject.SetActive(false);
_loadedPanels[uiPanelType].Close();
}
public void TryLoadPanel(UIPanelType uiPanelType) => _factory.LoadPanel(uiPanelType);
public void UIPanelLoaded(UIPanel panel, UIPanelType panelType)
{
_loadedPanels.Add(panelType, panel);
if(panel.InjectMeSenpai)
GameObjectInjector.InjectRecursive(panel.gameObject, Container.RootContainer);
// GameObjectInjector.InjectRecursive(panel.gameObject, SceneManager.GetActiveScene().GetSceneContainer()); // Скорее всего будут нужны компоненты текущей сцены
}
public void TryRemovePanel(UIPanelType panelType)
{
//
RemovePanel(panelType);
}
private void RemovePanel(UIPanelType panelType)
{
_factory.ReleasePanel(_loadedPanels[panelType]);
_loadedPanels.Remove(panelType);
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0bcb777d18014c428f24113d73787e38
timeCreated: 1768980594
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3d2c689e65afcd2498be16afac55fa0f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="singleClickDiffPreview" value="1" />
<option name="vcsConfiguration" value="3" />
</component>
</project>
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoGeneratedRunConfigurationManager">
<projectFile profileName="DebugRoslynSourceGenerator">InfraGens/InfraGens/InfraGens.csproj</projectFile>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="635431d8-da67-4616-a903-92a022c0fc39" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../../.." />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://C:/TEMP/SourceGeneratedDocuments/01990D7D80C2ED55981BC02F/InfraGens/ConfigGenerator/ConfigLocator.Generated.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://C:/TEMP/SourceGeneratedDocuments/01990D7D80C2ED55981BC02F/InfraGens/ConfigGenerator/GameCameraConfig.Generated.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://C:/TEMP/SourceGeneratedDocuments/01990D7D80C2ED55981BC02F/InfraGens/ConfigGenerator/SystemConfigsReferences.Generated.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://C:/TEMP/SourceGeneratedDocuments/01990D7D80C2ED55981BC02F/InfraGens/InfraGens.SampleSourceGenerator/Loh.g.cs" root0="FORCE_HIGHLIGHTING" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 1
}</component>
<component name="ProjectId" id="38WYcxb1Uhaiine3W2hMF66pdg6" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "NotLiminalOne",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RunManager">
<configuration name="InfraGens: DebugRoslynSourceGenerator" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/InfraGens/InfraGens/InfraGens.csproj" />
<option name="LAUNCH_PROFILE_TFM" value=".NETStandard,Version=v2.0" />
<option name="LAUNCH_PROFILE_NAME" value="DebugRoslynSourceGenerator" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1" />
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<method v="2">
<option name="Build" />
</method>
</configuration>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="635431d8-da67-4616-a903-92a022c0fc39" name="Changes" comment="" />
<created>1768916878151</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1768916878151</updated>
<workItem from="1768916879591" duration="297000" />
<workItem from="1768917209866" duration="9934000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="UnityProjectConfiguration" hasMinimizedUI="false" />
<component name="VcsManagerConfiguration">
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
</component>
</project>
@@ -19,15 +19,15 @@ public partial class AppStateMachine : AbstractStateMachine<Code.Infrastructure.
public AppStateMachine(Code.Infrastructure.App.AppStateMachineContext context, EventBus.EventBus eventBus) : base(context) public AppStateMachine(Code.Infrastructure.App.AppStateMachineContext context, EventBus.EventBus eventBus) : base(context)
{ {
var stateBootstrapState = new BootstrapState(StateMachineContext,eventBus);
States.Add(stateBootstrapState.myState, stateBootstrapState);
var stateGameplayState = new GameplayState(StateMachineContext,eventBus); var stateGameplayState = new GameplayState(StateMachineContext,eventBus);
States.Add(stateGameplayState.myState, stateGameplayState); States.Add(stateGameplayState.myState, stateGameplayState);
var stateMainMenuState = new MainMenuState(StateMachineContext,eventBus); var stateMainMenuState = new MainMenuState(StateMachineContext,eventBus);
States.Add(stateMainMenuState.myState, stateMainMenuState); States.Add(stateMainMenuState.myState, stateMainMenuState);
var stateBootstrapState = new BootstrapState(StateMachineContext,eventBus);
States.Add(stateBootstrapState.myState, stateBootstrapState);
} }
protected override bool CheckTransitionAllowed(Code.Infrastructure.App.AppStates nextState) => AllowedStates.HasFlag(nextState); protected override bool CheckTransitionAllowed(Code.Infrastructure.App.AppStates nextState) => AllowedStates.HasFlag(nextState);
@@ -3,8 +3,6 @@
#pragma warning disable CS0105 #pragma warning disable CS0105
using Code.Infrastructure.StateMachine; using Code.Infrastructure.StateMachine;
using Code.Infrastructure.Camera.CameraStates;
using Code.Infrastructure.Camera.CameraStates; using Code.Infrastructure.Camera.CameraStates;
#pragma warning restore CS0105 #pragma warning restore CS0105
@@ -19,7 +17,6 @@ public partial class CameraStateMachine : AbstractStateMachine<Code.Infrastructu
var stateNoneCameraState = new NoneCameraState(StateMachineContext,eventBus); var stateNoneCameraState = new NoneCameraState(StateMachineContext,eventBus);
States.Add(stateNoneCameraState.myState, stateNoneCameraState); States.Add(stateNoneCameraState.myState, stateNoneCameraState);
} }
@@ -1,9 +1,10 @@
#pragma warning disable CS0105 #pragma warning disable CS0105
using Code.Infrastructure.SceneLoader; using Code.Infrastructure.Camera;
using Code.Infrastructure.UI;
using Code.Infrastructure.Camera;
using Code.Infrastructure.SceneLoader;
using Code.Infrastructure.Input; using Code.Infrastructure.Input;
using Code.Infrastructure.Camera;
using Code.Infrastructure.Camera;
using UnityEngine; using UnityEngine;
#pragma warning restore CS0105 #pragma warning restore CS0105
@@ -17,14 +18,16 @@ using Code.Infrastructure.Camera;
{ {
SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>("SystemConfigsReferences"); SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>("SystemConfigsReferences");
_multipleConfigReferences.Add(typeof(Code.Infrastructure.Camera.CameraSettingsConfig), systemConfigsReferences.CameraSettings);
_multipleConfigReferences.Add(typeof(Code.Infrastructure.UI.UIPanelSettingsConfig), systemConfigsReferences.UIPanelSettings);
_singleConfigReferences.Add(typeof(Code.Infrastructure.Camera.GameCameraConfig), systemConfigsReferences.GameCamera);
_multipleConfigReferences.Add(typeof(Code.Infrastructure.SceneLoader.SceneInfoConfig), systemConfigsReferences.SceneInfo); _multipleConfigReferences.Add(typeof(Code.Infrastructure.SceneLoader.SceneInfoConfig), systemConfigsReferences.SceneInfo);
_singleConfigReferences.Add(typeof(Code.Infrastructure.Input.InputServiceConfig), systemConfigsReferences.InputService); _singleConfigReferences.Add(typeof(Code.Infrastructure.Input.InputServiceConfig), systemConfigsReferences.InputService);
_multipleConfigReferences.Add(typeof(Code.Infrastructure.Camera.CameraSettingsConfig), systemConfigsReferences.CameraSettings);
_singleConfigReferences.Add(typeof(Code.Infrastructure.Camera.GameCameraConfig), systemConfigsReferences.GameCamera);
//_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences); //_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
} }
} }
@@ -1,9 +1,10 @@
#pragma warning disable CS0105 #pragma warning disable CS0105
using Code.Infrastructure.SceneLoader; using Code.Infrastructure.Camera;
using Code.Infrastructure.UI;
using Code.Infrastructure.Camera;
using Code.Infrastructure.SceneLoader;
using Code.Infrastructure.Input; using Code.Infrastructure.Input;
using Code.Infrastructure.Camera;
using Code.Infrastructure.Camera;
using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets;
#pragma warning restore CS0105 #pragma warning restore CS0105
@@ -11,10 +12,11 @@ using Code.Infrastructure.Camera;
namespace Code.Infrastructure.Configs{ namespace Code.Infrastructure.Configs{
public partial class SystemConfigsReferences public partial class SystemConfigsReferences
{ {
public string SceneInfo; public string CameraSettings;
public AssetReference InputService; public string UIPanelSettings;
public string CameraSettings;
public AssetReference GameCamera; public AssetReference GameCamera;
public string SceneInfo;
public AssetReference InputService;
} }
} }
@@ -0,0 +1,18 @@
#pragma warning disable CS0105
using UnityEngine.AddressableAssets;
using Code.Infrastructure.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
namespace Code.Infrastructure.UI{
#pragma warning restore CS0105
[CreateAssetMenu(fileName = "UIPanelSettingsConfig", menuName = "Configs/UI/UIPanelSettings")]
public class UIPanelSettingsConfig : ScriptableObject
{
public UnityEngine.AddressableAssets.AssetReference Prefab;
public Code.Infrastructure.UI.UIPanelType UIPanelType;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 17bdede85b436f44e992b27d170ccbc2