-
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.
- Loading branch information
Showing
17 changed files
with
235 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"visualstudiotoolsforunity.vstuc" | ||
] | ||
} |
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,10 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Attach to Unity", | ||
"type": "vstuc", | ||
"request": "attach" | ||
} | ||
] | ||
} |
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,60 @@ | ||
{ | ||
"files.exclude": { | ||
"**/.DS_Store": true, | ||
"**/.git": true, | ||
"**/.vs": true, | ||
"**/.gitmodules": true, | ||
"**/.vsconfig": true, | ||
"**/*.booproj": true, | ||
"**/*.pidb": true, | ||
"**/*.suo": true, | ||
"**/*.user": true, | ||
"**/*.userprefs": true, | ||
"**/*.unityproj": true, | ||
"**/*.dll": true, | ||
"**/*.exe": true, | ||
"**/*.pdf": true, | ||
"**/*.mid": true, | ||
"**/*.midi": true, | ||
"**/*.wav": true, | ||
"**/*.gif": true, | ||
"**/*.ico": true, | ||
"**/*.jpg": true, | ||
"**/*.jpeg": true, | ||
"**/*.png": true, | ||
"**/*.psd": true, | ||
"**/*.tga": true, | ||
"**/*.tif": true, | ||
"**/*.tiff": true, | ||
"**/*.3ds": true, | ||
"**/*.3DS": true, | ||
"**/*.fbx": true, | ||
"**/*.FBX": true, | ||
"**/*.lxo": true, | ||
"**/*.LXO": true, | ||
"**/*.ma": true, | ||
"**/*.MA": true, | ||
"**/*.obj": true, | ||
"**/*.OBJ": true, | ||
"**/*.asset": true, | ||
"**/*.cubemap": true, | ||
"**/*.flare": true, | ||
"**/*.mat": true, | ||
"**/*.meta": true, | ||
"**/*.prefab": true, | ||
"**/*.unity": true, | ||
"build/": true, | ||
"Build/": true, | ||
"Library/": true, | ||
"library/": true, | ||
"obj/": true, | ||
"Obj/": true, | ||
"Logs/": true, | ||
"logs/": true, | ||
"ProjectSettings/": true, | ||
"UserSettings/": true, | ||
"temp/": true, | ||
"Temp/": true | ||
}, | ||
"dotnet.defaultSolution": "stash-unity.sln" | ||
} |
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 was deleted.
Oops, something went wrong.
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
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,57 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using UnityEngine; | ||
using Stash.Core.Exceptions; | ||
using Stash.Models; | ||
using Stash.Scripts.Core; | ||
|
||
namespace Stash.Core | ||
{ | ||
public static class StashLauncher | ||
{ | ||
public static async Task<CheckoutResponse> Checkout(string itemId, | ||
string playerId, | ||
string idToken, | ||
StashEnvironment environment = StashEnvironment.Test) | ||
{ | ||
// Create the authorization header with the access token | ||
RequestHeader authorizationHeader = new() | ||
{ | ||
Key = "Authorization", | ||
Value = "Bearer " + idToken | ||
}; | ||
|
||
var requestBody = new CheckoutBody | ||
{ | ||
item = new CheckoutBody.Item | ||
{ | ||
id = itemId | ||
}, | ||
user = new CheckoutBody.User | ||
{ | ||
id = playerId | ||
} | ||
}; | ||
|
||
string requestUrl = environment.GetRootUrl() + StashConstants.LauncherCheckout; | ||
Response result = await RestClient.Post(requestUrl, JsonUtility.ToJson(requestBody), new List<RequestHeader> { authorizationHeader }); | ||
|
||
if (result.StatusCode == 200) | ||
{ | ||
try | ||
{ | ||
CheckoutResponse resultResponse = JsonUtility.FromJson<CheckoutResponse>(result.Data); | ||
return resultResponse; | ||
} | ||
catch | ||
{ | ||
throw new StashParseError(result.Data); | ||
} | ||
} | ||
|
||
throw new StashRequestError(result.StatusCode, result.Data); | ||
} | ||
|
||
} | ||
} |
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,23 @@ | ||
using System; | ||
|
||
namespace Stash.Models | ||
{ | ||
[Serializable] | ||
public class CheckoutBody | ||
{ | ||
public Item item; | ||
public User user; | ||
|
||
[Serializable] | ||
public class Item | ||
{ | ||
public string id; | ||
} | ||
|
||
[Serializable] | ||
public class User | ||
{ | ||
public string id; | ||
} | ||
} | ||
} |
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,7 @@ | ||
namespace Stash.Models | ||
{ | ||
public class CheckoutResponse | ||
{ | ||
public string url { get; set; } | ||
} | ||
} |
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
Oops, something went wrong.