Skip to content

Commit 3443aca

Browse files
authored
Merge pull request #47 from TaloDev/develop
Release 0.13.0
2 parents 421c2c4 + 6939b9c commit 3443aca

File tree

20 files changed

+69
-56
lines changed

20 files changed

+69
-56
lines changed

.github/workflows/create-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
COMMIT_MESSAGE: "Release https://github.com/TaloDev/unity/releases/tag/${{ github.ref_name }}"
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717

18-
- uses: actions/setup-node@v2
18+
- uses: actions/setup-node@v3
1919
with:
20-
node-version: 14
20+
node-version: 16
2121

2222
- name: Copy files
2323
run: |

.github/workflows/tag.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
tag:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212

1313
- name: Check version change
1414
id: check
15-
uses: EndBug/version-check@v1
15+
uses: EndBug/version-check@v2
1616
with:
1717
file-name: Packages/com.trytalo.talo/package.json
1818

Assets/Scripts/Events/FlushEvents.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
public class FlushEvents : MonoBehaviour
77
{
8-
public void OnButtonClick()
8+
public async void OnButtonClick()
99
{
10-
Flush();
10+
await Flush();
1111
}
1212

13-
private async void Flush()
13+
private async Task Flush()
1414
{
1515
try
1616
{

Assets/Scripts/Events/TrackEvent.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22
using UnityEngine;
33
using TaloGameServices;
44
using System.Linq;
5+
using System.Threading.Tasks;
56

67
public class TrackEvent : MonoBehaviour
78
{
89
public string eventName;
910
public Prop[] props;
1011
public bool flushImmediately;
1112

12-
public void OnButtonClick()
13+
public async void OnButtonClick()
1314
{
14-
Track();
15+
await Track();
1516
}
1617

17-
private async void Track()
18+
private async Task Track()
1819
{
1920
try
2021
{
21-
Talo.Events.Track(eventName, props.Select((prop) => (prop.key, prop.value)).ToArray());
22+
await Talo.Events.Track(eventName, props.Select((prop) => (prop.key, prop.value)).ToArray());
2223

2324
ResponseMessage.SetText($"{eventName} tracked");
2425

Assets/Scripts/Events/TrackLevelUpEvent.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
using UnityEngine;
22
using TaloGameServices;
33
using System;
4+
using System.Threading.Tasks;
45

56
public class TrackLevelUpEvent : MonoBehaviour
67
{
78
public int level = 1;
89
private float timeTaken;
910

10-
public void OnButtonClick()
11+
public async void OnButtonClick()
1112
{
12-
Track();
13+
await Track();
1314
}
1415

15-
private void Track()
16+
private async Task Track()
1617
{
1718
level++;
1819

1920
try
2021
{
21-
Talo.Events.Track(
22+
await Talo.Events.Track(
2223
"Level up",
2324
("newLevel", $"{level}"),
2425
("timeTaken", $"{timeTaken}")

Assets/Scripts/Leaderboards/GetLeaderboardEntries.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
using TaloGameServices;
33
using UnityEngine;
44
using System.Linq;
5+
using System.Threading.Tasks;
56

67
public class GetLeaderboardEntries : MonoBehaviour
78
{
89
public string internalName;
910
public int page;
1011

11-
public void OnButtonClick()
12+
public async void OnButtonClick()
1213
{
13-
FetchEntries();
14+
await FetchEntries();
1415
}
1516

16-
private async void FetchEntries()
17+
private async Task FetchEntries()
1718
{
1819
try
1920
{

Assets/Scripts/Leaderboards/PostLeaderboardEntry.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
using System;
2+
using System.Threading.Tasks;
23
using TaloGameServices;
34
using UnityEngine;
45

56
public class PostLeaderboardEntry : MonoBehaviour
67
{
78
public string internalName;
89

9-
public void OnButtonClick()
10+
public async void OnButtonClick()
1011
{
11-
PostEntry();
12+
await PostEntry();
1213
}
1314

14-
private async void PostEntry()
15+
private async Task PostEntry()
1516
{
1617
try
1718
{

Assets/Scripts/Players/IdentifyPlayer.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using UnityEngine;
33
using UnityEngine.UI;
44
using TaloGameServices;
5+
using System.Threading.Tasks;
56

67
public class IdentifyPlayer : MonoBehaviour
78
{
@@ -34,12 +35,12 @@ private void Start()
3435
};
3536
}
3637

37-
public void OnButtonClick()
38+
public async void OnButtonClick()
3839
{
39-
Identify();
40+
await Identify();
4041
}
4142

42-
private async void Identify()
43+
private async Task Identify()
4344
{
4445
try
4546
{

Assets/Scripts/Players/SetHealthProp.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44
using TaloGameServices;
5+
using System.Threading.Tasks;
56

67
public class SetHealthProp : MonoBehaviour
78
{
89
public string key = "currentHealth";
910

10-
public void OnButtonClick()
11+
public async void OnButtonClick()
1112
{
12-
UpdateProp();
13+
await UpdateProp();
1314
}
1415

15-
private void UpdateProp()
16+
private async Task UpdateProp()
1617
{
1718
string value = Random.Range(0, 100).ToString();
1819

19-
Talo.CurrentPlayer.SetProp(key, value);
20+
await Talo.CurrentPlayer.SetProp(key, value);
2021
ResponseMessage.SetText($"{key} set to {value}");
2122
}
2223
}

Assets/Scripts/Saves/LoadableCube.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
public class LoadableCube : Loadable
66
{
7+
private void OnMouseDrag()
8+
{
9+
var nextPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
10+
nextPos.z = 0;
11+
transform.position = nextPos;
12+
}
13+
714
public override void RegisterFields()
815
{
916
RegisterField("x", transform.position.x);

0 commit comments

Comments
 (0)