-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from TaloDev/develop
Release 0.26.0
- Loading branch information
Showing
30 changed files
with
1,058 additions
and
682 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using TaloGameServices; | ||
using UnityEngine; | ||
|
||
public class GetGroup : MonoBehaviour | ||
{ | ||
public string groupId; | ||
|
||
public async void OnButtonClick() | ||
{ | ||
if (string.IsNullOrEmpty(groupId)) | ||
{ | ||
ResponseMessage.SetText("groupId not set on 'Get group' button"); | ||
} | ||
else | ||
{ | ||
try | ||
{ | ||
var group = await Talo.PlayerGroups.Get(groupId); | ||
ResponseMessage.SetText($"{group.name} has {group.count} player(s)"); | ||
} | ||
catch (Exception e) | ||
{ | ||
ResponseMessage.SetText(e.Message); | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/Samples/Playground/Scripts/Players/GetGroup.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using UnityEngine; | ||
|
||
namespace TaloGameServices | ||
{ | ||
public class PlayerGroupsAPI : BaseAPI | ||
{ | ||
public PlayerGroupsAPI() : base("v1/player-groups") { } | ||
|
||
public async Task<Group> Get(string groupId) | ||
{ | ||
var uri = new Uri($"{baseUrl}/{groupId}"); | ||
var json = await Call(uri, "GET"); | ||
|
||
var res = JsonUtility.FromJson<PlayerGroupsGetResponse>(json); | ||
return res.group; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Packages/com.trytalo.talo/Runtime/APIs/PlayerGroupsAPI.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
[System.Serializable] | ||
public class Group | ||
namespace TaloGameServices | ||
{ | ||
public string id, name; | ||
[System.Serializable] | ||
public class Group | ||
{ | ||
public string id; | ||
public string name; | ||
public string description; | ||
public object[] rules; | ||
public string ruleMode; | ||
public bool membersVisible; | ||
public int count; | ||
public Player[] members; | ||
public string updatedAt; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.