diff --git a/Assets/Resources.meta b/Assets/Resources.meta new file mode 100644 index 00000000..c5d73515 --- /dev/null +++ b/Assets/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: efbe0be7eb809d54498d888bd20f0843 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/ApplicationLifetimeScope.prefab b/Assets/Resources/ApplicationLifetimeScope.prefab new file mode 100644 index 00000000..3f04e943 --- /dev/null +++ b/Assets/Resources/ApplicationLifetimeScope.prefab @@ -0,0 +1,50 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2606815251647872950 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8780821191864940505} + - component: {fileID: 2815566013290875396} + m_Layer: 0 + m_Name: ApplicationLifetimeScope + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8780821191864940505 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2606815251647872950} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2815566013290875396 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2606815251647872950} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 49a3db5919224d6ea8b572dfdb137912, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::ApplicationLifetimeScope + parentReference: + TypeName: + autoRun: 1 + autoInjectGameObjects: [] diff --git a/Assets/Resources/ApplicationLifetimeScope.prefab.meta b/Assets/Resources/ApplicationLifetimeScope.prefab.meta new file mode 100644 index 00000000..e2ff3a7a --- /dev/null +++ b/Assets/Resources/ApplicationLifetimeScope.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c2518ef4cc570d345b84cd7302f34e61 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/VContainerSettings.asset b/Assets/Resources/VContainerSettings.asset new file mode 100644 index 00000000..ded65d72 --- /dev/null +++ b/Assets/Resources/VContainerSettings.asset @@ -0,0 +1,18 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9cf4d8df1d704d5689f3c69bd70d1cb9, type: 3} + m_Name: VContainerSettings + m_EditorClassIdentifier: VContainer::VContainer.Unity.VContainerSettings + RootLifetimeScope: {fileID: 2815566013290875396, guid: c2518ef4cc570d345b84cd7302f34e61, type: 3} + EnableDiagnostics: 0 + DisableScriptModifier: 0 + RemoveClonePostfix: 0 diff --git a/Assets/Resources/VContainerSettings.asset.meta b/Assets/Resources/VContainerSettings.asset.meta new file mode 100644 index 00000000..0bf9b8eb --- /dev/null +++ b/Assets/Resources/VContainerSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9440d9ac41836bb4299df8dabc000fa4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ApplicationLifetimeScope.cs b/Assets/Scripts/ApplicationLifetimeScope.cs new file mode 100644 index 00000000..f39d89ef --- /dev/null +++ b/Assets/Scripts/ApplicationLifetimeScope.cs @@ -0,0 +1,30 @@ +using MessagePipe; +using VContainer; +using VContainer.Unity; + +public sealed class ApplicationLifetimeScope : LifetimeScope +{ + protected override void Configure(IContainerBuilder builder) + { + RegisterMessagePipe(builder); + } + + private void RegisterMessagePipe(IContainerBuilder builder) + { +#if UNITY_EDITOR + // Enable stack trace capture for diagnostics + builder.RegisterMessagePipe(options => + { + options.EnableCaptureStackTrace = true; + }); + + // Set the global MessagePipe provider + builder.RegisterBuildCallback(container => + { + GlobalMessagePipe.SetProvider(container.AsServiceProvider()); + }); +#else + builder.RegisterMessagePipe(); +#endif + } +} \ No newline at end of file diff --git a/Assets/Scripts/ApplicationLifetimeScope.cs.meta b/Assets/Scripts/ApplicationLifetimeScope.cs.meta new file mode 100644 index 00000000..23ba0a20 --- /dev/null +++ b/Assets/Scripts/ApplicationLifetimeScope.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 49a3db5919224d6ea8b572dfdb137912 +timeCreated: 1775594105 \ No newline at end of file