com.puzzlescapegames.services 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,14 +7,16 @@ namespace PuzzlescapeGames.Services.TickableService
7
7
  {
8
8
  public sealed class TickableService
9
9
  {
10
+ public event Action OnMinutesTick;
10
11
  public event Action OnSecondsTick;
11
12
 
12
13
  public TickableService()
13
14
  {
14
15
  SecondsTick( ThreadingUtils.QuitToken ).Forget();
16
+ MinutesTick( ThreadingUtils.QuitToken ).Forget();
15
17
  }
16
18
 
17
- private async UniTask SecondsTick( CancellationToken token )
19
+ private async UniTask SecondsTick( CancellationToken token = default )
18
20
  {
19
21
  bool isCanceled = false;
20
22
 
@@ -25,5 +27,17 @@ namespace PuzzlescapeGames.Services.TickableService
25
27
  isCanceled = await UniTask.WaitForSeconds( 1f, cancellationToken: token ).SuppressCancellationThrow();
26
28
  }
27
29
  }
30
+
31
+ private async UniTask MinutesTick( CancellationToken token = default )
32
+ {
33
+ bool isCanceled = false;
34
+
35
+ while ( !isCanceled )
36
+ {
37
+ OnMinutesTick?.Invoke();
38
+
39
+ isCanceled = await UniTask.WaitForSeconds( 60f, cancellationToken: token ).SuppressCancellationThrow();
40
+ }
41
+ }
28
42
  }
29
43
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name" : "com.puzzlescapegames.services",
3
3
  "displayName" : "Puzzlescape Games Services",
4
- "version" : "1.2.0",
4
+ "version" : "1.2.1",
5
5
  "author" : "Puzzlescape Games",
6
6
  "description" : "Common services.",
7
7
  "repository": {