-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathScope.cs
More file actions
35 lines (30 loc) · 904 Bytes
/
Scope.cs
File metadata and controls
35 lines (30 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using Pure.DI;
using UnityEngine;
// ReSharper disable InconsistentNaming
// ReSharper disable RequiredBaseTypesIsNotInherited
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable Unity.RedundantSerializeFieldAttribute
// ReSharper disable ArrangeTypeMemberModifiers
// ReSharper disable UnusedMember.Local
internal class ClocksComposition
{
[SerializeField] private ClockConfig clockConfig;
void Setup() => DI.Setup(kind: CompositionKind.Internal)
.Transient(() => clockConfig)
.Singleton<ClockService>();
}
public partial class Scope : MonoBehaviour
{
void Setup() => DI.Setup()
.DependsOn(nameof(ClocksComposition), SetupContextKind.Members)
.Root<ClockManager>(nameof(ClockManager))
.Builders<MonoBehaviour>();
void Start()
{
ClockManager.Start();
}
void OnDestroy()
{
Dispose();
}
}