feat: add graphql
parent
4be153f59d
commit
f874747384
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 51573433fe833f9498d6fe6a2ab117fb
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,95 @@
|
||||||
|
%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
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 996c64a78f8eb3d4aad0de99fe6607b4
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -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.37311953, g: 0.38074014, b: 0.35872743, a: 1}
|
m_IndirectSpecularColor: {r: 0.37311918, g: 0.3807398, b: 0.35872716, a: 1}
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
|
@ -123,6 +123,53 @@ NavMeshSettings:
|
||||||
debug:
|
debug:
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1 &398718622
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 398718624}
|
||||||
|
- component: {fileID: 398718623}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: P4PGraphqlManager
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &398718623
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 398718622}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 0c915a4976334babb372a35c1c2e050c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
_p4pGraph: {fileID: 11400000, guid: 996c64a78f8eb3d4aad0de99fe6607b4, type: 2}
|
||||||
|
_machineMac: D85ED3741515
|
||||||
|
_promotionId: 63c67c5434403000
|
||||||
|
--- !u!4 &398718624
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 398718622}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -0.10615547, y: 1.534176, z: 240.78484}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1721719374
|
--- !u!1 &1721719374
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -303,3 +350,4 @@ SceneRoots:
|
||||||
- {fileID: 6450421618175804686}
|
- {fileID: 6450421618175804686}
|
||||||
- {fileID: 427187107964909625}
|
- {fileID: 427187107964909625}
|
||||||
- {fileID: 1531525527984352823}
|
- {fileID: 1531525527984352823}
|
||||||
|
- {fileID: 398718624}
|
||||||
|
|
|
@ -0,0 +1,127 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using GadGame.Singleton;
|
||||||
|
using GraphQlClient.Core;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Sirenix.OdinInspector;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Networking;
|
||||||
|
|
||||||
|
namespace GadGame.Network
|
||||||
|
{
|
||||||
|
public struct CreateQueryOptions
|
||||||
|
{
|
||||||
|
public string Name;
|
||||||
|
public GraphApi.Query.Type QueryType;
|
||||||
|
public string Root;
|
||||||
|
public string ReturnType;
|
||||||
|
public string Projection;
|
||||||
|
public object QueryArgs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class P4PGraphqlManager : PersistentSingleton<P4PGraphqlManager>
|
||||||
|
{
|
||||||
|
[SerializeField] private GraphApi _p4pGraph;
|
||||||
|
[SerializeField] private string _machineMac;
|
||||||
|
[SerializeField] private string _promotionId;
|
||||||
|
|
||||||
|
[ShowInInspector] private string _userID;
|
||||||
|
|
||||||
|
protected override void Awake()
|
||||||
|
{
|
||||||
|
base.Awake();
|
||||||
|
LoginMachine();
|
||||||
|
// CreateGuest();
|
||||||
|
}
|
||||||
|
|
||||||
|
private GraphApi.Query CreateQuery(CreateQueryOptions options)
|
||||||
|
{
|
||||||
|
GraphApi.Query query = new GraphApi.Query
|
||||||
|
{
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
GraphApi.Query query = _p4pGraph.GetQueryByName("LoginMachine", GraphApi.Query.Type.Mutation);
|
||||||
|
query.SetArgs(new
|
||||||
|
{
|
||||||
|
input = new
|
||||||
|
{
|
||||||
|
macAddress = _machineMac,
|
||||||
|
password = "Abc@123"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
UnityWebRequest request = await _p4pGraph.Post(query);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void CreateGuest()
|
||||||
|
{
|
||||||
|
GraphApi.Query query = _p4pGraph.GetQueryByName("CreateGuest", GraphApi.Query.Type.Mutation);
|
||||||
|
query.SetArgs(new
|
||||||
|
{
|
||||||
|
input = new
|
||||||
|
{
|
||||||
|
password = "Abc@123"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
UnityWebRequest request = await _p4pGraph.Post(query);
|
||||||
|
Debug.Log("login machine " + request.result);
|
||||||
|
string json = HttpHandler.FormatJson(request.downloadHandler.text);
|
||||||
|
JObject obj = JObject.Parse(json);
|
||||||
|
Debug.Log(obj["data"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void JoinPromotion()
|
||||||
|
{
|
||||||
|
GraphApi.Query query = _p4pGraph.GetQueryByName("JoinPromotion", GraphApi.Query.Type.Mutation);
|
||||||
|
query.SetArgs(new
|
||||||
|
{
|
||||||
|
input = new
|
||||||
|
{
|
||||||
|
promotionId = _promotionId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
UnityWebRequest request = await _p4pGraph.Post(query);
|
||||||
|
GetData(request.downloadHandler.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void SubmitGameSession()
|
||||||
|
{
|
||||||
|
GraphApi.Query query = _p4pGraph.GetQueryByName("SubmitGameSession", GraphApi.Query.Type.Mutation);
|
||||||
|
query.SetArgs(new
|
||||||
|
{
|
||||||
|
input = new
|
||||||
|
{
|
||||||
|
playerID = _userID,
|
||||||
|
promotionId = _promotionId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
UnityWebRequest request = await _p4pGraph.Post(query);
|
||||||
|
GetData(request.downloadHandler.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GetData(string data)
|
||||||
|
{
|
||||||
|
string json = HttpHandler.FormatJson(data);
|
||||||
|
Debug.Log(JsonConvert.DeserializeObject(json));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0c915a4976334babb372a35c1c2e050c
|
||||||
|
timeCreated: 1716280136
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1489c2fd3fb39d5428ad3c0b8479dd29
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3956940cbcabd1a4aab80071f5e569a2
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 46d891d9b63592344ae73ff9c4cedbf1
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 20766c9394fe27140b3389473dccd660
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bc264b4d34aebb045b2fb00cce833d49
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
After Width: | Height: | Size: 837 B |
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 560a88da2bbc70140bed167f0ba7fe37
|
guid: 8f2198707218a564da2a9827a697cc2a
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
Binary file not shown.
After Width: | Height: | Size: 911 B |
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: fb01be13d6e88ca488dda82150319bfc
|
guid: 850f19a5487609c4dbed7ca6131d9879
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
|
@ -0,0 +1,186 @@
|
||||||
|
<!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>
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 49ce8a667f92d7345b797e0c8bf12689
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
||||||
|
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)}};
|
|
@ -1,5 +1,5 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 117dcc671050f5247bd8743b91ecaab7
|
guid: 15092c2a8d531934783c3262751ecde4
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a36d3fd7af8651e469d6b5a4bba54ad4
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,403 @@
|
||||||
|
@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";}
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3019c1c6b72e41847899e2ac02471923
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
1
Assets/Plugins/AsyncAwaitUtil/Documentation/ReadMe_files/font-awesome.min.css
vendored
Normal file
1
Assets/Plugins/AsyncAwaitUtil/Documentation/ReadMe_files/font-awesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b1985c3a9f17306419ee984450d97ffa
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0f0e2a59e00d25446aa594df76a5dced
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 54d153b1a1ded8242885ba82c00e583c
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,65 @@
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
})();
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3a3eba33a609b9444b5d4cf94850b596
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,237 @@
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4141587b0e66e4e4dbfff848df4ddee7
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1a997a3755a0b4c48bb3457eec44cf43
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,117 @@
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 77d7d86f0c0780d4bb40705b0ab6fcc6
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 601023394f5f81c48b6ee8a7f63522cf
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
||||||
|
!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)}();
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b8e426e734f526a4984d0bd9a58066bc
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
||||||
|
!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);
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7bbc9cbef70fefb40826637d3512c035
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2ca82815e5b2f7d4fa4420e527a27526
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 67c5db2a4649c5447ae14158d37e6214
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1855bfca81559324fa5a5d116a289bc6
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,32 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 386afd32a400664419ea609f8f1636fb
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,45 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8d760c2bd4c003740956ef7de48cea40
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,399 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e25e4bf7a3b2f5f4e82e2de590d2e12a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0e49c304a8a375e4fb785571f1b582c2
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,35 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f11ec4617f62c224b99e34972dc917a8
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a184433eba65a614191b36436c5620cd
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,40 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 445df9c15261a3a4e97d1528208902e3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,14 @@
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b49e8af9f6a40874191794f7bae31812
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,16 @@
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: df6106e9f5d243e449fcef043d2d247a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0a467472112afef41a04d89bb288500f
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d4f1d3a80306a3b44a05dbe2d5e2d9a0
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c07947b83a1494a40a2cba3030b637db
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1508084886
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 33db8fedd8b8b904191bb81ee8aaaa18
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1508084895
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 15acd9991cc43df4d8f2141e9eb257dc
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,527 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.WebSockets;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Utilities;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Networking;
|
||||||
|
|
||||||
|
namespace GraphQlClient.Core
|
||||||
|
{
|
||||||
|
[CreateAssetMenu(fileName = "Api Reference", menuName = "GraphQlClient/Api Reference")]
|
||||||
|
public class GraphApi : ScriptableObject
|
||||||
|
{
|
||||||
|
public string url;
|
||||||
|
|
||||||
|
public List<Query> queries;
|
||||||
|
|
||||||
|
public List<Query> mutations;
|
||||||
|
|
||||||
|
public List<Query> subscriptions;
|
||||||
|
|
||||||
|
private string introspection;
|
||||||
|
|
||||||
|
public Introspection.SchemaClass schemaClass;
|
||||||
|
|
||||||
|
private string authToken;
|
||||||
|
|
||||||
|
private string queryEndpoint;
|
||||||
|
private string mutationEndpoint;
|
||||||
|
private string subscriptionEndpoint;
|
||||||
|
|
||||||
|
private UnityWebRequest request;
|
||||||
|
|
||||||
|
public bool loading;
|
||||||
|
|
||||||
|
public void SetAuthToken(string auth){
|
||||||
|
authToken = auth;
|
||||||
|
}
|
||||||
|
public Query GetQueryByName(string queryName, Query.Type type){
|
||||||
|
List<Query> querySearch;
|
||||||
|
switch (type){
|
||||||
|
case Query.Type.Mutation:
|
||||||
|
querySearch = mutations;
|
||||||
|
break;
|
||||||
|
case Query.Type.Query:
|
||||||
|
querySearch = queries;
|
||||||
|
break;
|
||||||
|
case Query.Type.Subscription:
|
||||||
|
querySearch = subscriptions;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
querySearch = queries;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return querySearch.Find(aQuery => aQuery.name == queryName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<UnityWebRequest> Post(Query query){
|
||||||
|
if (String.IsNullOrEmpty(query.query))
|
||||||
|
query.CompleteQuery();
|
||||||
|
return await HttpHandler.PostAsync(url, query.query, authToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<UnityWebRequest> Post(string queryString){
|
||||||
|
return await HttpHandler.PostAsync(url, queryString, authToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<UnityWebRequest> Post(string queryName, Query.Type type){
|
||||||
|
Query query = GetQueryByName(queryName, type);
|
||||||
|
return await Post(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ClientWebSocket> Subscribe(Query query, string socketId = "1", string protocol = "graphql-ws"){
|
||||||
|
if (String.IsNullOrEmpty(query.query))
|
||||||
|
query.CompleteQuery();
|
||||||
|
return await HttpHandler.WebsocketConnect(url, query.query, authToken, socketId, protocol);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ClientWebSocket> Subscribe(string queryName, Query.Type type, string socketId = "1", string protocol = "graphql-ws"){
|
||||||
|
Query query = GetQueryByName(queryName, type);
|
||||||
|
return await Subscribe(query, socketId, protocol);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void CancelSubscription(ClientWebSocket cws, string socketId = "1"){
|
||||||
|
await HttpHandler.WebsocketDisconnect(cws, socketId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Utility
|
||||||
|
|
||||||
|
private static string JsonToArgument(string jsonInput){
|
||||||
|
char[] jsonChar = jsonInput.ToCharArray();
|
||||||
|
List<int> indexes = new List<int>();
|
||||||
|
jsonChar[0] = ' ';
|
||||||
|
jsonChar[jsonChar.Length - 1] = ' ';
|
||||||
|
for (int i = 0; i < jsonChar.Length; i++){
|
||||||
|
if (jsonChar[i] == '\"'){
|
||||||
|
if (indexes.Count == 2)
|
||||||
|
indexes = new List<int>();
|
||||||
|
indexes.Add(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jsonChar[i] == ':'){
|
||||||
|
jsonChar[indexes[0]] = ' ';
|
||||||
|
jsonChar[indexes[1]] = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string result = new string(jsonChar);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
|
||||||
|
#region Editor Use
|
||||||
|
|
||||||
|
//Todo: Put schema file in proper location
|
||||||
|
public async void Introspect(){
|
||||||
|
loading = true;
|
||||||
|
request = await HttpHandler.PostAsync(url, Introspection.schemaIntrospectionQuery, authToken);
|
||||||
|
EditorApplication.update += HandleIntrospection;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleIntrospection(){
|
||||||
|
if (!request.isDone)
|
||||||
|
return;
|
||||||
|
EditorApplication.update -= HandleIntrospection;
|
||||||
|
introspection = request.downloadHandler.text;
|
||||||
|
File.WriteAllText(Application.dataPath + $"{Path.DirectorySeparatorChar}{name}schema.txt",introspection);
|
||||||
|
schemaClass = JsonConvert.DeserializeObject<Introspection.SchemaClass>(introspection);
|
||||||
|
if (schemaClass.data.__schema.queryType != null)
|
||||||
|
queryEndpoint = schemaClass.data.__schema.queryType.name;
|
||||||
|
if (schemaClass.data.__schema.mutationType != null)
|
||||||
|
mutationEndpoint = schemaClass.data.__schema.mutationType.name;
|
||||||
|
if (schemaClass.data.__schema.subscriptionType != null)
|
||||||
|
subscriptionEndpoint = schemaClass.data.__schema.subscriptionType.name;
|
||||||
|
loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GetSchema(){
|
||||||
|
if (schemaClass == null){
|
||||||
|
try{
|
||||||
|
introspection = File.ReadAllText(Application.dataPath + $"{Path.DirectorySeparatorChar}{name}schema.txt");
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
schemaClass = JsonConvert.DeserializeObject<Introspection.SchemaClass>(introspection);
|
||||||
|
if (schemaClass.data.__schema.queryType != null)
|
||||||
|
queryEndpoint = schemaClass.data.__schema.queryType.name;
|
||||||
|
if (schemaClass.data.__schema.mutationType != null)
|
||||||
|
mutationEndpoint = schemaClass.data.__schema.mutationType.name;
|
||||||
|
if (schemaClass.data.__schema.subscriptionType != null)
|
||||||
|
subscriptionEndpoint = schemaClass.data.__schema.subscriptionType.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void CreateNewQuery(){
|
||||||
|
GetSchema();
|
||||||
|
if (queries == null)
|
||||||
|
queries = new List<Query>();
|
||||||
|
Query query = new Query{fields = new List<Field>(), queryOptions = new List<string>(), type = Query.Type.Query};
|
||||||
|
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type queryType = schemaClass.data.__schema.types.Find((aType => aType.name == queryEndpoint));
|
||||||
|
for (int i = 0; i < queryType.fields.Count; i++){
|
||||||
|
query.queryOptions.Add(queryType.fields[i].name);
|
||||||
|
}
|
||||||
|
|
||||||
|
queries.Add(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateNewMutation(){
|
||||||
|
GetSchema();
|
||||||
|
if (mutations == null)
|
||||||
|
mutations = new List<Query>();
|
||||||
|
Query mutation = new Query{fields = new List<Field>(), queryOptions = new List<string>(), type = Query.Type.Mutation};
|
||||||
|
|
||||||
|
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type mutationType = schemaClass.data.__schema.types.Find((aType => aType.name == mutationEndpoint));
|
||||||
|
if (mutationType == null){
|
||||||
|
Debug.Log("No mutations");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < mutationType.fields.Count; i++){
|
||||||
|
mutation.queryOptions.Add(mutationType.fields[i].name);
|
||||||
|
}
|
||||||
|
|
||||||
|
mutations.Add(mutation);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateNewSubscription(){
|
||||||
|
GetSchema();
|
||||||
|
if (subscriptions == null)
|
||||||
|
subscriptions = new List<Query>();
|
||||||
|
Query subscription = new Query{fields = new List<Field>(), queryOptions = new List<string>(), type = Query.Type.Subscription};
|
||||||
|
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type subscriptionType = schemaClass.data.__schema.types.Find((aType => aType.name == subscriptionEndpoint));
|
||||||
|
if (subscriptionType == null){
|
||||||
|
Debug.Log("No subscriptions");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < subscriptionType.fields.Count; i++){
|
||||||
|
subscription.queryOptions.Add(subscriptionType.fields[i].name);
|
||||||
|
}
|
||||||
|
|
||||||
|
subscriptions.Add(subscription);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EditQuery(Query query){
|
||||||
|
query.isComplete = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool CheckSubFields(string typeName){
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type type = schemaClass.data.__schema.types.Find((aType => aType.name == typeName));
|
||||||
|
if (type?.fields == null || type.fields.Count == 0){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ToDo: Do not allow addition of subfield that already exists
|
||||||
|
public void AddField(Query query, string typeName, Field parent = null){
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type type = schemaClass.data.__schema.types.Find((aType => aType.name == typeName));
|
||||||
|
List<Introspection.SchemaClass.Data.Schema.Type.Field> subFields = type.fields;
|
||||||
|
int parentIndex = query.fields.FindIndex(aField => aField == parent);
|
||||||
|
List<int> parentIndexes = new List<int>();
|
||||||
|
if (parent != null){
|
||||||
|
parentIndexes = new List<int>(parent.parentIndexes){parentIndex};
|
||||||
|
}
|
||||||
|
Field fielder = new Field{parentIndexes = parentIndexes};
|
||||||
|
|
||||||
|
foreach (Introspection.SchemaClass.Data.Schema.Type.Field field in subFields){
|
||||||
|
fielder.possibleFields.Add((Field)field);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fielder.parentIndexes.Count == 0){
|
||||||
|
query.fields.Add(fielder);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
int index;
|
||||||
|
index = query.fields.FindLastIndex(aField =>
|
||||||
|
aField.parentIndexes.Count > fielder.parentIndexes.Count &&
|
||||||
|
aField.parentIndexes.Contains(fielder.parentIndexes.Last()));
|
||||||
|
|
||||||
|
if (index == -1){
|
||||||
|
index = query.fields.FindLastIndex(aField =>
|
||||||
|
aField.parentIndexes.Count > fielder.parentIndexes.Count &&
|
||||||
|
aField.parentIndexes.Last() == fielder.parentIndexes.Last());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index == -1){
|
||||||
|
index = fielder.parentIndexes.Last();
|
||||||
|
}
|
||||||
|
|
||||||
|
index++;
|
||||||
|
query.fields[parentIndex].hasChanged = false;
|
||||||
|
query.fields.Insert(index, fielder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetFieldType(Introspection.SchemaClass.Data.Schema.Type.Field field){
|
||||||
|
Field newField = (Field)field;
|
||||||
|
return newField.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void GetQueryReturnType(Query query, string queryName){
|
||||||
|
string endpoint;
|
||||||
|
switch (query.type){
|
||||||
|
case Query.Type.Query:
|
||||||
|
endpoint = queryEndpoint;
|
||||||
|
break;
|
||||||
|
case Query.Type.Mutation:
|
||||||
|
endpoint = mutationEndpoint;
|
||||||
|
break;
|
||||||
|
case Query.Type.Subscription:
|
||||||
|
endpoint = subscriptionEndpoint;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
endpoint = queryEndpoint;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type queryType =
|
||||||
|
schemaClass.data.__schema.types.Find((aType => aType.name == endpoint));
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type.Field field =
|
||||||
|
queryType.fields.Find((aField => aField.name == queryName));
|
||||||
|
|
||||||
|
query.returnType = GetFieldType(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteQuery(List<Query> query, int index){
|
||||||
|
query.RemoveAt(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteAllQueries(){
|
||||||
|
queries = new List<Query>();
|
||||||
|
mutations = new List<Query>();
|
||||||
|
subscriptions = new List<Query>();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#region Classes
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class Query
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
public Type type;
|
||||||
|
public string query;
|
||||||
|
public string queryString;
|
||||||
|
public string returnType;
|
||||||
|
private string args;
|
||||||
|
public List<string> queryOptions;
|
||||||
|
public List<Field> fields;
|
||||||
|
public bool isComplete;
|
||||||
|
|
||||||
|
public enum Type
|
||||||
|
{
|
||||||
|
Query,
|
||||||
|
Mutation,
|
||||||
|
Subscription
|
||||||
|
}
|
||||||
|
public void SetArgs(object inputObject){
|
||||||
|
string json = JsonConvert.SerializeObject(inputObject, new EnumInputConverter());
|
||||||
|
args = JsonToArgument(json);
|
||||||
|
CompleteQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetArgs(string inputString){
|
||||||
|
args = inputString;
|
||||||
|
CompleteQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void CompleteQuery(){
|
||||||
|
isComplete = true;
|
||||||
|
string data = null;
|
||||||
|
string parent = null;
|
||||||
|
Field previousField = null;
|
||||||
|
for (int i = 0; i < fields.Count; i++){
|
||||||
|
Field field = fields[i];
|
||||||
|
if (field.parentIndexes.Count == 0){
|
||||||
|
if (parent == null){
|
||||||
|
data += $"\n{GenerateStringTabs(field.parentIndexes.Count + 2)}{field.name}";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
int count = previousField.parentIndexes.Count - field.parentIndexes.Count;
|
||||||
|
while (count > 0){
|
||||||
|
data += $"\n{GenerateStringTabs(count + 1)}}}";
|
||||||
|
count--;
|
||||||
|
}
|
||||||
|
|
||||||
|
data += $"\n{GenerateStringTabs(field.parentIndexes.Count + 2)}{field.name}";
|
||||||
|
parent = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
previousField = field;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fields[field.parentIndexes.Last()].name != parent){
|
||||||
|
|
||||||
|
parent = fields[field.parentIndexes.Last()].name;
|
||||||
|
|
||||||
|
if (fields[field.parentIndexes.Last()] == previousField){
|
||||||
|
|
||||||
|
data += $"{{\n{GenerateStringTabs(field.parentIndexes.Count + 2)}{field.name}";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
int count = previousField.parentIndexes.Count - field.parentIndexes.Count;
|
||||||
|
while (count > 0){
|
||||||
|
data += $"\n{GenerateStringTabs(count + 1)}}}";
|
||||||
|
count--;
|
||||||
|
}
|
||||||
|
|
||||||
|
data += $"\n{GenerateStringTabs(field.parentIndexes.Count + 2)}{field.name}";
|
||||||
|
}
|
||||||
|
|
||||||
|
previousField = field;
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
data += $"\n{GenerateStringTabs(field.parentIndexes.Count + 2)}{field.name}";
|
||||||
|
previousField = field;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == fields.Count - 1){
|
||||||
|
int count = previousField.parentIndexes.Count;
|
||||||
|
while (count > 0){
|
||||||
|
data += $"\n{GenerateStringTabs(count + 1)}}}";
|
||||||
|
count--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
string arg = String.IsNullOrEmpty(args) ? "" : $"({args})";
|
||||||
|
string word;
|
||||||
|
switch (type){
|
||||||
|
case Type.Query:
|
||||||
|
word = "query";
|
||||||
|
break;
|
||||||
|
case Type.Mutation:
|
||||||
|
word = "mutation";
|
||||||
|
break;
|
||||||
|
case Type.Subscription:
|
||||||
|
word = "subscription";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
word = "query";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
query = data == null
|
||||||
|
? $"{word} {name}{{\n{GenerateStringTabs(1)}{queryString}{arg}\n}}"
|
||||||
|
: $"{word} {name}{{\n{GenerateStringTabs(1)}{queryString}{arg}{{{data}\n{GenerateStringTabs(1)}}}\n}}";
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GenerateStringTabs(int number){
|
||||||
|
string result = "";
|
||||||
|
for (int i = 0; i < number; i++){
|
||||||
|
result += " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class Field
|
||||||
|
{
|
||||||
|
public int index;
|
||||||
|
public int Index{
|
||||||
|
get => index;
|
||||||
|
set{
|
||||||
|
type = possibleFields[value].type;
|
||||||
|
name = possibleFields[value].name;
|
||||||
|
if (value != index)
|
||||||
|
hasChanged = true;
|
||||||
|
index = value;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string name;
|
||||||
|
public string type;
|
||||||
|
public List<int> parentIndexes;
|
||||||
|
public bool hasSubField;
|
||||||
|
public List<PossibleField> possibleFields;
|
||||||
|
|
||||||
|
public bool hasChanged;
|
||||||
|
|
||||||
|
public Field(){
|
||||||
|
possibleFields = new List<PossibleField>();
|
||||||
|
parentIndexes = new List<int>();
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CheckSubFields(Introspection.SchemaClass schemaClass){
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type t = schemaClass.data.__schema.types.Find((aType => aType.name == type));
|
||||||
|
if (t.fields == null || t.fields.Count == 0){
|
||||||
|
hasSubField = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
hasSubField = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class PossibleField
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
public string type;
|
||||||
|
|
||||||
|
public static implicit operator PossibleField(Field field){
|
||||||
|
return new PossibleField{name = field.name, type = field.type};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static explicit operator Field(Introspection.SchemaClass.Data.Schema.Type.Field schemaField){
|
||||||
|
Introspection.SchemaClass.Data.Schema.Type ofType = schemaField.type;
|
||||||
|
string typeName;
|
||||||
|
do{
|
||||||
|
typeName = ofType.name;
|
||||||
|
ofType = ofType.ofType;
|
||||||
|
} while (ofType != null);
|
||||||
|
return new Field{name = schemaField.name, type = typeName};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class EnumInputConverter : StringEnumConverter
|
||||||
|
{
|
||||||
|
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer){
|
||||||
|
if (value == null){
|
||||||
|
writer.WriteNull();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Enum @enum = (Enum) value;
|
||||||
|
string enumText = @enum.ToString("G");
|
||||||
|
writer.WriteRawValue(enumText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1ccf793b7ca1cc645b9cd36d753b8e3c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,226 @@
|
||||||
|
using System;
|
||||||
|
using System.Net.WebSockets;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using GraphQlClient.EventCallbacks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Networking;
|
||||||
|
|
||||||
|
namespace GraphQlClient.Core
|
||||||
|
{
|
||||||
|
public class HttpHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public static async Task<UnityWebRequest> PostAsync(string url, string details, string authToken = null){
|
||||||
|
string jsonData = JsonConvert.SerializeObject(new{query = details});
|
||||||
|
byte[] postData = Encoding.ASCII.GetBytes(jsonData);
|
||||||
|
UnityWebRequest request = UnityWebRequest.PostWwwForm(url, UnityWebRequest.kHttpVerbPOST);
|
||||||
|
request.uploadHandler = new UploadHandlerRaw(postData);
|
||||||
|
request.SetRequestHeader("Content-Type", "application/json");
|
||||||
|
if (!String.IsNullOrEmpty(authToken))
|
||||||
|
request.SetRequestHeader("Authorization", "Bearer " + authToken);
|
||||||
|
|
||||||
|
OnRequestBegin requestBegin = new OnRequestBegin();
|
||||||
|
requestBegin.FireEvent();
|
||||||
|
|
||||||
|
try{
|
||||||
|
await request.SendWebRequest();
|
||||||
|
}
|
||||||
|
catch(Exception e){
|
||||||
|
Debug.Log("Testing exceptions");
|
||||||
|
OnRequestEnded requestFailed = new OnRequestEnded(e);
|
||||||
|
requestFailed.FireEvent();
|
||||||
|
}
|
||||||
|
Debug.Log(request.downloadHandler.text);
|
||||||
|
|
||||||
|
OnRequestEnded requestSucceeded = new OnRequestEnded(request.downloadHandler.text);
|
||||||
|
requestSucceeded.FireEvent();
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<UnityWebRequest> PostAsync(UnityWebRequest request, string details){
|
||||||
|
string jsonData = JsonConvert.SerializeObject(new{query = details});
|
||||||
|
byte[] postData = Encoding.ASCII.GetBytes(jsonData);
|
||||||
|
request.uploadHandler = new UploadHandlerRaw(postData);
|
||||||
|
OnRequestBegin requestBegin = new OnRequestBegin();
|
||||||
|
requestBegin.FireEvent();
|
||||||
|
|
||||||
|
try{
|
||||||
|
await request.SendWebRequest();
|
||||||
|
}
|
||||||
|
catch(Exception e){
|
||||||
|
Debug.Log("Testing exceptions");
|
||||||
|
OnRequestEnded requestFailed = new OnRequestEnded(e);
|
||||||
|
requestFailed.FireEvent();
|
||||||
|
}
|
||||||
|
Debug.Log(request.downloadHandler.text);
|
||||||
|
|
||||||
|
OnRequestEnded requestSucceeded = new OnRequestEnded(request.downloadHandler.text);
|
||||||
|
requestSucceeded.FireEvent();
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static async Task<UnityWebRequest> GetAsync(string url, string authToken = null){
|
||||||
|
UnityWebRequest request = UnityWebRequest.Get(url);
|
||||||
|
if (!String.IsNullOrEmpty(authToken))
|
||||||
|
request.SetRequestHeader("Authorization", "Bearer " + authToken);
|
||||||
|
OnRequestBegin requestBegin = new OnRequestBegin();
|
||||||
|
requestBegin.FireEvent();
|
||||||
|
try{
|
||||||
|
await request.SendWebRequest();
|
||||||
|
}
|
||||||
|
catch(Exception e){
|
||||||
|
Debug.Log("Testing exceptions");
|
||||||
|
OnRequestEnded requestEnded = new OnRequestEnded(e);
|
||||||
|
requestEnded.FireEvent();
|
||||||
|
}
|
||||||
|
Debug.Log(request.downloadHandler.text);
|
||||||
|
OnRequestEnded requestSucceeded = new OnRequestEnded(request.downloadHandler.text);
|
||||||
|
requestSucceeded.FireEvent();
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Websocket
|
||||||
|
|
||||||
|
//Use this to subscribe to a graphql endpoint
|
||||||
|
public static async Task<ClientWebSocket> WebsocketConnect(string subscriptionUrl, string details, string authToken = null, string socketId = "1", string protocol = "graphql-ws"){
|
||||||
|
string subUrl = subscriptionUrl.Replace("http", "ws");
|
||||||
|
string id = socketId;
|
||||||
|
ClientWebSocket cws = new ClientWebSocket();
|
||||||
|
cws.Options.AddSubProtocol(protocol);
|
||||||
|
if (!String.IsNullOrEmpty(authToken))
|
||||||
|
cws.Options.SetRequestHeader("Authorization", "Bearer " + authToken);
|
||||||
|
Uri u = new Uri(subUrl);
|
||||||
|
try{
|
||||||
|
await cws.ConnectAsync(u, CancellationToken.None);
|
||||||
|
if (cws.State == WebSocketState.Open)
|
||||||
|
Debug.Log("connected");
|
||||||
|
await WebsocketInit(cws);
|
||||||
|
await WebsocketSend(cws, id, details);
|
||||||
|
}
|
||||||
|
catch (Exception e){
|
||||||
|
Debug.Log("woe " + e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cws;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<ClientWebSocket> WebsocketConnect(ClientWebSocket cws, string subscriptionUrl, string details, string socketId = "1"){
|
||||||
|
string subUrl = subscriptionUrl.Replace("http", "ws");
|
||||||
|
string id = socketId;
|
||||||
|
Uri u = new Uri(subUrl);
|
||||||
|
try{
|
||||||
|
await cws.ConnectAsync(u, CancellationToken.None);
|
||||||
|
if (cws.State == WebSocketState.Open)
|
||||||
|
Debug.Log("connected");
|
||||||
|
await WebsocketInit(cws);
|
||||||
|
await WebsocketSend(cws, id, details);
|
||||||
|
}
|
||||||
|
catch (Exception e){
|
||||||
|
Debug.Log("woe " + e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return cws;
|
||||||
|
}
|
||||||
|
|
||||||
|
static async Task WebsocketInit(ClientWebSocket cws){
|
||||||
|
string jsonData = "{\"type\":\"connection_init\"}";
|
||||||
|
ArraySegment<byte> b = new ArraySegment<byte>(Encoding.ASCII.GetBytes(jsonData));
|
||||||
|
await cws.SendAsync(b, WebSocketMessageType.Text, true, CancellationToken.None);
|
||||||
|
GetWsReturn(cws);
|
||||||
|
}
|
||||||
|
|
||||||
|
static async Task WebsocketSend(ClientWebSocket cws, string id, string details){
|
||||||
|
string jsonData = JsonConvert.SerializeObject(new {id = $"{id}", type = "start", payload = new{query = details}});
|
||||||
|
ArraySegment<byte> b = new ArraySegment<byte>(Encoding.ASCII.GetBytes(jsonData));
|
||||||
|
await cws.SendAsync(b, WebSocketMessageType.Text, true, CancellationToken.None);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Call GetWsReturn to wait for a message from a websocket. GetWsReturn has to be called for each message
|
||||||
|
static async void GetWsReturn(ClientWebSocket cws){
|
||||||
|
ArraySegment<byte> buf = new ArraySegment<byte>(new byte[1024]);
|
||||||
|
buf = WebSocket.CreateClientBuffer(1024, 1024);
|
||||||
|
WebSocketReceiveResult r;
|
||||||
|
string result = "";
|
||||||
|
do{
|
||||||
|
r = await cws.ReceiveAsync(buf, CancellationToken.None);
|
||||||
|
result += Encoding.UTF8.GetString(buf.Array ?? throw new ApplicationException("Buf = null"), buf.Offset,
|
||||||
|
r.Count);
|
||||||
|
} while (!r.EndOfMessage);
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(result))
|
||||||
|
return;
|
||||||
|
JObject obj = new JObject();
|
||||||
|
try{
|
||||||
|
obj = JObject.Parse(result);
|
||||||
|
}
|
||||||
|
catch (JsonReaderException e){
|
||||||
|
throw new ApplicationException(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
string subType = (string) obj["type"];
|
||||||
|
switch (subType){
|
||||||
|
case "connection_ack":
|
||||||
|
{
|
||||||
|
Debug.Log("init_success, the handshake is complete");
|
||||||
|
OnSubscriptionHandshakeComplete subscriptionHandshakeComplete =
|
||||||
|
new OnSubscriptionHandshakeComplete();
|
||||||
|
subscriptionHandshakeComplete.FireEvent();
|
||||||
|
GetWsReturn(cws);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "error":
|
||||||
|
{
|
||||||
|
throw new ApplicationException("The handshake failed. Error: " + result);
|
||||||
|
}
|
||||||
|
case "connection_error":
|
||||||
|
{
|
||||||
|
throw new ApplicationException("The handshake failed. Error: " + result);
|
||||||
|
}
|
||||||
|
case "data":
|
||||||
|
{
|
||||||
|
OnSubscriptionDataReceived subscriptionDataReceived = new OnSubscriptionDataReceived(result);
|
||||||
|
subscriptionDataReceived.FireEvent();
|
||||||
|
GetWsReturn(cws);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "ka":
|
||||||
|
{
|
||||||
|
GetWsReturn(cws);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "subscription_fail":
|
||||||
|
{
|
||||||
|
throw new ApplicationException("The subscription data failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task WebsocketDisconnect(ClientWebSocket cws, string socketId = "1"){
|
||||||
|
string jsonData = $"{{\"type\":\"stop\",\"id\":\"{socketId}\"}}";
|
||||||
|
ArraySegment<byte> b = new ArraySegment<byte>(Encoding.ASCII.GetBytes(jsonData));
|
||||||
|
await cws.SendAsync(b, WebSocketMessageType.Text, true, CancellationToken.None);
|
||||||
|
await cws.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closed", CancellationToken.None);
|
||||||
|
OnSubscriptionCanceled subscriptionCanceled = new OnSubscriptionCanceled();
|
||||||
|
subscriptionCanceled.FireEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Utility
|
||||||
|
|
||||||
|
public static string FormatJson(string json)
|
||||||
|
{
|
||||||
|
var parsedJson = JsonConvert.DeserializeObject(json);
|
||||||
|
return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fc0cee1222b285b409e1daf964e1d8a9
|
||||||
|
timeCreated: 1502459663
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,106 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace GraphQlClient.Core
|
||||||
|
{
|
||||||
|
public static class Introspection
|
||||||
|
{
|
||||||
|
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}";
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class SchemaClass
|
||||||
|
{
|
||||||
|
public Data data;
|
||||||
|
public class Data
|
||||||
|
{
|
||||||
|
public Schema __schema;
|
||||||
|
public class Schema
|
||||||
|
{
|
||||||
|
public List<Type> types;
|
||||||
|
public Type queryType;
|
||||||
|
public Type mutationType;
|
||||||
|
public Type subscriptionType;
|
||||||
|
public List<Directive> directives;
|
||||||
|
|
||||||
|
|
||||||
|
public class Directive
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
public string description;
|
||||||
|
public List<InputValue> args;
|
||||||
|
public List<DirectiveLocation> locations;
|
||||||
|
|
||||||
|
public enum DirectiveLocation
|
||||||
|
{
|
||||||
|
QUERY,
|
||||||
|
MUTATION,
|
||||||
|
SUBSCRIPTION,
|
||||||
|
FIELD,
|
||||||
|
FRAGMENT_DEFINITION,
|
||||||
|
FRAGMENT_SPREAD,
|
||||||
|
INLINE_FRAGMENT,
|
||||||
|
SCHEMA,
|
||||||
|
SCALAR,
|
||||||
|
OBJECT,
|
||||||
|
FIELD_DEFINITION,
|
||||||
|
ARGUMENT_DEFINITION,
|
||||||
|
INTERFACE,
|
||||||
|
UNION,
|
||||||
|
ENUM,
|
||||||
|
ENUM_VALUE,
|
||||||
|
INPUT_OBJECT,
|
||||||
|
INPUT_FIELD_DEFINITION
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class Type
|
||||||
|
{
|
||||||
|
public TypeKind kind;
|
||||||
|
public string name;
|
||||||
|
public string description;
|
||||||
|
public List<Field> fields;
|
||||||
|
public List<Type> interfaces;
|
||||||
|
public List<Type> possibleTypes;
|
||||||
|
public List<EnumValue> enumValues;
|
||||||
|
public List<InputValue> inputFields;
|
||||||
|
public Type ofType;
|
||||||
|
|
||||||
|
public class Field
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
public string description;
|
||||||
|
public List<InputValue> args;
|
||||||
|
public Type type;
|
||||||
|
public bool isDeprecated;
|
||||||
|
public string deprecationReason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EnumValue
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
public string description;
|
||||||
|
public bool isDeprecated;
|
||||||
|
public string deprecationReason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TypeKind
|
||||||
|
{
|
||||||
|
SCALAR, OBJECT, INTERFACE, UNION, ENUM, INPUT_OBJECT, LIST, NON_NULL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class InputValue
|
||||||
|
{
|
||||||
|
public string name;
|
||||||
|
public string description;
|
||||||
|
public Type type;
|
||||||
|
public string defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3be4bb28621ed8e40a42ccc0b5932535
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b5fd99f1168ef914ba313ed32acee810
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,173 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using GraphQlClient.Core;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace GraphQlClient.Editor
|
||||||
|
{
|
||||||
|
[CustomEditor(typeof(GraphApi))]
|
||||||
|
public class GraphApiEditor : UnityEditor.Editor
|
||||||
|
{
|
||||||
|
private int index;
|
||||||
|
|
||||||
|
public override void OnInspectorGUI(){
|
||||||
|
GraphApi graph = (GraphApi) target;
|
||||||
|
GUIStyle style = new GUIStyle{fontSize = 15, alignment = TextAnchor.MiddleCenter};
|
||||||
|
EditorGUILayout.LabelField(graph.name, style);
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
graph.GetSchema();
|
||||||
|
if (GUILayout.Button("Reset")){
|
||||||
|
graph.DeleteAllQueries();
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
graph.url = EditorGUILayout.TextField("Url", graph.url);
|
||||||
|
if (GUILayout.Button("Introspect")){
|
||||||
|
graph.Introspect();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (graph.loading){
|
||||||
|
EditorGUILayout.LabelField("API is being introspected. Please wait...");
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
if (graph.schemaClass == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
if (GUILayout.Button("Create New Query")){
|
||||||
|
graph.CreateNewQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GUILayout.Button("Create New Mutation")){
|
||||||
|
graph.CreateNewMutation();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GUILayout.Button("Create New Subscription")){
|
||||||
|
graph.CreateNewSubscription();
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
|
DisplayFields(graph, graph.queries, "Query");
|
||||||
|
DisplayFields(graph, graph.mutations, "Mutation");
|
||||||
|
DisplayFields(graph, graph.subscriptions, "Subscription");
|
||||||
|
|
||||||
|
EditorUtility.SetDirty(graph);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisplayFields(GraphApi graph, List<GraphApi.Query> queryList, string type){
|
||||||
|
if (queryList != null){
|
||||||
|
if (queryList.Count > 0)
|
||||||
|
EditorGUILayout.LabelField(type);
|
||||||
|
for (int i = 0; i < queryList.Count; i++){
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
GraphApi.Query query = queryList[i];
|
||||||
|
query.name = EditorGUILayout.TextField($"{type} Name", query.name);
|
||||||
|
string[] options = query.queryOptions.ToArray();
|
||||||
|
if (String.IsNullOrEmpty(query.returnType)){
|
||||||
|
index = EditorGUILayout.Popup(type, index, options);
|
||||||
|
query.queryString = options[index];
|
||||||
|
EditorGUILayout.LabelField(options[index]);
|
||||||
|
if (GUILayout.Button($"Confirm {type}")){
|
||||||
|
graph.GetQueryReturnType(query, options[index]);
|
||||||
|
}
|
||||||
|
if (GUILayout.Button("Delete")){
|
||||||
|
graph.DeleteQuery(queryList, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (query.isComplete){
|
||||||
|
GUILayout.Label(query.query);
|
||||||
|
if (query.fields.Count > 0){
|
||||||
|
if (GUILayout.Button($"Edit {type}")){
|
||||||
|
graph.EditQuery(query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GUILayout.Button("Delete")){
|
||||||
|
graph.DeleteQuery(queryList, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
EditorGUILayout.LabelField(query.queryString,
|
||||||
|
$"Return Type: {query.returnType}");
|
||||||
|
if (graph.CheckSubFields(query.returnType)){
|
||||||
|
if (GUILayout.Button("Create Field")){
|
||||||
|
graph.GetQueryReturnType(query, options[index]);
|
||||||
|
graph.AddField(query, query.returnType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
foreach (GraphApi.Field field in query.fields){
|
||||||
|
GUI.color = new Color(0.8f,0.8f,0.8f);
|
||||||
|
string[] fieldOptions = field.possibleFields.Select((aField => aField.name)).ToArray();
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
GUIStyle fieldStyle = EditorStyles.popup;
|
||||||
|
fieldStyle.contentOffset = new Vector2(field.parentIndexes.Count * 20, 0);
|
||||||
|
field.Index = EditorGUILayout.Popup(field.Index, fieldOptions, fieldStyle);
|
||||||
|
GUI.color = Color.white;
|
||||||
|
field.CheckSubFields(graph.schemaClass);
|
||||||
|
if (field.hasSubField){
|
||||||
|
if (GUILayout.Button("Create Sub Field")){
|
||||||
|
graph.AddField(query, field.possibleFields[field.Index].type, field);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GUILayout.Button("x", GUILayout.MaxWidth(20))){
|
||||||
|
int parentIndex = query.fields.FindIndex(aField => aField == field);
|
||||||
|
query.fields.RemoveAll(afield => afield.parentIndexes.Contains(parentIndex));
|
||||||
|
query.fields.Remove(field);
|
||||||
|
field.hasChanged = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
if (field.hasChanged){
|
||||||
|
int parentIndex = query.fields.FindIndex(aField => aField == field);
|
||||||
|
query.fields.RemoveAll(afield => afield.parentIndexes.Contains(parentIndex));
|
||||||
|
field.hasChanged = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
|
||||||
|
if (query.fields.Count > 0){
|
||||||
|
if (GUILayout.Button($"Preview {type}")){
|
||||||
|
query.CompleteQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GUILayout.Button("Delete")){
|
||||||
|
graph.DeleteQuery(queryList, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUILayout.Space();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 142ca5c12af0fd24987915482cf47e11
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3546928e26cde504195faf9e870fc073
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,55 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace GraphQlClient.EventCallbacks
|
||||||
|
{
|
||||||
|
#region Network
|
||||||
|
|
||||||
|
public class OnRequestBegin : Event<OnRequestBegin>
|
||||||
|
{
|
||||||
|
public OnRequestBegin(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnRequestEnded : Event<OnRequestEnded>
|
||||||
|
{
|
||||||
|
public string data;
|
||||||
|
public bool success;
|
||||||
|
public Exception exception;
|
||||||
|
public OnRequestEnded(string data){
|
||||||
|
this.data = data;
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OnRequestEnded(Exception exception){
|
||||||
|
this.exception = exception;
|
||||||
|
success = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnSubscriptionHandshakeComplete : Event<OnSubscriptionHandshakeComplete>
|
||||||
|
{
|
||||||
|
|
||||||
|
public OnSubscriptionHandshakeComplete(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnSubscriptionDataReceived : Event<OnSubscriptionDataReceived>
|
||||||
|
{
|
||||||
|
public string data;
|
||||||
|
|
||||||
|
public OnSubscriptionDataReceived(string data){
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnSubscriptionCanceled : Event<OnSubscriptionCanceled>
|
||||||
|
{
|
||||||
|
public OnSubscriptionCanceled(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fc79693e55923d04ba34f1f874db8a71
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,37 @@
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace GraphQlClient.EventCallbacks
|
||||||
|
{
|
||||||
|
public abstract class Event<T> where T : Event<T> {
|
||||||
|
/*
|
||||||
|
* The base Event,
|
||||||
|
* might have some generic text
|
||||||
|
* for doing Debug.Log?
|
||||||
|
*/
|
||||||
|
public string Description;
|
||||||
|
|
||||||
|
private bool hasFired;
|
||||||
|
public delegate void EventListener(T info);
|
||||||
|
private static event EventListener listeners;
|
||||||
|
|
||||||
|
public static void RegisterListener(EventListener listener) {
|
||||||
|
listeners += listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnregisterListener(EventListener listener) {
|
||||||
|
listeners -= listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FireEvent() {
|
||||||
|
if (hasFired) {
|
||||||
|
throw new Exception("This event has already fired, to prevent infinite loops you can't refire an event");
|
||||||
|
}
|
||||||
|
hasFired = true;
|
||||||
|
if (listeners != null) {
|
||||||
|
listeners(this as T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2f79f6ed04a7de5479938dddda6e335b
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -15,11 +15,11 @@
|
||||||
"hash": "ec68815a20a955e699fa613ce243cec12f820636"
|
"hash": "ec68815a20a955e699fa613ce243cec12f820636"
|
||||||
},
|
},
|
||||||
"com.unity.2d.animation": {
|
"com.unity.2d.animation": {
|
||||||
"version": "9.1.0",
|
"version": "9.0.4",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.2d.common": "8.0.2",
|
"com.unity.2d.common": "8.0.1",
|
||||||
"com.unity.2d.sprite": "1.0.0",
|
"com.unity.2d.sprite": "1.0.0",
|
||||||
"com.unity.collections": "1.1.0",
|
"com.unity.collections": "1.1.0",
|
||||||
"com.unity.modules.animation": "1.0.0",
|
"com.unity.modules.animation": "1.0.0",
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.2d.aseprite": {
|
"com.unity.2d.aseprite": {
|
||||||
"version": "1.1.2",
|
"version": "1.0.1",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.2d.common": {
|
"com.unity.2d.common": {
|
||||||
"version": "8.0.2",
|
"version": "8.0.1",
|
||||||
"depth": 2,
|
"depth": 2,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -60,12 +60,12 @@
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.2d.psdimporter": {
|
"com.unity.2d.psdimporter": {
|
||||||
"version": "8.0.4",
|
"version": "8.0.2",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.2d.animation": "9.1.0",
|
"com.unity.2d.animation": "9.0.1",
|
||||||
"com.unity.2d.common": "8.0.2",
|
"com.unity.2d.common": "8.0.1",
|
||||||
"com.unity.2d.sprite": "1.0.0"
|
"com.unity.2d.sprite": "1.0.0"
|
||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
|
@ -109,12 +109,11 @@
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.burst": {
|
"com.unity.burst": {
|
||||||
"version": "1.8.13",
|
"version": "1.8.9",
|
||||||
"depth": 3,
|
"depth": 3,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.mathematics": "1.2.1",
|
"com.unity.mathematics": "1.2.1"
|
||||||
"com.unity.modules.jsonserialize": "1.0.0"
|
|
||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
|
@ -154,14 +153,14 @@
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "builtin",
|
"source": "builtin",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.2d.animation": "9.1.0",
|
"com.unity.2d.animation": "9.0.4",
|
||||||
"com.unity.2d.pixel-perfect": "5.0.3",
|
"com.unity.2d.pixel-perfect": "5.0.3",
|
||||||
"com.unity.2d.psdimporter": "8.0.4",
|
"com.unity.2d.psdimporter": "8.0.2",
|
||||||
"com.unity.2d.sprite": "1.0.0",
|
"com.unity.2d.sprite": "1.0.0",
|
||||||
"com.unity.2d.spriteshape": "9.0.2",
|
"com.unity.2d.spriteshape": "9.0.2",
|
||||||
"com.unity.2d.tilemap": "1.0.0",
|
"com.unity.2d.tilemap": "1.0.0",
|
||||||
"com.unity.2d.tilemap.extras": "3.1.2",
|
"com.unity.2d.tilemap.extras": "3.1.2",
|
||||||
"com.unity.2d.aseprite": "1.1.2"
|
"com.unity.2d.aseprite": "1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"com.unity.feature.development": {
|
"com.unity.feature.development": {
|
||||||
|
@ -170,16 +169,16 @@
|
||||||
"source": "builtin",
|
"source": "builtin",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.ide.visualstudio": "2.0.22",
|
"com.unity.ide.visualstudio": "2.0.22",
|
||||||
"com.unity.ide.rider": "3.0.28",
|
"com.unity.ide.rider": "3.0.26",
|
||||||
"com.unity.ide.vscode": "1.2.5",
|
"com.unity.ide.vscode": "1.2.5",
|
||||||
"com.unity.editorcoroutines": "1.0.0",
|
"com.unity.editorcoroutines": "1.0.0",
|
||||||
"com.unity.performance.profile-analyzer": "1.2.2",
|
"com.unity.performance.profile-analyzer": "1.2.2",
|
||||||
"com.unity.test-framework": "1.1.33",
|
"com.unity.test-framework": "1.1.33",
|
||||||
"com.unity.testtools.codecoverage": "1.2.5"
|
"com.unity.testtools.codecoverage": "1.2.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"com.unity.ide.rider": {
|
"com.unity.ide.rider": {
|
||||||
"version": "3.0.28",
|
"version": "3.0.26",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -243,7 +242,7 @@
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
"com.unity.testtools.codecoverage": {
|
"com.unity.testtools.codecoverage": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.4",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
"source": "registry",
|
"source": "registry",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
m_EditorVersion: 2022.3.23f1
|
m_EditorVersion: 2022.3.13f1
|
||||||
m_EditorVersionWithRevision: 2022.3.23f1 (dbb3f7c5b5c6)
|
m_EditorVersionWithRevision: 2022.3.13f1 (5f90a5ebde0f)
|
||||||
|
|
Loading…
Reference in New Issue