Skip to content

Commit dec7a58

Browse files
Update Unity sample
1 parent 1633752 commit dec7a58

38 files changed

+39
-36
lines changed

readme/BlazorServerApp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The [project file](/samples/BlazorServerApp/BlazorServerApp.csproj) looks like t
6868
<PrivateAssets>all</PrivateAssets>
6969
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
7070
</PackageReference>
71-
<PackageReference Include="Pure.DI.MS" Version="2.1.53" />
71+
<PackageReference Include="Pure.DI.MS" Version="2.1.54" />
7272
</ItemGroup>
7373

7474
</Project>

readme/BlazorWebAssemblyApp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The [project file](/samples/BlazorWebAssemblyApp/BlazorWebAssemblyApp.csproj) lo
6767
<PrivateAssets>all</PrivateAssets>
6868
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
6969
</PackageReference>
70-
<PackageReference Include="Pure.DI.MS" Version="2.1.53" />
70+
<PackageReference Include="Pure.DI.MS" Version="2.1.54" />
7171
</ItemGroup>
7272

7373
</Project>

readme/GrpcService.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The [project file](/samples/GrpcService/GrpcService.csproj) looks like this:
5353
<PrivateAssets>all</PrivateAssets>
5454
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5555
</PackageReference>
56-
<PackageReference Include="Pure.DI.MS" Version="2.1.53" />
56+
<PackageReference Include="Pure.DI.MS" Version="2.1.54" />
5757
</ItemGroup>
5858

5959
</Project>

readme/Maui.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ The [project file](/samples/MAUIApp/MAUIApp.csproj) looks like this:
216216
<PrivateAssets>all</PrivateAssets>
217217
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
218218
</PackageReference>
219-
<PackageReference Include="Pure.DI.MS" Version="2.1.53" />
219+
<PackageReference Include="Pure.DI.MS" Version="2.1.54" />
220220
</ItemGroup>
221221

222222
</Project>

readme/MinimalWebAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The [project file](/samples/WebAPI/WebAPI.csproj) looks like this:
7676
<PrivateAssets>all</PrivateAssets>
7777
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
7878
</PackageReference>
79-
<PackageReference Include="Pure.DI.MS" Version="2.1.53" />
79+
<PackageReference Include="Pure.DI.MS" Version="2.1.54" />
8080
</ItemGroup>
8181

8282
</Project>

