feat: update graphql

master
tiendat3699 2024-05-22 01:33:09 +07:00
parent f874747384
commit 0f906a09c4
78 changed files with 786 additions and 2593 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 51573433fe833f9498d6fe6a2ab117fb
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 996c64a78f8eb3d4aad0de99fe6607b4 guid: c2740d22f4ae04448a082f5f49761822
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 11400000 mainObjectFileID: 11400000

View File

@ -1,95 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1ccf793b7ca1cc645b9cd36d753b8e3c, type: 3}
m_Name: P4P graph
m_EditorClassIdentifier:
url: https://api.play4promo.online/graphql
queries: []
mutations:
- name: LoginMachine
type: 1
query:
queryString: loginAsGameMachine
returnType: LoginDetails
queryOptions:
- createGame
- createGuest
- mergeGuest
- updateGuestInfo
- loginAsGuest
- upgradeToPlayer
- createPlayer
- loginAsPlayer
- sendOtpToVerify
- verify
- requestResetPassword
- verifyRequestResetPassword
- resetPassword
- refreshToken
- loginAsMaster
- loginAsModerator
- createModerator
- loginAsContentManager
- createContentManager
- loginAsGameManager
- createGameManager
- loginAsGameMachine
- createGameMachine
- loginAsCustomerServiceStaff
- createCustomerServiceStaff
- createExtraPackage
- createSubscriptionPackage
- createBrand
- createPromotion
- setPromotionStringParameter
- setPromotionFileParameter
- setPromotionOfTheWeek
- clearPromotionOfTheWeek
- joinPromotion
- startGameSession
- endGameSession
- submitGameSession
- createExtraPackageTransaction
- createSubscriptionPackageTransaction
- completeTransaction
- approveTransaction
- rejectTransaction
fields:
- index: 0
name: accessToken
type: String
parentIndexes:
hasSubField: 0
possibleFields:
- name: accessToken
type: String
- name: refreshToken
type: String
- name: user
type: User
hasChanged: 0
- index: 1
name: refreshToken
type: String
parentIndexes:
hasSubField: 0
possibleFields:
- name: accessToken
type: String
- name: refreshToken
type: String
- name: user
type: User
hasChanged: 0
isComplete: 0
subscriptions: []
loading: 0

