[VContainer] Add application lifetime scope and configure message pipe
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: efbe0be7eb809d54498d888bd20f0843
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -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: []
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c2518ef4cc570d345b84cd7302f34e61
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9440d9ac41836bb4299df8dabc000fa4
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 49a3db5919224d6ea8b572dfdb137912
|
||||||
|
timeCreated: 1775594105
|
||||||
Reference in New Issue
Block a user