readme/Unity.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ This example demonstrates the creation of a [Unity](https://unity.com/) applicat
66

77
![Unity](https://cdn.sanity.io/images/fuvbjjlp/production/01c082f3046cc45548249c31406aeffd0a9a738e-296x100.png)
88

9-
The definition of the composition is in [Composition.cs](/samples/UnityApp/Assets/Scripts/Composition.cs). This class setups how the composition of objects will be created for the application. You must not forget to define any necessary composition builders:
9+
The definition of the composition is in [Composition.cs](/samples/UnityApp/Assets/Scripts/Composition.cs). This class setups how the composition of objects will be created for the application. Don't forget to define builders for types inherited from `MonoBehaviour`:
1010

1111
```csharp
1212
using Pure.DI;
13+
using UnityEngine;
1314
using static Pure.DI.Lifetime;
1415

1516
internal partial class Composition
@@ -18,7 +19,7 @@ internal partial class Composition
1819

1920
private void Setup() => DI.Setup()
2021
.Bind().As(Singleton).To<ClockService>()
21-
.Builder<Clock>();
22+
.Builders<MonoBehaviour>();
2223
}
2324
```
2425

@@ -28,7 +29,7 @@ Advantages over classical DI container libraries:
2829
- Does not add dependencies to any additional assembly.
2930
- Since the generated code uses primitive language constructs to create object compositions and does not use any libraries, you can easily debug the object composition code as regular code in your application.
3031

31-
The `BuildUp` composition method will be generated for each call to the `Builder<T>()` method when setting up the dependency graph. Its name can be overridden as desired. This method will look like this:
32+
For types inherited from `MonoBehaviour`, a `BuildUp` composition method will be generated. This method will look as follows:
3233

3334
```csharp
3435
[CompilerServices.MethodImpl(MethodImplOptions.AggressiveInlining)]

readme/UnityPageTemplate.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ This example demonstrates the creation of a [Unity](https://unity.com/) applicat
66

77
![Unity](https://cdn.sanity.io/images/fuvbjjlp/production/01c082f3046cc45548249c31406aeffd0a9a738e-296x100.png)
88

9-
The definition of the composition is in [Composition.cs](/samples/UnityApp/Assets/Scripts/Composition.cs). This class setups how the composition of objects will be created for the application. You must not forget to define any necessary composition builders:
9+
The definition of the composition is in [Composition.cs](/samples/UnityApp/Assets/Scripts/Composition.cs). This class setups how the composition of objects will be created for the application. Don't forget to define builders for types inherited from `MonoBehaviour`:
1010

1111
```csharp
1212
using Pure.DI;
13+
using UnityEngine;
1314
using static Pure.DI.Lifetime;
1415

1516
internal partial class Composition
@@ -18,7 +19,7 @@ internal partial class Composition
1819

1920
private void Setup() => DI.Setup()
2021
.Bind().As(Singleton).To<ClockService>()
21-
.Builder<Clock>();
22+
.Builders<MonoBehaviour>();
2223
}
2324
```
2425

@@ -28,7 +29,7 @@ Advantages over classical DI container libraries:
2829
- Does not add dependencies to any additional assembly.
2930
- Since the generated code uses primitive language constructs to create object compositions and does not use any libraries, you can easily debug the object composition code as regular code in your application.
3031

31-
The `BuildUp` composition method will be generated for each call to the `Builder<T>()` method when setting up the dependency graph. Its name can be overridden as desired. This method will look like this:
32+
For types inherited from `MonoBehaviour`, a `BuildUp` composition method will be generated. This method will look as follows:
3233

3334
```csharp
3435
[CompilerServices.MethodImpl(MethodImplOptions.AggressiveInlining)]

readme/WebAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The [project file](/samples/WebAPI/WebAPI.csproj) looks like this:
5555
<PrivateAssets>all</PrivateAssets>
5656
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5757
</PackageReference>
58-
<PackageReference Include="Pure.DI.MS" Version="2.1.53" />
58+
<PackageReference Include="Pure.DI.MS" Version="2.1.54" />
5959
</ItemGroup>
6060

6161
</Project>

readme/WebApp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The [project file](/samples/WebApp/WebApp.csproj) looks like this:
5555
<PrivateAssets>all</PrivateAssets>
5656
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5757
</PackageReference>
58-
<PackageReference Include="Pure.DI.MS" Version="2.1.53" />
58+
<PackageReference Include="Pure.DI.MS" Version="2.1.54" />
5959
</ItemGroup>
6060

6161
</Project>

samples/UnityApp/Assembly-CSharp-Editor.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
4242
</PropertyGroup>
4343
<ItemGroup>
44-
<Analyzer Include="C:\Projects\DevTeam\Pure.DI\samples\UnityApp\Assets\Packages\Pure.DI.2.1.53\analyzers\dotnet\roslyn4.3\cs\Pure.DI.Core.dll" />
45-
<Analyzer Include="C:\Projects\DevTeam\Pure.DI\samples\UnityApp\Assets\Packages\Pure.DI.2.1.53\analyzers\dotnet\roslyn4.3\cs\Pure.DI.dll" />
44+
<Analyzer Include="C:\Projects\DevTeam\Pure.DI\samples\UnityApp\Assets\Packages\Pure.DI.2.1.54\analyzers\dotnet\roslyn4.3\cs\Pure.DI.Core.dll" />
45+
<Analyzer Include="C:\Projects\DevTeam\Pure.DI\samples\UnityApp\Assets\Packages\Pure.DI.2.1.54\analyzers\dotnet\roslyn4.3\cs\Pure.DI.dll" />
4646
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.0.35f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.SourceGenerators.dll" />
4747
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.0.35f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" />
4848
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.0.35f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" />

samples/UnityApp/Assembly-CSharp.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
4242
</PropertyGroup>
4343
<ItemGroup>
44-
<Analyzer Include="C:\Projects\DevTeam\Pure.DI\samples\UnityApp\Assets\Packages\Pure.DI.2.1.53\analyzers\dotnet\roslyn4.3\cs\Pure.DI.Core.dll" />
45-
<Analyzer Include="C:\Projects\DevTeam\Pure.DI\samples\UnityApp\Assets\Packages\Pure.DI.2.1.53\analyzers\dotnet\roslyn4.3\cs\Pure.DI.dll" />
44+
<Analyzer Include="C:\Projects\DevTeam\Pure.DI\samples\UnityApp\Assets\Packages\Pure.DI.2.1.54\analyzers\dotnet\roslyn4.3\cs\Pure.DI.Core.dll" />
45+
<Analyzer Include="C:\Projects\DevTeam\Pure.DI\samples\UnityApp\Assets\Packages\Pure.DI.2.1.54\analyzers\dotnet\roslyn4.3\cs\Pure.DI.dll" />
4646
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.0.35f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.SourceGenerators.dll" />
4747
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.0.35f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" />
4848
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.0.35f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" />

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/Pure.DI.nuspec renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/Pure.DI.nuspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>Pure.DI</id>
5-
<version>2.1.53</version>
5+
<version>2.1.54</version>
66
<authors>Pure.DI</authors>
77
<developmentDependency>true</developmentDependency>
88
<license type="expression">MIT</license>
@@ -13,6 +13,6 @@
1313
<description>Pure.DI is not a framework or library, but a source code generator for creating object graphs. To make them accurate, the developer uses a set of intuitive hints from the Pure.DI API. During the compilation phase, Pure.DI determines the optimal graph structure, checks its correctness, and generates partial class code to create object graphs in the Pure DI paradigm using only basic language constructs. The resulting generated code is robust, works everywhere, throws no exceptions, does not depend on .NET library calls or .NET reflections, is efficient in terms of performance and memory consumption, and is subject to all optimizations. This code can be easily integrated into an application because it does not use unnecessary delegates, additional calls to any methods, type conversions, boxing/unboxing, etc.</description>
1414
<copyright>Copyright (C) 2025 Nikolay Pianikov</copyright>
1515
<tags>ioc solid dotnet dependency-injection inversion-of-control di injection-container injection-framework dip csharp-sourcegenerator</tags>
16-
<repository type="git" url="https://github.com/DevTeam/Pure.DI.git" commit="2db6bb76bbb7a3f9a45aa6815fcde1352f2b193d" />
16+
<repository type="git" url="https://github.com/DevTeam/Pure.DI.git" commit="571607b1d4a856d6eb4218cbd86cc82eecdb6cfb" />
1717
</metadata>
1818
</package>

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/Pure.DI.nuspec.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/Pure.DI.nuspec.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/README.md.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/README.md.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet/roslyn4.3.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet/roslyn4.3.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet/roslyn4.3/cs.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet/roslyn4.3/cs.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet/roslyn4.3/cs/Pure.DI.Core.dll.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet/roslyn4.3/cs/Pure.DI.Core.dll.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet/roslyn4.3/cs/Pure.DI.dll.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet/roslyn4.3/cs/Pure.DI.dll.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet/roslyn4.8.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet/roslyn4.8.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet/roslyn4.8/cs.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet/roslyn4.8/cs.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet/roslyn4.8/cs/Pure.DI.Core.dll.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet/roslyn4.8/cs/Pure.DI.Core.dll.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/analyzers/dotnet/roslyn4.8/cs/Pure.DI.dll.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/analyzers/dotnet/roslyn4.8/cs/Pure.DI.dll.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/common.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/common.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/UnityApp/Assets/Packages/Pure.DI.2.1.53/common/icon.png.meta renamed to samples/UnityApp/Assets/Packages/Pure.DI.2.1.54/common/icon.png.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Pure.DI;
2+
using UnityEngine;
23
using static Pure.DI.Lifetime;
34

45
internal partial class Composition
@@ -7,5 +8,5 @@ internal partial class Composition
78

89
private void Setup() => DI.Setup()
910
.Bind().As(Singleton).To<ClockService>()
10-
.Builder<Clock>();
11+
.Builders<MonoBehaviour>();
1112
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Pure.DI" version="2.1.53" manuallyInstalled="true" />
3+
<package id="Pure.DI" version="2.1.54" manuallyInstalled="true" />
44
</packages>

0 commit comments

Comments
 (0)