-
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 #86 from TaloDev/playground-interactivity
Make playground more interactive, add better messaging
- Loading branch information
Showing
18 changed files
with
177 additions
and
623 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
43 changes: 0 additions & 43 deletions
43
Assets/Samples/Playground/Scripts/Events/TrackLevelUpEvent.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
Assets/Samples/Playground/Scripts/Events/TrackLevelUpEvent.cs.meta
This file was deleted.
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
21 changes: 18 additions & 3 deletions
21
Assets/Samples/Playground/Scripts/Feedback/SendFeedback.cs
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,13 +1,28 @@ | ||
using UnityEngine; | ||
using TaloGameServices; | ||
using System; | ||
|
||
public class SendFeedback : MonoBehaviour | ||
{ | ||
public string internalName, feedbackComment; | ||
public string categoryInternalName, feedbackComment; | ||
|
||
public async void OnButtonClick() | ||
{ | ||
await Talo.Feedback.Send(internalName, feedbackComment); | ||
ResponseMessage.SetText($"Feedback sent for {internalName}: {feedbackComment}"); | ||
if (string.IsNullOrEmpty(categoryInternalName) || string.IsNullOrEmpty(feedbackComment)) | ||
{ | ||
ResponseMessage.SetText("categoryInternalName or feedbackComment not set on SendFeedbackButton"); | ||
return; | ||
} | ||
|
||
try | ||
{ | ||
await Talo.Feedback.Send(categoryInternalName, feedbackComment); | ||
ResponseMessage.SetText($"Feedback sent for {categoryInternalName}: {feedbackComment}"); | ||
} | ||
catch (Exception err) | ||
{ | ||
ResponseMessage.SetText(err.Message); | ||
throw err; | ||
} | ||
} | ||
} |
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
19 changes: 0 additions & 19 deletions
19
Assets/Samples/Playground/Scripts/Players/DeleteHealthProp.cs
This file was deleted.
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,34 @@ | ||
using UnityEngine; | ||
using TaloGameServices; | ||
using System.Threading.Tasks; | ||
using System; | ||
|
||
public class DeleteHealthProp : MonoBehaviour | ||
{ | ||
public string key; | ||
|
||
public async void OnButtonClick() | ||
{ | ||
await DeleteProp(); | ||
} | ||
|
||
private async Task DeleteProp() | ||
{ | ||
if (string.IsNullOrEmpty(key)) | ||
{ | ||
ResponseMessage.SetText("key not set on DeletePropButton"); | ||
return; | ||
} | ||
|
||
try | ||
{ | ||
await Talo.CurrentPlayer.DeleteProp(key); | ||
ResponseMessage.SetText($"{key} deleted"); | ||
} | ||
catch (Exception err) | ||
{ | ||
ResponseMessage.SetText(err.Message); | ||
throw err; | ||
} | ||
} | ||
} |
File renamed without changes.
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
21 changes: 0 additions & 21 deletions
21
Assets/Samples/Playground/Scripts/Players/SetHealthProp.cs
This file was deleted.
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,33 @@ | ||
using UnityEngine; | ||
using TaloGameServices; | ||
using System.Threading.Tasks; | ||
|
||
public class SetProp : MonoBehaviour | ||
{ | ||
public string key, value; | ||
|
||
public async void OnButtonClick() | ||
{ | ||
await UpdateProp(); | ||
} | ||
|
||
private async Task UpdateProp() | ||
{ | ||
if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(value)) | ||
{ | ||
ResponseMessage.SetText("key or value not set on SetPropButton"); | ||
return; | ||
} | ||
|
||
try | ||
{ | ||
await Talo.CurrentPlayer.SetProp(key, value); | ||
ResponseMessage.SetText($"{key} set to {value}"); | ||
} | ||
catch (System.Exception err) | ||
{ | ||
ResponseMessage.SetText(err.Message); | ||
throw err; | ||
} | ||
} | ||
} |
File renamed without changes.
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