View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.37311918, g: 0.3807398, b: 0.35872716, a: 1} m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -152,9 +152,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0c915a4976334babb372a35c1c2e050c, type: 3} m_Script: {fileID: 11500000, guid: 0c915a4976334babb372a35c1c2e050c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_p4pGraph: {fileID: 11400000, guid: 996c64a78f8eb3d4aad0de99fe6607b4, type: 2} _p4pGraph: {fileID: 11400000, guid: c2740d22f4ae04448a082f5f49761822, type: 2}
_machineMac: D85ED3741515 _machineMac: D85ED3741515
_promotionId: 63c67c5434403000 _promotionId: 63d879e156403000
--- !u!4 &398718624 --- !u!4 &398718624
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -1,6 +1,9 @@
using System.Collections.Generic; using System;
using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
using GadGame.Singleton; using GadGame.Singleton;
using GraphQlClient.Core; using GraphQlClient.Core;
using GraphQlClient.EventCallbacks;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
@ -9,14 +12,11 @@ using UnityEngine.Networking;
namespace GadGame.Network namespace GadGame.Network
{ {
public struct CreateQueryOptions
class DataReceive
{ {
public string Name; public JObject[] errors = null;
public GraphApi.Query.Type QueryType; public JObject data = null;
public string Root;
public string ReturnType;
public string Projection;
public object QueryArgs;
} }
public class P4PGraphqlManager : PersistentSingleton<P4PGraphqlManager> public class P4PGraphqlManager : PersistentSingleton<P4PGraphqlManager>
@ -25,41 +25,46 @@ namespace GadGame.Network
[SerializeField] private string _machineMac; [SerializeField] private string _machineMac;
[SerializeField] private string _promotionId; [SerializeField] private string _promotionId;
[ShowInInspector] private string _userID; private DateTime _startTime;
[ShowInInspector, HideInEditorMode] private string _userId;
protected override void Awake() public Action<OnSubscriptionDataReceived> OnGuestUpdatedSubscription;
protected override async void Awake()
{ {
base.Awake(); base.Awake();
LoginMachine(); await LoginMachine();
// CreateGuest(); await CreateGuest();
await JoinPromotion();
await UniTask.Delay(5000);
await SubmitGameSession(1000);
GetQrLink();
} }
private GraphApi.Query CreateQuery(CreateQueryOptions options) private void OnEnable()
{ {
GraphApi.Query query = new GraphApi.Query OnSubscriptionDataReceived.RegisterListener(OnGuestUpdated);
{
fields = new List<GraphApi.Field>(),
isComplete = false,
name = options.Name,
query = options.Projection
.Replace(System.Environment.NewLine, "\n"),
queryOptions = new List<string>(),
queryString = options.Root,
returnType = options.ReturnType,
type = options.QueryType
};
if (options.QueryArgs != null)
{
query.SetArgs(options.QueryArgs);
}
return query;
} }
private async void LoginMachine() private void OnDisable()
{ {
GraphApi.Query query = _p4pGraph.GetQueryByName("LoginMachine", GraphApi.Query.Type.Mutation); OnSubscriptionDataReceived.UnregisterListener(OnGuestUpdated);
}
private void OnGuestUpdated(OnSubscriptionDataReceived dataReceived)
{
OnGuestUpdatedSubscription?.Invoke(dataReceived);
}
private DataReceive GetData(string data)
{
var json = HttpHandler.FormatJson(data);
return JsonConvert.DeserializeObject<DataReceive>(json);
}
private async Task<bool> LoginMachine()
{
var query = _p4pGraph.GetQueryByName("LoginAsGameMachine", GraphApi.Query.Type.Mutation);
query.SetArgs(new query.SetArgs(new
{ {
input = new input = new
@ -68,13 +73,23 @@ namespace GadGame.Network
password = "Abc@123" password = "Abc@123"
} }
}); });
UnityWebRequest request = await _p4pGraph.Post(query); var request = await _p4pGraph.Post(query);
Debug.Log("LoginAsGameMachine " + request.result);
if (request.result == UnityWebRequest.Result.Success)
{
var receive = GetData(request.downloadHandler.text);
if (receive.errors != null)
{
return true;
}
}
return false;
} }
public async void CreateGuest() public async Task<bool> CreateGuest()
{ {
GraphApi.Query query = _p4pGraph.GetQueryByName("CreateGuest", GraphApi.Query.Type.Mutation); var query = _p4pGraph.GetQueryByName("CreateGuest", GraphApi.Query.Type.Mutation);
query.SetArgs(new query.SetArgs(new
{ {
input = new input = new
@ -82,16 +97,26 @@ namespace GadGame.Network
password = "Abc@123" password = "Abc@123"
} }
}); });
UnityWebRequest request = await _p4pGraph.Post(query); var request = await _p4pGraph.Post(query);
Debug.Log("login machine " + request.result); Debug.Log("CreateGuest " + request.result);
string json = HttpHandler.FormatJson(request.downloadHandler.text); if (request.result == UnityWebRequest.Result.Success)
JObject obj = JObject.Parse(json); {
Debug.Log(obj["data"]); var receive = GetData(request.downloadHandler.text);
if (receive.data != null)
{
var guest = receive.data["createGuest"];
_p4pGraph.SetAuthToken(guest?["accessToken"]?.ToString());
_userId = guest?["user"]?["id"]?.ToString();
return true;
}
}
return false;
} }
public async void JoinPromotion() public async Task<bool> JoinPromotion()
{ {
GraphApi.Query query = _p4pGraph.GetQueryByName("JoinPromotion", GraphApi.Query.Type.Mutation); var query = _p4pGraph.GetQueryByName("JoinPromotion", GraphApi.Query.Type.Mutation);
query.SetArgs(new query.SetArgs(new
{ {
input = new input = new
@ -99,29 +124,66 @@ namespace GadGame.Network
promotionId = _promotionId promotionId = _promotionId
} }
}); });
UnityWebRequest request = await _p4pGraph.Post(query); var request = await _p4pGraph.Post(query);
GetData(request.downloadHandler.text); Debug.Log("JoinPromotion " + request.result);
if (request.result == UnityWebRequest.Result.Success)
{
var receive = GetData(request.downloadHandler.text);
if (receive.errors == null)
{
_startTime = DateTime.Now;
return true;
}
}
return false;
} }
public async void SubmitGameSession() public async Task<bool> SubmitGameSession(int gameScore)
{ {
GraphApi.Query query = _p4pGraph.GetQueryByName("SubmitGameSession", GraphApi.Query.Type.Mutation); var endTime = DateTime.Now.AddSeconds(-1);
var query = _p4pGraph.GetQueryByName("SubmitGameSession", GraphApi.Query.Type.Mutation);
query.SetArgs(new query.SetArgs(new
{ {
input = new input = new
{ {
playerID = _userID, playerId = _userId,
promotionId = _promotionId promotionId = _promotionId,
startAt = _startTime,
endAt = endTime,
score = gameScore,
} }
}); });
UnityWebRequest request = await _p4pGraph.Post(query); var request = await _p4pGraph.Post(query);
GetData(request.downloadHandler.text); Debug.Log("Submit Game Session " + request.result);
if (request.result == UnityWebRequest.Result.Success)
{
var receive = GetData(request.downloadHandler.text);
if (receive.errors == null)
{
return true;
}
}
return false;
} }
private void GetData(string data) public async void GetQrLink()
{ {
string json = HttpHandler.FormatJson(data); await GuestUpdatedSubscription();
Debug.Log(JsonConvert.DeserializeObject(json)); }
private async Task GuestUpdatedSubscription()
{
var query = _p4pGraph.GetQueryByName("GuestUpdatedSubscription", GraphApi.Query.Type.Subscription);
query.SetArgs(new
{
input = new
{
guestId = _userId,
}
});
await _p4pGraph.Subscribe(query);
} }
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 1489c2fd3fb39d5428ad3c0b8479dd29
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3956940cbcabd1a4aab80071f5e569a2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 46d891d9b63592344ae73ff9c4cedbf1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 20766c9394fe27140b3389473dccd660
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: bc264b4d34aebb045b2fb00cce833d49
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 8f2198707218a564da2a9827a697cc2a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 911 B

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 850f19a5487609c4dbed7ca6131d9879
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,186 +0,0 @@
<!DOCTYPE html>
<!-- saved from url=(0070)chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/cmdline_frame.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/cmdline_frame.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/cvimrc_parser.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/session.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/utils.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/dom.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/hints.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/bookmarks.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/keys.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/clipboard.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/complete.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/mappings.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/find.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/cursor.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/status.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/hud.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/visual.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/command.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/scroll.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/search.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/frames.js"></script>
<script src="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/messenger.js"></script>
<link rel="stylesheet" href="chrome-extension://ihlenndgcmojhcghmfjfneahoeklbjjh/content_scripts/main.css">
<style>#cVim-command-bar, #cVim-command-bar-mode, #cVim-command-bar-input, #cVim-command-bar-search-results,
.cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left,
.cVim-completion-item .cVim-right {
font-family: Helvetica, Helvetica Neue, Neue, sans-serif, monospace, Arial;
font-size: 10pt !important;
-webkit-font-smoothing: antialiased !important;
}
#cVim-command-bar {
position: fixed;
z-index: 2147483646;
background-color: #1b1d1e;
color: #bbb;
display: none;
box-sizing: content-box;
box-shadow: 0 3px 3px rgba(0,0,0,0.4);
left: 0;
width: 100%;
height: 20px;
}
#cVim-command-bar-mode {
display: inline-block;
vertical-align: middle;
box-sizing: border-box;
padding-left: 2px;
height: 100%;
width: 10px;
padding-top: 2px;
color: #888;
}
#cVim-command-bar-input {
background-color: #1b1d1e;
color: #bbb;
height: 100%;
right: 0;
top: 0;
width: calc(100% - 10px);
position: absolute;
}
#cVim-command-bar-search-results {
position: fixed;
width: 100%;
overflow: hidden;
z-index: 2147483647;
left: 0;
box-shadow: 0 3px 3px rgba(0,0,0,0.4);
background-color: #1c1c1c;
}
.cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left, .cVim-completion-item .cVim-right {
text-overflow: ellipsis;
padding: 1px;
display: inline-block;
box-sizing: border-box;
vertical-align: middle;
overflow: hidden;
white-space: nowrap;
}
.cVim-completion-item:nth-child(even) {
background-color: #1f1f1f;
}
.cVim-completion-item {
width: 100%; left: 0;
color: #bcbcbc;
}
.cVim-completion-item[active] {
width: 100%; left: 0;
color: #1b1d1e;
background-color: #f1f1f1;
}
.cVim-completion-item[active] span {
color: #1b1d1e;
}
.cVim-completion-item .cVim-left {
color: #fff;
width: 37%;
}
.cVim-completion-item .cVim-right {
font-style: italic;
color: #888;
width: 57%;
}
#cVim-link-container, .cVim-link-hint,
#cVim-hud, #cVim-status-bar {
font-family: Helvetica, Helvetica Neue, Neue, sans-serif, monospace, Arial;
font-size: 10pt !important;
-webkit-font-smoothing: antialiased !important;
}
#cVim-link-container {
position: absolute;
pointer-events: none;
width: 100%; left: 0;
height: 100%; top: 0;
z-index: 2147483647;
}
.cVim-link-hint {
position: absolute;
color: #302505 !important;
background-color: #ffd76e !important;
border-radius: 2px !important;
padding: 2px !important;
font-size: 8pt !important;
font-weight: 500 !important;
text-transform: uppercase !important;
border: 1px solid #ad810c;
display: inline-block !important;
vertical-align: middle !important;
text-align: center !important;
box-shadow: 2px 2px 1px rgba(0,0,0,0.25) !important;
}
.cVim-link-hint_match {
color: #777;
text-transform: uppercase !important;
}
#cVim-hud {
background-color: rgba(28,28,28,0.9);
position: fixed !important;
transition: right 0.2s ease-out;
z-index: 24724289;
}
#cVim-hud span {
padding: 2px;
padding-left: 4px;
padding-right: 4px;
color: #8f8f8f;
font-size: 10pt;
}
#cVim-frames-outline {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
right: 0;
z-index: 9999999999;
box-sizing: border-box;
border: 3px solid yellow;
}
</style></head>
<body>
</body><div id="cVim-status-bar" style="bottom: 0px;"></div><div id="cVim-command-bar" spellcheck="false" style="bottom: 0px;"><span id="cVim-command-bar-mode"></span><input type="text" id="cVim-command-bar-input"></div><div id="cVim-command-bar-search-results" style="bottom: 20px;"></div></html>

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 49ce8a667f92d7345b797e0c8bf12689
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1 +0,0 @@
var addComment={moveForm:function(a,b,c,d){var e,f,g,h,i=this,j=i.I(a),k=i.I(c),l=i.I("cancel-comment-reply-link"),m=i.I("comment_parent"),n=i.I("comment_post_ID"),o=k.getElementsByTagName("form")[0];if(j&&k&&l&&m&&o){i.respondId=c,d=d||!1,i.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",k.parentNode.insertBefore(e,k)),j.parentNode.insertBefore(k,j.nextSibling),n&&d&&(n.value=d),m.value=b,l.style.display="",l.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{for(var p=0;p<o.elements.length;p++)if(f=o.elements[p],h=!1,"getComputedStyle"in window?g=window.getComputedStyle(f):document.documentElement.currentStyle&&(g=f.currentStyle),(f.offsetWidth<=0&&f.offsetHeight<=0||"hidden"===g.visibility)&&(h=!0),"hidden"!==f.type&&!f.disabled&&!h){f.focus();break}}catch(q){}return!1}},I:function(a){return document.getElementById(a)}};

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 15092c2a8d531934783c3262751ecde4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: a36d3fd7af8651e469d6b5a4bba54ad4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,403 +0,0 @@
@font-face{font-family:'FontAwesome';src:url('../font/fontawesome-webfont.eot?v=3.2.1');src:url('../font/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'),url('../font/fontawesome-webfont.woff?v=3.2.1') format('woff'),url('../font/fontawesome-webfont.ttf?v=3.2.1') format('truetype'),url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;}
[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;}
.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;}
a [class^="icon-"],a [class*=" icon-"]{display:inline;}
[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:0.2857142857142857em;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em;}
.icons-ul{margin-left:2.142857142857143em;list-style-type:none;}.icons-ul>li{position:relative;}
.icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit;}
[class^="icon-"].hide,[class*=" icon-"].hide{display:none;}
.icon-muted{color:#eeeeee;}
.icon-light{color:#ffffff;}
.icon-dark{color:#333333;}
.icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
.icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
.icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
.icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
.icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;}
.pull-right{float:right;}
.pull-left{float:left;}
[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;}
[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;}
[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;}
.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;}
.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;}
.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;}
.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;}
.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;}
.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;}
.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;}
.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;}
.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;}
.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;}
.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{line-height:inherit;}
.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;}
.icon-stack .icon-stack-base{font-size:2em;*line-height:1em;}
.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;}
a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none;}
@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);}
.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);}
.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);}
.icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);}
.icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);}
a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block;}
.icon-glass:before{content:"\f000";}
.icon-music:before{content:"\f001";}
.icon-search:before{content:"\f002";}
.icon-envelope-alt:before{content:"\f003";}
.icon-heart:before{content:"\f004";}
.icon-star:before{content:"\f005";}
.icon-star-empty:before{content:"\f006";}
.icon-user:before{content:"\f007";}
.icon-film:before{content:"\f008";}
.icon-th-large:before{content:"\f009";}
.icon-th:before{content:"\f00a";}
.icon-th-list:before{content:"\f00b";}
.icon-ok:before{content:"\f00c";}
.icon-remove:before{content:"\f00d";}
.icon-zoom-in:before{content:"\f00e";}
.icon-zoom-out:before{content:"\f010";}
.icon-power-off:before,.icon-off:before{content:"\f011";}
.icon-signal:before{content:"\f012";}
.icon-gear:before,.icon-cog:before{content:"\f013";}
.icon-trash:before{content:"\f014";}
.icon-home:before{content:"\f015";}
.icon-file-alt:before{content:"\f016";}
.icon-time:before{content:"\f017";}
.icon-road:before{content:"\f018";}
.icon-download-alt:before{content:"\f019";}
.icon-download:before{content:"\f01a";}
.icon-upload:before{content:"\f01b";}
.icon-inbox:before{content:"\f01c";}
.icon-play-circle:before{content:"\f01d";}
.icon-rotate-right:before,.icon-repeat:before{content:"\f01e";}
.icon-refresh:before{content:"\f021";}
.icon-list-alt:before{content:"\f022";}
.icon-lock:before{content:"\f023";}
.icon-flag:before{content:"\f024";}
.icon-headphones:before{content:"\f025";}
.icon-volume-off:before{content:"\f026";}
.icon-volume-down:before{content:"\f027";}
.icon-volume-up:before{content:"\f028";}
.icon-qrcode:before{content:"\f029";}
.icon-barcode:before{content:"\f02a";}
.icon-tag:before{content:"\f02b";}
.icon-tags:before{content:"\f02c";}
.icon-book:before{content:"\f02d";}
.icon-bookmark:before{content:"\f02e";}
.icon-print:before{content:"\f02f";}
.icon-camera:before{content:"\f030";}
.icon-font:before{content:"\f031";}
.icon-bold:before{content:"\f032";}
.icon-italic:before{content:"\f033";}
.icon-text-height:before{content:"\f034";}
.icon-text-width:before{content:"\f035";}
.icon-align-left:before{content:"\f036";}
.icon-align-center:before{content:"\f037";}
.icon-align-right:before{content:"\f038";}
.icon-align-justify:before{content:"\f039";}
.icon-list:before{content:"\f03a";}
.icon-indent-left:before{content:"\f03b";}
.icon-indent-right:before{content:"\f03c";}
.icon-facetime-video:before{content:"\f03d";}
.icon-picture:before{content:"\f03e";}
.icon-pencil:before{content:"\f040";}
.icon-map-marker:before{content:"\f041";}
.icon-adjust:before{content:"\f042";}
.icon-tint:before{content:"\f043";}
.icon-edit:before{content:"\f044";}
.icon-share:before{content:"\f045";}
.icon-check:before{content:"\f046";}
.icon-move:before{content:"\f047";}
.icon-step-backward:before{content:"\f048";}
.icon-fast-backward:before{content:"\f049";}
.icon-backward:before{content:"\f04a";}
.icon-play:before{content:"\f04b";}
.icon-pause:before{content:"\f04c";}
.icon-stop:before{content:"\f04d";}
.icon-forward:before{content:"\f04e";}
.icon-fast-forward:before{content:"\f050";}
.icon-step-forward:before{content:"\f051";}
.icon-eject:before{content:"\f052";}
.icon-chevron-left:before{content:"\f053";}
.icon-chevron-right:before{content:"\f054";}
.icon-plus-sign:before{content:"\f055";}
.icon-minus-sign:before{content:"\f056";}
.icon-remove-sign:before{content:"\f057";}
.icon-ok-sign:before{content:"\f058";}
.icon-question-sign:before{content:"\f059";}
.icon-info-sign:before{content:"\f05a";}
.icon-screenshot:before{content:"\f05b";}
.icon-remove-circle:before{content:"\f05c";}
.icon-ok-circle:before{content:"\f05d";}
.icon-ban-circle:before{content:"\f05e";}
.icon-arrow-left:before{content:"\f060";}
.icon-arrow-right:before{content:"\f061";}
.icon-arrow-up:before{content:"\f062";}
.icon-arrow-down:before{content:"\f063";}
.icon-mail-forward:before,.icon-share-alt:before{content:"\f064";}
.icon-resize-full:before{content:"\f065";}
.icon-resize-small:before{content:"\f066";}
.icon-plus:before{content:"\f067";}
.icon-minus:before{content:"\f068";}
.icon-asterisk:before{content:"\f069";}
.icon-exclamation-sign:before{content:"\f06a";}
.icon-gift:before{content:"\f06b";}
.icon-leaf:before{content:"\f06c";}
.icon-fire:before{content:"\f06d";}
.icon-eye-open:before{content:"\f06e";}
.icon-eye-close:before{content:"\f070";}
.icon-warning-sign:before{content:"\f071";}
.icon-plane:before{content:"\f072";}
.icon-calendar:before{content:"\f073";}
.icon-random:before{content:"\f074";}
.icon-comment:before{content:"\f075";}
.icon-magnet:before{content:"\f076";}
.icon-chevron-up:before{content:"\f077";}
.icon-chevron-down:before{content:"\f078";}
.icon-retweet:before{content:"\f079";}
.icon-shopping-cart:before{content:"\f07a";}
.icon-folder-close:before{content:"\f07b";}
.icon-folder-open:before{content:"\f07c";}
.icon-resize-vertical:before{content:"\f07d";}
.icon-resize-horizontal:before{content:"\f07e";}
.icon-bar-chart:before{content:"\f080";}
.icon-twitter-sign:before{content:"\f081";}
.icon-facebook-sign:before{content:"\f082";}
.icon-camera-retro:before{content:"\f083";}
.icon-key:before{content:"\f084";}
.icon-gears:before,.icon-cogs:before{content:"\f085";}
.icon-comments:before{content:"\f086";}
.icon-thumbs-up-alt:before{content:"\f087";}
.icon-thumbs-down-alt:before{content:"\f088";}
.icon-star-half:before{content:"\f089";}
.icon-heart-empty:before{content:"\f08a";}
.icon-signout:before{content:"\f08b";}
.icon-linkedin-sign:before{content:"\f08c";}
.icon-pushpin:before{content:"\f08d";}
.icon-external-link:before{content:"\f08e";}
.icon-signin:before{content:"\f090";}
.icon-trophy:before{content:"\f091";}
.icon-github-sign:before{content:"\f092";}
.icon-upload-alt:before{content:"\f093";}
.icon-lemon:before{content:"\f094";}
.icon-phone:before{content:"\f095";}
.icon-unchecked:before,.icon-check-empty:before{content:"\f096";}
.icon-bookmark-empty:before{content:"\f097";}
.icon-phone-sign:before{content:"\f098";}
.icon-twitter:before{content:"\f099";}
.icon-facebook:before{content:"\f09a";}
.icon-github:before{content:"\f09b";}
.icon-unlock:before{content:"\f09c";}
.icon-credit-card:before{content:"\f09d";}
.icon-rss:before{content:"\f09e";}
.icon-hdd:before{content:"\f0a0";}
.icon-bullhorn:before{content:"\f0a1";}
.icon-bell:before{content:"\f0a2";}
.icon-certificate:before{content:"\f0a3";}
.icon-hand-right:before{content:"\f0a4";}
.icon-hand-left:before{content:"\f0a5";}
.icon-hand-up:before{content:"\f0a6";}
.icon-hand-down:before{content:"\f0a7";}
.icon-circle-arrow-left:before{content:"\f0a8";}
.icon-circle-arrow-right:before{content:"\f0a9";}
.icon-circle-arrow-up:before{content:"\f0aa";}
.icon-circle-arrow-down:before{content:"\f0ab";}
.icon-globe:before{content:"\f0ac";}
.icon-wrench:before{content:"\f0ad";}
.icon-tasks:before{content:"\f0ae";}
.icon-filter:before{content:"\f0b0";}
.icon-briefcase:before{content:"\f0b1";}
.icon-fullscreen:before{content:"\f0b2";}
.icon-group:before{content:"\f0c0";}
.icon-link:before{content:"\f0c1";}
.icon-cloud:before{content:"\f0c2";}
.icon-beaker:before{content:"\f0c3";}
.icon-cut:before{content:"\f0c4";}
.icon-copy:before{content:"\f0c5";}
.icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6";}
.icon-save:before{content:"\f0c7";}
.icon-sign-blank:before{content:"\f0c8";}
.icon-reorder:before{content:"\f0c9";}
.icon-list-ul:before{content:"\f0ca";}
.icon-list-ol:before{content:"\f0cb";}
.icon-strikethrough:before{content:"\f0cc";}
.icon-underline:before{content:"\f0cd";}
.icon-table:before{content:"\f0ce";}
.icon-magic:before{content:"\f0d0";}
.icon-truck:before{content:"\f0d1";}
.icon-pinterest:before{content:"\f0d2";}
.icon-pinterest-sign:before{content:"\f0d3";}
.icon-google-plus-sign:before{content:"\f0d4";}
.icon-google-plus:before{content:"\f0d5";}
.icon-money:before{content:"\f0d6";}
.icon-caret-down:before{content:"\f0d7";}
.icon-caret-up:before{content:"\f0d8";}
.icon-caret-left:before{content:"\f0d9";}
.icon-caret-right:before{content:"\f0da";}
.icon-columns:before{content:"\f0db";}
.icon-sort:before{content:"\f0dc";}
.icon-sort-down:before{content:"\f0dd";}
.icon-sort-up:before{content:"\f0de";}
.icon-envelope:before{content:"\f0e0";}
.icon-linkedin:before{content:"\f0e1";}
.icon-rotate-left:before,.icon-undo:before{content:"\f0e2";}
.icon-legal:before{content:"\f0e3";}
.icon-dashboard:before{content:"\f0e4";}
.icon-comment-alt:before{content:"\f0e5";}
.icon-comments-alt:before{content:"\f0e6";}
.icon-bolt:before{content:"\f0e7";}
.icon-sitemap:before{content:"\f0e8";}
.icon-umbrella:before{content:"\f0e9";}
.icon-paste:before{content:"\f0ea";}
.icon-lightbulb:before{content:"\f0eb";}
.icon-exchange:before{content:"\f0ec";}
.icon-cloud-download:before{content:"\f0ed";}
.icon-cloud-upload:before{content:"\f0ee";}
.icon-user-md:before{content:"\f0f0";}
.icon-stethoscope:before{content:"\f0f1";}
.icon-suitcase:before{content:"\f0f2";}
.icon-bell-alt:before{content:"\f0f3";}
.icon-coffee:before{content:"\f0f4";}
.icon-food:before{content:"\f0f5";}
.icon-file-text-alt:before{content:"\f0f6";}
.icon-building:before{content:"\f0f7";}
.icon-hospital:before{content:"\f0f8";}
.icon-ambulance:before{content:"\f0f9";}
.icon-medkit:before{content:"\f0fa";}
.icon-fighter-jet:before{content:"\f0fb";}
.icon-beer:before{content:"\f0fc";}
.icon-h-sign:before{content:"\f0fd";}
.icon-plus-sign-alt:before{content:"\f0fe";}
.icon-double-angle-left:before{content:"\f100";}
.icon-double-angle-right:before{content:"\f101";}
.icon-double-angle-up:before{content:"\f102";}
.icon-double-angle-down:before{content:"\f103";}
.icon-angle-left:before{content:"\f104";}
.icon-angle-right:before{content:"\f105";}
.icon-angle-up:before{content:"\f106";}
.icon-angle-down:before{content:"\f107";}
.icon-desktop:before{content:"\f108";}
.icon-laptop:before{content:"\f109";}
.icon-tablet:before{content:"\f10a";}
.icon-mobile-phone:before{content:"\f10b";}
.icon-circle-blank:before{content:"\f10c";}
.icon-quote-left:before{content:"\f10d";}
.icon-quote-right:before{content:"\f10e";}
.icon-spinner:before{content:"\f110";}
.icon-circle:before{content:"\f111";}
.icon-mail-reply:before,.icon-reply:before{content:"\f112";}
.icon-github-alt:before{content:"\f113";}
.icon-folder-close-alt:before{content:"\f114";}
.icon-folder-open-alt:before{content:"\f115";}
.icon-expand-alt:before{content:"\f116";}
.icon-collapse-alt:before{content:"\f117";}
.icon-smile:before{content:"\f118";}
.icon-frown:before{content:"\f119";}
.icon-meh:before{content:"\f11a";}
.icon-gamepad:before{content:"\f11b";}
.icon-keyboard:before{content:"\f11c";}
.icon-flag-alt:before{content:"\f11d";}
.icon-flag-checkered:before{content:"\f11e";}
.icon-terminal:before{content:"\f120";}
.icon-code:before{content:"\f121";}
.icon-reply-all:before{content:"\f122";}
.icon-mail-reply-all:before{content:"\f122";}
.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";}
.icon-location-arrow:before{content:"\f124";}
.icon-crop:before{content:"\f125";}
.icon-code-fork:before{content:"\f126";}
.icon-unlink:before{content:"\f127";}
.icon-question:before{content:"\f128";}
.icon-info:before{content:"\f129";}
.icon-exclamation:before{content:"\f12a";}
.icon-superscript:before{content:"\f12b";}
.icon-subscript:before{content:"\f12c";}
.icon-eraser:before{content:"\f12d";}
.icon-puzzle-piece:before{content:"\f12e";}
.icon-microphone:before{content:"\f130";}
.icon-microphone-off:before{content:"\f131";}
.icon-shield:before{content:"\f132";}
.icon-calendar-empty:before{content:"\f133";}
.icon-fire-extinguisher:before{content:"\f134";}
.icon-rocket:before{content:"\f135";}
.icon-maxcdn:before{content:"\f136";}
.icon-chevron-sign-left:before{content:"\f137";}
.icon-chevron-sign-right:before{content:"\f138";}
.icon-chevron-sign-up:before{content:"\f139";}
.icon-chevron-sign-down:before{content:"\f13a";}
.icon-html5:before{content:"\f13b";}
.icon-css3:before{content:"\f13c";}
.icon-anchor:before{content:"\f13d";}
.icon-unlock-alt:before{content:"\f13e";}
.icon-bullseye:before{content:"\f140";}
.icon-ellipsis-horizontal:before{content:"\f141";}
.icon-ellipsis-vertical:before{content:"\f142";}
.icon-rss-sign:before{content:"\f143";}
.icon-play-sign:before{content:"\f144";}
.icon-ticket:before{content:"\f145";}
.icon-minus-sign-alt:before{content:"\f146";}
.icon-check-minus:before{content:"\f147";}
.icon-level-up:before{content:"\f148";}
.icon-level-down:before{content:"\f149";}
.icon-check-sign:before{content:"\f14a";}
.icon-edit-sign:before{content:"\f14b";}
.icon-external-link-sign:before{content:"\f14c";}
.icon-share-sign:before{content:"\f14d";}
.icon-compass:before{content:"\f14e";}
.icon-collapse:before{content:"\f150";}
.icon-collapse-top:before{content:"\f151";}
.icon-expand:before{content:"\f152";}
.icon-euro:before,.icon-eur:before{content:"\f153";}
.icon-gbp:before{content:"\f154";}
.icon-dollar:before,.icon-usd:before{content:"\f155";}
.icon-rupee:before,.icon-inr:before{content:"\f156";}
.icon-yen:before,.icon-jpy:before{content:"\f157";}
.icon-renminbi:before,.icon-cny:before{content:"\f158";}
.icon-won:before,.icon-krw:before{content:"\f159";}
.icon-bitcoin:before,.icon-btc:before{content:"\f15a";}
.icon-file:before{content:"\f15b";}
.icon-file-text:before{content:"\f15c";}
.icon-sort-by-alphabet:before{content:"\f15d";}
.icon-sort-by-alphabet-alt:before{content:"\f15e";}
.icon-sort-by-attributes:before{content:"\f160";}
.icon-sort-by-attributes-alt:before{content:"\f161";}
.icon-sort-by-order:before{content:"\f162";}
.icon-sort-by-order-alt:before{content:"\f163";}
.icon-thumbs-up:before{content:"\f164";}
.icon-thumbs-down:before{content:"\f165";}
.icon-youtube-sign:before{content:"\f166";}
.icon-youtube:before{content:"\f167";}
.icon-xing:before{content:"\f168";}
.icon-xing-sign:before{content:"\f169";}
.icon-youtube-play:before{content:"\f16a";}
.icon-dropbox:before{content:"\f16b";}
.icon-stackexchange:before{content:"\f16c";}
.icon-instagram:before{content:"\f16d";}
.icon-flickr:before{content:"\f16e";}
.icon-adn:before{content:"\f170";}
.icon-bitbucket:before{content:"\f171";}
.icon-bitbucket-sign:before{content:"\f172";}
.icon-tumblr:before{content:"\f173";}
.icon-tumblr-sign:before{content:"\f174";}
.icon-long-arrow-down:before{content:"\f175";}
.icon-long-arrow-up:before{content:"\f176";}
.icon-long-arrow-left:before{content:"\f177";}
.icon-long-arrow-right:before{content:"\f178";}
.icon-apple:before{content:"\f179";}
.icon-windows:before{content:"\f17a";}
.icon-android:before{content:"\f17b";}
.icon-linux:before{content:"\f17c";}
.icon-dribbble:before{content:"\f17d";}
.icon-skype:before{content:"\f17e";}
.icon-foursquare:before{content:"\f180";}
.icon-trello:before{content:"\f181";}
.icon-female:before{content:"\f182";}
.icon-male:before{content:"\f183";}
.icon-gittip:before{content:"\f184";}
.icon-sun:before{content:"\f185";}
.icon-moon:before{content:"\f186";}
.icon-archive:before{content:"\f187";}
.icon-bug:before{content:"\f188";}
.icon-vk:before{content:"\f189";}
.icon-weibo:before{content:"\f18a";}
.icon-renren:before{content:"\f18b";}

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 3019c1c6b72e41847899e2ac02471923
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: b1985c3a9f17306419ee984450d97ffa
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 0f0e2a59e00d25446aa594df76a5dced
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 54d153b1a1ded8242885ba82c00e583c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,65 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (Wed, 16 Apr 2014 03:56:09 GMT)
*
* @copyright
* Copyright (C) 2004-2013 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
function Brush()
{
var keywords = 'abstract as async await base bool break byte case catch char checked class const ' +
'continue decimal default delegate do double else enum event explicit volatile ' +
'extern false finally fixed float for foreach get goto if implicit in int ' +
'interface internal is lock long namespace new null object operator out ' +
'override params private protected public readonly ref return sbyte sealed set ' +
'short sizeof stackalloc static string struct switch this throw true try ' +
'typeof uint ulong unchecked unsafe ushort using virtual void while var ' +
'from group by into select let where orderby join on equals ascending descending';
function fixComments(match, regexInfo)
{
var css = (match[0].indexOf("///") == 0)
? 'color1'
: 'comments'
;
return [new SyntaxHighlighter.Match(match[0], match.index, css)];
}
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
{ regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
{ regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['c#', 'c-sharp', 'csharp'];
SyntaxHighlighter.brushes.CSharp = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 3a3eba33a609b9444b5d4cf94850b596
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,237 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: Monaco, "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
/*min-height: inherit !important; */
/*min-height: auto !important;*/
direction: ltr !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
-ms-box-shadow: none !important;
-o-box-shadow: none !important;
box-shadow: none !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
overflow-y: hidden !important;
font-size: 1em !important;
}
.syntaxhighlighter code {
display: inline !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
table-layout: auto !important;
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 0 0.5em 0 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 0 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 4141587b0e66e4e4dbfff848df4ddee7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 1a997a3755a0b4c48bb3457eec44cf43
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,117 +0,0 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: white !important;
}
.syntaxhighlighter .line.alt1 {
background-color: white !important;
}
.syntaxhighlighter .line.alt2 {
background-color: white !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #e0e0e0 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: black !important;
}
.syntaxhighlighter table caption {
color: black !important;
}
.syntaxhighlighter .gutter {
color: #afafaf !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #6ce26c !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #6ce26c !important;
color: white !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: blue !important;
background: white !important;
border: 1px solid #6ce26c !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: blue !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: red !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #6ce26c !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: black !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: black !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #008200 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: blue !important;
}
.syntaxhighlighter .keyword {
color: #006699 !important;
}
.syntaxhighlighter .preprocessor {
color: gray !important;
}
.syntaxhighlighter .variable {
color: #aa7700 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ff1493 !important;
}
.syntaxhighlighter .constants {
color: #0066cc !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #006699 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: gray !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: red !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 77d7d86f0c0780d4bb40705b0ab6fcc6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 601023394f5f81c48b6ee8a7f63522cf
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1 +0,0 @@
!function(){function a(){for(var a=this;-1===a.className.indexOf("nav-menu");)"li"===a.tagName.toLowerCase()&&(-1!==a.className.indexOf("focus")?a.className=a.className.replace(" focus",""):a.className+=" focus"),a=a.parentElement}var b,c,d,e,f,g,h;if(b=document.getElementById("site-navigation"),b&&(c=b.getElementsByTagName("button")[0],"undefined"!=typeof c)){if(d=b.getElementsByTagName("ul")[0],"undefined"==typeof d)return void(c.style.display="none");for(d.setAttribute("aria-expanded","false"),-1===d.className.indexOf("nav-menu")&&(d.className+=" nav-menu"),c.onclick=function(){-1!==b.className.indexOf("toggled")?(b.className=b.className.replace(" toggled",""),c.setAttribute("aria-expanded","false"),d.setAttribute("aria-expanded","false")):(b.className+=" toggled",c.setAttribute("aria-expanded","true"),d.setAttribute("aria-expanded","true"))},e=d.getElementsByTagName("a"),f=d.getElementsByTagName("ul"),g=0,h=f.length;g<h;g++)f[g].parentNode.setAttribute("aria-haspopup","true");for(g=0,h=e.length;g<h;g++)e[g].addEventListener("focus",a,!0),e[g].addEventListener("blur",a,!0);!function(a){var b,c,d=a.querySelectorAll(".menu-item-has-children > a, .page_item_has_children > a");if("ontouchstart"in window)for(b=function(a){var b,c=this.parentNode;if(c.classList.contains("focus"))c.classList.remove("focus");else{for(a.preventDefault(),b=0;b<c.parentNode.children.length;++b)c!==c.parentNode.children[b]&&c.parentNode.children[b].classList.remove("focus");c.classList.add("focus")}},c=0;c<d.length;++c)d[c].addEventListener("touchstart",b,!1)}(b)}}(),function(){var a=/(trident|msie)/i.test(navigator.userAgent);a&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var a,b=location.hash.substring(1);/^[A-z0-9_-]+$/.test(b)&&(a=document.getElementById(b),a&&(/^(?:a|select|input|button|textarea)$/i.test(a.tagName)||(a.tabIndex=-1),a.focus()))},!1)}();

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: b8e426e734f526a4984d0bd9a58066bc
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1 +0,0 @@
!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c<i.length;c++){if(d=i[c],!d.getAttribute("data-secret"))f=Math.random().toString(36).substr(2,10),d.src+="#?secret="+f,d.setAttribute("data-secret",f);if(g||h)a=d.cloneNode(!0),a.removeAttribute("security"),d.parentNode.replaceChild(a,d)}}}var d=!1,e=!1;if(b.querySelector)if(a.addEventListener)d=!0;if(a.wp=a.wp||{},!a.wp.receiveEmbedMessage)if(a.wp.receiveEmbedMessage=function(c){var d=c.data;if(d.secret||d.message||d.value)if(!/[^a-zA-Z0-9]/.test(d.secret)){var e,f,g,h,i,j=b.querySelectorAll('iframe[data-secret="'+d.secret+'"]'),k=b.querySelectorAll('blockquote[data-secret="'+d.secret+'"]');for(e=0;e<k.length;e++)k[e].style.display="none";for(e=0;e<j.length;e++)if(f=j[e],c.source===f.contentWindow){if(f.removeAttribute("style"),"height"===d.message){if(g=parseInt(d.value,10),g>1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 7bbc9cbef70fefb40826637d3512c035
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 2ca82815e5b2f7d4fa4420e527a27526
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 67c5db2a4649c5447ae14158d37e6214
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 1855bfca81559324fa5a5d116a289bc6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,32 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using UnityEngine;
public static class AwaitExtensions
{
public static TaskAwaiter<int> GetAwaiter(this Process process)
{
var tcs = new TaskCompletionSource<int>();
process.EnableRaisingEvents = true;
process.Exited += (s, e) => tcs.TrySetResult(process.ExitCode);
if (process.HasExited)
{
tcs.TrySetResult(process.ExitCode);
}
return tcs.Task.GetAwaiter();
}
// Any time you call an async method from sync code, you can either use this wrapper
// method or you can define your own `async void` method that performs the await
// on the given Task
public static async void WrapErrors(this Task task)
{
await task;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 386afd32a400664419ea609f8f1636fb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,45 +0,0 @@
using System;
using UnityEngine;
// TODO: Remove the allocs here, use a static memory pool?
public static class Awaiters
{
readonly static WaitForUpdate _waitForUpdate = new WaitForUpdate();
readonly static WaitForFixedUpdate _waitForFixedUpdate = new WaitForFixedUpdate();
readonly static WaitForEndOfFrame _waitForEndOfFrame = new WaitForEndOfFrame();
public static WaitForUpdate NextFrame
{
get { return _waitForUpdate; }
}
public static WaitForFixedUpdate FixedUpdate
{
get { return _waitForFixedUpdate; }
}
public static WaitForEndOfFrame EndOfFrame
{
get { return _waitForEndOfFrame; }
}
public static WaitForSeconds Seconds(float seconds)
{
return new WaitForSeconds(seconds);
}
public static WaitForSecondsRealtime SecondsRealtime(float seconds)
{
return new WaitForSecondsRealtime(seconds);
}
public static WaitUntil Until(Func<bool> predicate)
{
return new WaitUntil(predicate);
}
public static WaitWhile While(Func<bool> predicate)
{
return new WaitWhile(predicate);
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8d760c2bd4c003740956ef7de48cea40
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,399 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Threading;
using UnityEngine;
using UnityAsyncAwaitUtil;
// We could just add a generic GetAwaiter to YieldInstruction and CustomYieldInstruction
// but instead we add specific methods to each derived class to allow for return values
// that make the most sense for the specific instruction type
public static class IEnumeratorAwaitExtensions
{
public static SimpleCoroutineAwaiter GetAwaiter(this WaitForSeconds instruction)
{
return GetAwaiterReturnVoid(instruction);
}
public static SimpleCoroutineAwaiter GetAwaiter(this WaitForUpdate instruction)
{
return GetAwaiterReturnVoid(instruction);
}
public static SimpleCoroutineAwaiter GetAwaiter(this WaitForEndOfFrame instruction)
{
return GetAwaiterReturnVoid(instruction);
}
public static SimpleCoroutineAwaiter GetAwaiter(this WaitForFixedUpdate instruction)
{
return GetAwaiterReturnVoid(instruction);
}
public static SimpleCoroutineAwaiter GetAwaiter(this WaitForSecondsRealtime instruction)
{
return GetAwaiterReturnVoid(instruction);
}
public static SimpleCoroutineAwaiter GetAwaiter(this WaitUntil instruction)
{
return GetAwaiterReturnVoid(instruction);
}
public static SimpleCoroutineAwaiter GetAwaiter(this WaitWhile instruction)
{
return GetAwaiterReturnVoid(instruction);
}
public static SimpleCoroutineAwaiter<AsyncOperation> GetAwaiter(this AsyncOperation instruction)
{
return GetAwaiterReturnSelf(instruction);
}
public static SimpleCoroutineAwaiter<UnityEngine.Object> GetAwaiter(this ResourceRequest instruction)
{
var awaiter = new SimpleCoroutineAwaiter<UnityEngine.Object>();
RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
InstructionWrappers.ResourceRequest(awaiter, instruction)));
return awaiter;
}
// Return itself so you can do things like (await new WWW(url)).bytes
public static SimpleCoroutineAwaiter<WWW> GetAwaiter(this WWW instruction)
{
return GetAwaiterReturnSelf(instruction);
}
public static SimpleCoroutineAwaiter<AssetBundle> GetAwaiter(this AssetBundleCreateRequest instruction)
{
var awaiter = new SimpleCoroutineAwaiter<AssetBundle>();
RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
InstructionWrappers.AssetBundleCreateRequest(awaiter, instruction)));
return awaiter;
}
public static SimpleCoroutineAwaiter<UnityEngine.Object> GetAwaiter(this AssetBundleRequest instruction)
{
var awaiter = new SimpleCoroutineAwaiter<UnityEngine.Object>();
RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
InstructionWrappers.AssetBundleRequest(awaiter, instruction)));
return awaiter;
}
public static SimpleCoroutineAwaiter<T> GetAwaiter<T>(this IEnumerator<T> coroutine)
{
var awaiter = new SimpleCoroutineAwaiter<T>();
RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
new CoroutineWrapper<T>(coroutine, awaiter).Run()));
return awaiter;
}
public static SimpleCoroutineAwaiter<object> GetAwaiter(this IEnumerator coroutine)
{
var awaiter = new SimpleCoroutineAwaiter<object>();
RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
new CoroutineWrapper<object>(coroutine, awaiter).Run()));
return awaiter;
}
static SimpleCoroutineAwaiter GetAwaiterReturnVoid(object instruction)
{
var awaiter = new SimpleCoroutineAwaiter();
RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
InstructionWrappers.ReturnVoid(awaiter, instruction)));
return awaiter;
}
static SimpleCoroutineAwaiter<T> GetAwaiterReturnSelf<T>(T instruction)
{
var awaiter = new SimpleCoroutineAwaiter<T>();
RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
InstructionWrappers.ReturnSelf(awaiter, instruction)));
return awaiter;
}
static void RunOnUnityScheduler(Action action)
{
if (SynchronizationContext.Current == SyncContextUtil.UnitySynchronizationContext)
{
action();
}
else
{
SyncContextUtil.UnitySynchronizationContext.Post(_ => action(), null);
}
}
static void Assert(bool condition)
{
if (!condition)
{
throw new Exception("Assert hit in UnityAsyncUtil package!");
}
}
public class SimpleCoroutineAwaiter<T> : INotifyCompletion
{
bool _isDone;
Exception _exception;
Action _continuation;
T _result;
public bool IsCompleted
{
get { return _isDone; }
}
public T GetResult()
{
Assert(_isDone);
if (_exception != null)
{
ExceptionDispatchInfo.Capture(_exception).Throw();
}
return _result;
}
public void Complete(T result, Exception e)
{
Assert(!_isDone);
_isDone = true;
_exception = e;
_result = result;
// Always trigger the continuation on the unity thread when awaiting on unity yield
// instructions
if (_continuation != null)
{
RunOnUnityScheduler(_continuation);
}
}
void INotifyCompletion.OnCompleted(Action continuation)
{
Assert(_continuation == null);
Assert(!_isDone);
_continuation = continuation;
}
}
public class SimpleCoroutineAwaiter : INotifyCompletion
{
bool _isDone;
Exception _exception;
Action _continuation;
public bool IsCompleted
{
get { return _isDone; }
}
public void GetResult()
{
Assert(_isDone);
if (_exception != null)
{
ExceptionDispatchInfo.Capture(_exception).Throw();
}
}
public void Complete(Exception e)
{
Assert(!_isDone);
_isDone = true;
_exception = e;
// Always trigger the continuation on the unity thread when awaiting on unity yield
// instructions
if (_continuation != null)
{
RunOnUnityScheduler(_continuation);
}
}
void INotifyCompletion.OnCompleted(Action continuation)
{
Assert(_continuation == null);
Assert(!_isDone);
_continuation = continuation;
}
}
class CoroutineWrapper<T>
{
readonly SimpleCoroutineAwaiter<T> _awaiter;
readonly Stack<IEnumerator> _processStack;
public CoroutineWrapper(
IEnumerator coroutine, SimpleCoroutineAwaiter<T> awaiter)
{
_processStack = new Stack<IEnumerator>();
_processStack.Push(coroutine);
_awaiter = awaiter;
}
public IEnumerator Run()
{
while (true)
{
var topWorker = _processStack.Peek();
bool isDone;
try
{
isDone = !topWorker.MoveNext();
}
catch (Exception e)
{
// The IEnumerators we have in the process stack do not tell us the
// actual names of the coroutine methods but it does tell us the objects
// that the IEnumerators are associated with, so we can at least try
// adding that to the exception output
var objectTrace = GenerateObjectTrace(_processStack);
if (objectTrace.Any())
{
_awaiter.Complete(
default(T), new Exception(
GenerateObjectTraceMessage(objectTrace), e));
}
else
{
_awaiter.Complete(default(T), e);
}
yield break;
}
if (isDone)
{
_processStack.Pop();
if (_processStack.Count == 0)
{
_awaiter.Complete((T)topWorker.Current, null);
yield break;
}
}
// We could just yield return nested IEnumerator's here but we choose to do
// our own handling here so that we can catch exceptions in nested coroutines
// instead of just top level coroutine
if (topWorker.Current is IEnumerator)
{
_processStack.Push((IEnumerator)topWorker.Current);
}
else
{
// Return the current value to the unity engine so it can handle things like
// WaitForSeconds, WaitToEndOfFrame, etc.
yield return topWorker.Current;
}
}
}
string GenerateObjectTraceMessage(List<Type> objTrace)
{
var result = new StringBuilder();
foreach (var objType in objTrace)
{
if (result.Length != 0)
{
result.Append(" -> ");
}
result.Append(objType.ToString());
}
result.AppendLine();
return "Unity Coroutine Object Trace: " + result.ToString();
}
static List<Type> GenerateObjectTrace(IEnumerable<IEnumerator> enumerators)
{
var objTrace = new List<Type>();
foreach (var enumerator in enumerators)
{
// NOTE: This only works with scripting engine 4.6
// And could easily stop working with unity updates
var field = enumerator.GetType().GetField("$this", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
if (field == null)
{
continue;
}
var obj = field.GetValue(enumerator);
if (obj == null)
{
continue;
}
var objType = obj.GetType();
if (!objTrace.Any() || objType != objTrace.Last())
{
objTrace.Add(objType);
}
}
objTrace.Reverse();
return objTrace;
}
}
static class InstructionWrappers
{
public static IEnumerator ReturnVoid(
SimpleCoroutineAwaiter awaiter, object instruction)
{
// For simple instructions we assume that they don't throw exceptions
yield return instruction;
awaiter.Complete(null);
}
public static IEnumerator AssetBundleCreateRequest(
SimpleCoroutineAwaiter<AssetBundle> awaiter, AssetBundleCreateRequest instruction)
{
yield return instruction;
awaiter.Complete(instruction.assetBundle, null);
}
public static IEnumerator ReturnSelf<T>(
SimpleCoroutineAwaiter<T> awaiter, T instruction)
{
yield return instruction;
awaiter.Complete(instruction, null);
}
public static IEnumerator AssetBundleRequest(
SimpleCoroutineAwaiter<UnityEngine.Object> awaiter, AssetBundleRequest instruction)
{
yield return instruction;
awaiter.Complete(instruction.asset, null);
}
public static IEnumerator ResourceRequest(
SimpleCoroutineAwaiter<UnityEngine.Object> awaiter, ResourceRequest instruction)
{
yield return instruction;
awaiter.Complete(instruction.asset, null);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e25e4bf7a3b2f5f4e82e2de590d2e12a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 0e49c304a8a375e4fb785571f1b582c2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,35 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UnityAsyncAwaitUtil
{
public class AsyncCoroutineRunner : MonoBehaviour
{
static AsyncCoroutineRunner _instance;
public static AsyncCoroutineRunner Instance
{
get
{
if (_instance == null)
{
_instance = new GameObject("AsyncCoroutineRunner")
.AddComponent<AsyncCoroutineRunner>();
}
return _instance;
}
}
void Awake()
{
// Don't show in scene hierarchy
gameObject.hideFlags = HideFlags.HideAndDontSave;
DontDestroyOnLoad(gameObject);
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: f11ec4617f62c224b99e34972dc917a8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,31 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
namespace UnityAsyncAwaitUtil
{
public static class SyncContextUtil
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void Install()
{
UnitySynchronizationContext = SynchronizationContext.Current;
UnityThreadId = Thread.CurrentThread.ManagedThreadId;
}
public static int UnityThreadId
{
get; private set;
}
public static SynchronizationContext UnitySynchronizationContext
{
get; private set;
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a184433eba65a614191b36436c5620cd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,40 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using UnityEngine;
public static class TaskExtensions
{
public static IEnumerator AsIEnumerator(this Task task)
{
while (!task.IsCompleted)
{
yield return null;
}
if (task.IsFaulted)
{
ExceptionDispatchInfo.Capture(task.Exception).Throw();
}
}
public static IEnumerator<T> AsIEnumerator<T>(this Task<T> task)
where T : class
{
while (!task.IsCompleted)
{
yield return null;
}
if (task.IsFaulted)
{
ExceptionDispatchInfo.Capture(task.Exception).Throw();
}
yield return task.Result;
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 445df9c15261a3a4e97d1528208902e3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using UnityEngine;
public class WaitForBackgroundThread
{
public ConfiguredTaskAwaitable.ConfiguredTaskAwaiter GetAwaiter()
{
return Task.Run(() => {}).ConfigureAwait(false).GetAwaiter();
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b49e8af9f6a40874191794f7bae31812
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using UnityEngine;
// This can be used as a way to return to the main unity thread when using multiple threads
// with async methods
public class WaitForUpdate : CustomYieldInstruction
{
public override bool keepWaiting
{
get { return false; }
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: df6106e9f5d243e449fcef043d2d247a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 0a467472112afef41a04d89bb288500f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: d4f1d3a80306a3b44a05dbe2d5e2d9a0
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -24,7 +24,7 @@ namespace GraphQlClient.Core
public List<Query> subscriptions; public List<Query> subscriptions;
private string introspection; [SerializeField] private string introspection;
public Introspection.SchemaClass schemaClass; public Introspection.SchemaClass schemaClass;
@ -101,13 +101,16 @@ namespace GraphQlClient.Core
for (int i = 0; i < jsonChar.Length; i++){ for (int i = 0; i < jsonChar.Length; i++){
if (jsonChar[i] == '\"'){ if (jsonChar[i] == '\"'){
if (indexes.Count == 2) if (indexes.Count == 2)
indexes = new List<int>(); indexes.Clear();
indexes.Add(i); indexes.Add(i);
} }
if (jsonChar[i] == ':'){ if (indexes.Count == 2)
jsonChar[indexes[0]] = ' '; {
jsonChar[indexes[1]] = ' '; if (jsonChar[i] == ':'){
jsonChar[indexes[0]] = ' ';
jsonChar[indexes[1]] = ' ';
}
} }
} }
@ -133,7 +136,6 @@ namespace GraphQlClient.Core
return; return;
EditorApplication.update -= HandleIntrospection; EditorApplication.update -= HandleIntrospection;
introspection = request.downloadHandler.text; introspection = request.downloadHandler.text;
File.WriteAllText(Application.dataPath + $"{Path.DirectorySeparatorChar}{name}schema.txt",introspection);
schemaClass = JsonConvert.DeserializeObject<Introspection.SchemaClass>(introspection); schemaClass = JsonConvert.DeserializeObject<Introspection.SchemaClass>(introspection);
if (schemaClass.data.__schema.queryType != null) if (schemaClass.data.__schema.queryType != null)
queryEndpoint = schemaClass.data.__schema.queryType.name; queryEndpoint = schemaClass.data.__schema.queryType.name;
@ -145,14 +147,12 @@ namespace GraphQlClient.Core
} }
public void GetSchema(){ public void GetSchema(){
if (String.IsNullOrEmpty(introspection))
{
schemaClass = null;
return;
};
if (schemaClass == null){ if (schemaClass == null){
try{
introspection = File.ReadAllText(Application.dataPath + $"{Path.DirectorySeparatorChar}{name}schema.txt");
}
catch{
return;
}
schemaClass = JsonConvert.DeserializeObject<Introspection.SchemaClass>(introspection); schemaClass = JsonConvert.DeserializeObject<Introspection.SchemaClass>(introspection);
if (schemaClass.data.__schema.queryType != null) if (schemaClass.data.__schema.queryType != null)
queryEndpoint = schemaClass.data.__schema.queryType.name; queryEndpoint = schemaClass.data.__schema.queryType.name;

View File

@ -3,6 +3,7 @@ using System.Net.WebSockets;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Cysharp.Threading.Tasks;
using GraphQlClient.EventCallbacks; using GraphQlClient.EventCallbacks;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;

View File

@ -1,7 +1,5 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine;
namespace GraphQlClient.Core namespace GraphQlClient.Core
{ {
@ -10,13 +8,14 @@ namespace GraphQlClient.Core
public static string schemaIntrospectionQuery = public static string schemaIntrospectionQuery =
"query IntrospectionQuery {\n __schema {\n queryType {\n name\n }\n mutationType {\n name\n }\n subscriptionType {\n name\n }\n types {\n ...FullType\n }\n directives {\n name\n description\n locations\n args {\n ...InputValue\n }\n }\n }\n}\n\nfragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n}\n\nfragment InputValue on __InputValue {\n name\n description\n type {\n ...TypeRef\n }\n defaultValue\n}\n\nfragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}"; "query IntrospectionQuery {\n __schema {\n queryType {\n name\n }\n mutationType {\n name\n }\n subscriptionType {\n name\n }\n types {\n ...FullType\n }\n directives {\n name\n description\n locations\n args {\n ...InputValue\n }\n }\n }\n}\n\nfragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n}\n\nfragment InputValue on __InputValue {\n name\n description\n type {\n ...TypeRef\n }\n defaultValue\n}\n\nfragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n}";
[Serializable]
public class SchemaClass public class SchemaClass
{ {
public Data data; public Data data;
public class Data public class Data
{ {
public Schema __schema; public Schema __schema;
public class Schema public class Schema
{ {
public List<Type> types; public List<Type> types;
@ -55,6 +54,7 @@ namespace GraphQlClient.Core
INPUT_FIELD_DEFINITION INPUT_FIELD_DEFINITION
} }
} }
public class Type public class Type
{ {
public TypeKind kind; public TypeKind kind;
@ -67,6 +67,7 @@ namespace GraphQlClient.Core
public List<InputValue> inputFields; public List<InputValue> inputFields;
public Type ofType; public Type ofType;
public class Field public class Field
{ {
public string name; public string name;
@ -77,6 +78,7 @@ namespace GraphQlClient.Core
public string deprecationReason; public string deprecationReason;
} }
public class EnumValue public class EnumValue
{ {
public string name; public string name;
@ -90,6 +92,8 @@ namespace GraphQlClient.Core
SCALAR, OBJECT, INTERFACE, UNION, ENUM, INPUT_OBJECT, LIST, NON_NULL SCALAR, OBJECT, INTERFACE, UNION, ENUM, INPUT_OBJECT, LIST, NON_NULL
} }
} }
public class InputValue public class InputValue
{ {
public string name; public string name;

View File

@ -15,9 +15,9 @@ namespace GraphQlClient.Editor
public override void OnInspectorGUI(){ public override void OnInspectorGUI(){
GraphApi graph = (GraphApi) target; GraphApi graph = (GraphApi) target;
GUIStyle style = new GUIStyle{fontSize = 15, alignment = TextAnchor.MiddleCenter}; GUIStyle style = new GUIStyle{fontSize = 15, alignment = TextAnchor.MiddleCenter};
graph.GetSchema();
EditorGUILayout.LabelField(graph.name, style); EditorGUILayout.LabelField(graph.name, style);
EditorGUILayout.Space(); EditorGUILayout.Space();
graph.GetSchema();
if (GUILayout.Button("Reset")){ if (GUILayout.Button("Reset")){
graph.DeleteAllQueries(); graph.DeleteAllQueries();
} }
@ -38,6 +38,7 @@ namespace GraphQlClient.Editor
if (graph.schemaClass == null){ if (graph.schemaClass == null){
return; return;
} }
EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Create New Query")){ if (GUILayout.Button("Create New Query")){
graph.CreateNewQuery(); graph.CreateNewQuery();
@ -45,10 +46,12 @@ namespace GraphQlClient.Editor
if (GUILayout.Button("Create New Mutation")){ if (GUILayout.Button("Create New Mutation")){
graph.CreateNewMutation(); graph.CreateNewMutation();
} }
if (GUILayout.Button("Create New Subscription")){ if (GUILayout.Button("Create New Subscription")){
graph.CreateNewSubscription(); graph.CreateNewSubscription();
} }
EditorGUILayout.EndHorizontal(); EditorGUILayout.EndHorizontal();
@ -75,7 +78,17 @@ namespace GraphQlClient.Editor
query.name = EditorGUILayout.TextField($"{type} Name", query.name); query.name = EditorGUILayout.TextField($"{type} Name", query.name);
string[] options = query.queryOptions.ToArray(); string[] options = query.queryOptions.ToArray();
if (String.IsNullOrEmpty(query.returnType)){ if (String.IsNullOrEmpty(query.returnType)){
index = EditorGUILayout.Popup(type, index, options); EditorGUILayout.BeginHorizontal();
EditorGUILayout.PrefixLabel(type);
if (GUILayout.Button(queryList[i].queryString, EditorStyles.popup))
{
SearchOptionWindow.Show(Event.current.mousePosition, options, type, index =>
{
query.queryString = options[index];
this.index = index;
});
}
EditorGUILayout.EndHorizontal();
query.queryString = options[index]; query.queryString = options[index];
EditorGUILayout.LabelField(options[index]); EditorGUILayout.LabelField(options[index]);
if (GUILayout.Button($"Confirm {type}")){ if (GUILayout.Button($"Confirm {type}")){
@ -120,7 +133,14 @@ namespace GraphQlClient.Editor
EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginHorizontal();
GUIStyle fieldStyle = EditorStyles.popup; GUIStyle fieldStyle = EditorStyles.popup;
fieldStyle.contentOffset = new Vector2(field.parentIndexes.Count * 20, 0); fieldStyle.contentOffset = new Vector2(field.parentIndexes.Count * 20, 0);
field.Index = EditorGUILayout.Popup(field.Index, fieldOptions, fieldStyle); field.Index = field.index;
if (GUILayout.Button(fieldOptions[field.Index], EditorStyles.popup))
{
SearchOptionWindow.Show(Event.current.mousePosition, fieldOptions, "Field", index =>
{
field.Index = index;
});
}
GUI.color = Color.white; GUI.color = Color.white;
field.CheckSubFields(graph.schemaClass); field.CheckSubFields(graph.schemaClass);
if (field.hasSubField){ if (field.hasSubField){

View File

@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
namespace GraphQlClient.Editor
{
public class SearchOptionWindow : ScriptableObject, ISearchWindowProvider
{
private Texture2D icon;
private string[] _options;
private string _title;
private Action<int> _callBack;
public static void Show(Vector2 mousePosition, string[] options, string title, Action<int> callBack)
{
var screenPoint = GUIUtility.GUIToScreenPoint(mousePosition);
var searchWindowProvider = CreateInstance<SearchOptionWindow>();
searchWindowProvider.Init(options, title, callBack);
var wdContext = new SearchWindowContext(screenPoint, 240, 320);
SearchWindow.Open(wdContext, searchWindowProvider);
}
public void Init(string[] options, string title, Action<int> callBack)
{
_options = options;
_title = title;
_callBack = callBack;
icon = new Texture2D(1, 1);
icon.SetPixel(0, 0, Color.clear);
icon.Apply();
}
public List<SearchTreeEntry> CreateSearchTree(SearchWindowContext context)
{
var tree = new List<SearchTreeEntry>
{
new SearchTreeGroupEntry(new GUIContent(_title))
};
for (int i = 0; i < _options.Length; i++)
{
var option = _options[i];
tree.Add(new SearchTreeEntry(new GUIContent(option, icon)) { level = 1, userData = i});
}
return tree;
}
public bool OnSelectEntry(SearchTreeEntry searchTreeEntry, SearchWindowContext context)
{
_callBack?.Invoke((int)searchTreeEntry.userData);
return true;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8b99ac8dfb534801a2fb0d057325f442
timeCreated: 1716301188