├── .gitignore ├── Assets ├── Experiments.meta ├── Experiments │ ├── JSON.meta │ └── JSON │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── JsonSchemaTest.cs │ │ ├── JsonSchemaTest.cs.meta │ │ ├── New Json Schema Test.asset │ │ └── New Json Schema Test.asset.meta │ │ ├── JsonNetSandbox.unity │ │ ├── JsonNetSandbox.unity.meta │ │ ├── JsonNetTesting.cs │ │ ├── JsonNetTesting.cs.meta │ │ ├── JsontTestObject.cs │ │ ├── JsontTestObject.cs.meta │ │ ├── output.json │ │ └── output.json.meta ├── Extensions.meta ├── JsonDotNet.meta ├── JsonDotNet │ ├── Assemblies.meta │ ├── Assemblies │ │ ├── AOT.meta │ │ ├── AOT │ │ │ ├── Newtonsoft.Json.XML │ │ │ ├── Newtonsoft.Json.XML.meta │ │ │ ├── Newtonsoft.Json.dll │ │ │ └── Newtonsoft.Json.dll.meta │ │ ├── Standalone.meta │ │ ├── Standalone │ │ │ ├── Newtonsoft.Json.XML │ │ │ ├── Newtonsoft.Json.XML.meta │ │ │ ├── Newtonsoft.Json.dll │ │ │ └── Newtonsoft.Json.dll.meta │ │ ├── Windows.meta │ │ └── Windows │ │ │ ├── Newtonsoft.Json.XML │ │ │ ├── Newtonsoft.Json.XML.meta │ │ │ ├── Newtonsoft.Json.dll │ │ │ └── Newtonsoft.Json.dll.meta │ ├── Documentation.meta │ ├── Documentation │ │ ├── Json Net for Unity 2.0.1.pdf │ │ └── Json Net for Unity 2.0.1.pdf.meta │ ├── JsonDotNet201Source.zip │ ├── JsonDotNet201Source.zip.meta │ ├── link.xml │ └── link.xml.meta ├── PetStore.meta ├── PetStore │ ├── PetshopConsumeExample.cs │ ├── PetshopConsumeExample.cs.meta │ ├── Swagger Petstore.asset │ ├── Swagger Petstore.asset.meta │ ├── _pets.asset │ ├── _pets.asset.meta │ ├── _pets_{id}.asset │ ├── _pets_{id}.asset.meta │ ├── data_model.meta │ └── data_model │ │ ├── Pet.cs │ │ └── Pet.cs.meta ├── RestClient.meta ├── RestClient │ ├── DemoScene.meta │ ├── DemoScene │ │ ├── Demo.unity │ │ ├── Demo.unity.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ │ ├── MainScript.cs │ │ │ ├── MainScript.cs.meta │ │ │ ├── Model.meta │ │ │ └── Model │ │ │ ├── Photo.cs │ │ │ ├── Photo.cs.meta │ │ │ ├── Post.cs │ │ │ ├── Post.cs.meta │ │ │ ├── Todo.cs │ │ │ ├── Todo.cs.meta │ │ │ ├── User.cs │ │ │ └── User.cs.meta │ ├── Packages.meta │ ├── Packages │ │ ├── Proyecto26.RestClient.meta │ │ ├── Proyecto26.RestClient │ │ │ ├── RestClient.asmdef │ │ │ ├── RestClient.asmdef.meta │ │ │ ├── RestClient.cs │ │ │ ├── RestClient.cs.meta │ │ │ ├── Utils.meta │ │ │ └── Utils │ │ │ │ ├── CoroutineHolder.cs │ │ │ │ ├── CoroutineHolder.cs.meta │ │ │ │ ├── Extensions.cs │ │ │ │ ├── Extensions.cs.meta │ │ │ │ ├── HttpBase.cs │ │ │ │ ├── HttpBase.cs.meta │ │ │ │ ├── JsonHelper.cs │ │ │ │ ├── JsonHelper.cs.meta │ │ │ │ ├── RequestException.cs │ │ │ │ ├── RequestException.cs.meta │ │ │ │ ├── RequestHelper.cs │ │ │ │ ├── RequestHelper.cs.meta │ │ │ │ ├── ResponseHelper.cs │ │ │ │ ├── ResponseHelper.cs.meta │ │ │ │ ├── StaticCoroutine.cs │ │ │ │ └── StaticCoroutine.cs.meta │ │ ├── RSG.Promise.dll │ │ └── RSG.Promise.dll.meta │ ├── RestClient.pdf │ └── RestClient.pdf.meta ├── Scenes.meta ├── Scenes │ ├── ApiTesting.unity │ └── ApiTesting.unity.meta ├── UnityOpenApi.meta └── UnityOpenApi │ ├── Editor.meta │ ├── Editor │ ├── Api Parser.asset │ ├── Api Parser.asset.meta │ ├── AssetsHelper.cs │ ├── AssetsHelper.cs.meta │ ├── Example APIs.meta │ ├── Example APIs │ │ ├── justeat.json │ │ ├── justeat.json.meta │ │ ├── petstore_json.json │ │ ├── petstore_json.json.meta │ │ ├── petstore_yaml.yaml │ │ └── petstore_yaml.yaml.meta │ ├── HTTP.asset │ ├── HTTP.asset.meta │ ├── OpenApiParser.cs │ └── OpenApiParser.cs.meta │ ├── Microsoft.meta │ ├── Microsoft │ ├── OpenApi.meta │ └── OpenApi │ │ ├── net46.meta │ │ └── net46 │ │ ├── Microsoft.OpenApi.Readers.dll │ │ ├── Microsoft.OpenApi.Readers.dll.meta │ │ ├── Microsoft.OpenApi.dll │ │ ├── Microsoft.OpenApi.dll.meta │ │ ├── Microsoft.OpenApi.xml │ │ ├── Microsoft.OpenApi.xml.meta │ │ ├── SharpYaml.dll │ │ └── SharpYaml.dll.meta │ ├── Scripts.meta │ └── Scripts │ ├── ApiAsset.cs │ ├── ApiAsset.cs.meta │ ├── OAContact.cs │ ├── OAContact.cs.meta │ ├── OAExternalDocs.cs │ ├── OAExternalDocs.cs.meta │ ├── OAInfo.cs │ ├── OAInfo.cs.meta │ ├── OALicense.cs │ ├── OALicense.cs.meta │ ├── OAOperation.cs │ ├── OAOperation.cs.meta │ ├── OAParameter.cs │ ├── OAParameter.cs.meta │ ├── OAParameterLocation.cs │ ├── OAParameterLocation.cs.meta │ ├── OAReference.cs │ ├── OAReference.cs.meta │ ├── OAReferenceType.cs │ ├── OAReferenceType.cs.meta │ ├── OARequestBody.cs │ ├── OARequestBody.cs.meta │ ├── OAServer.cs │ ├── OAServer.cs.meta │ ├── OAServerVariable.cs │ ├── OAServerVariable.cs.meta │ ├── OATag.cs │ ├── OATag.cs.meta │ ├── OperationType.cs │ ├── OperationType.cs.meta │ ├── ParametersValues.cs │ ├── ParametersValues.cs.meta │ ├── PathItemAsset.cs │ ├── PathItemAsset.cs.meta │ ├── UnityOpenApi.asmdef │ └── UnityOpenApi.asmdef.meta ├── LICENSE ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset └── VFXManager.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | [Ll]ogs/ 7 | 8 | # Never ignore Asset meta data 9 | ![Aa]ssets/**/*.meta 10 | 11 | # Uncomment this line if you wish to ignore the asset store tools plugin 12 | # [Aa]ssets/AssetStoreTools* 13 | 14 | # Visual Studio cache directory 15 | .vs/ 16 | 17 | # Gradle cache directory 18 | .gradle/ 19 | 20 | # Autogenerated VS/MD/Consulo solution and project files 21 | ExportedObj/ 22 | .consulo/ 23 | *.csproj 24 | *.unityproj 25 | *.sln 26 | *.suo 27 | *.tmp 28 | *.user 29 | *.userprefs 30 | *.pidb 31 | *.booproj 32 | *.svd 33 | *.pdb 34 | *.mdb 35 | *.opendb 36 | *.VC.db 37 | 38 | # Unity3D generated meta files 39 | *.pidb.meta 40 | *.pdb.meta 41 | *.mdb.meta 42 | 43 | # Unity3D generated file on crash reports 44 | sysinfo.txt 45 | 46 | # Builds 47 | *.apk 48 | *.unitypackage 49 | 50 | # Crashlytics generated file 51 | crashlytics-build.properties 52 | 53 | # Custom 54 | [Aa]ssets/Apis 55 | [Aa]ssets/Apis.meta 56 | [Aa]ssets/Experiments 57 | [Aa]ssets/Experiments.meta -------------------------------------------------------------------------------- /Assets/Experiments.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56ba312de03e4c740a98b026b138f531 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75ac6e7b07e38c845bcb1aa4df62d67b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7368ed2e01688c4ca74ea9ef55f27de 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/Editor/JsonSchemaTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using Newtonsoft.Json; 6 | 7 | [CreateAssetMenu(menuName ="JSON TESTING/testing")] 8 | public class JsonSchemaTest : ScriptableObject 9 | { 10 | public TextAsset openApi3Schema; 11 | public TextAsset jsonFile; 12 | 13 | public void Test() 14 | { 15 | var j = JsonConvert.DeserializeObject(jsonFile.text); 16 | Debug.Log(j); 17 | } 18 | } 19 | 20 | [CustomEditor(typeof(JsonSchemaTest))] 21 | public class JsonSchemaTestEditor : Editor 22 | { 23 | public override void OnInspectorGUI() 24 | { 25 | base.OnInspectorGUI(); 26 | var t = (JsonSchemaTest)target; 27 | if(GUILayout.Button("Test")) 28 | { 29 | t.Test(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/Editor/JsonSchemaTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9ce085036071704080282f5b1987094 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/Editor/New Json Schema Test.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: c9ce085036071704080282f5b1987094, type: 3} 13 | m_Name: New Json Schema Test 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/Editor/New Json Schema Test.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b058b8d64ba057849b047fef0c0b1331 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/JsonNetSandbox.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 170076734} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 10 60 | m_AtlasSize: 512 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 1 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 256 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 1 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &170076733 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 170076735} 124 | - component: {fileID: 170076734} 125 | m_Layer: 0 126 | m_Name: Directional Light 127 | m_TagString: Untagged 128 | m_Icon: {fileID: 0} 129 | m_NavMeshLayer: 0 130 | m_StaticEditorFlags: 0 131 | m_IsActive: 1 132 | --- !u!108 &170076734 133 | Light: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInstance: {fileID: 0} 137 | m_PrefabAsset: {fileID: 0} 138 | m_GameObject: {fileID: 170076733} 139 | m_Enabled: 1 140 | serializedVersion: 8 141 | m_Type: 1 142 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 143 | m_Intensity: 1 144 | m_Range: 10 145 | m_SpotAngle: 30 146 | m_CookieSize: 10 147 | m_Shadows: 148 | m_Type: 2 149 | m_Resolution: -1 150 | m_CustomResolution: -1 151 | m_Strength: 1 152 | m_Bias: 0.05 153 | m_NormalBias: 0.4 154 | m_NearPlane: 0.2 155 | m_Cookie: {fileID: 0} 156 | m_DrawHalo: 0 157 | m_Flare: {fileID: 0} 158 | m_RenderMode: 0 159 | m_CullingMask: 160 | serializedVersion: 2 161 | m_Bits: 4294967295 162 | m_Lightmapping: 1 163 | m_LightShadowCasterMode: 0 164 | m_AreaSize: {x: 1, y: 1} 165 | m_BounceIntensity: 1 166 | m_ColorTemperature: 6570 167 | m_UseColorTemperature: 0 168 | m_ShadowRadius: 0 169 | m_ShadowAngle: 0 170 | --- !u!4 &170076735 171 | Transform: 172 | m_ObjectHideFlags: 0 173 | m_CorrespondingSourceObject: {fileID: 0} 174 | m_PrefabInstance: {fileID: 0} 175 | m_PrefabAsset: {fileID: 0} 176 | m_GameObject: {fileID: 170076733} 177 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 178 | m_LocalPosition: {x: 0, y: 3, z: 0} 179 | m_LocalScale: {x: 1, y: 1, z: 1} 180 | m_Children: [] 181 | m_Father: {fileID: 0} 182 | m_RootOrder: 1 183 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 184 | --- !u!1 &197851541 185 | GameObject: 186 | m_ObjectHideFlags: 0 187 | m_CorrespondingSourceObject: {fileID: 0} 188 | m_PrefabInstance: {fileID: 0} 189 | m_PrefabAsset: {fileID: 0} 190 | serializedVersion: 6 191 | m_Component: 192 | - component: {fileID: 197851544} 193 | - component: {fileID: 197851543} 194 | - component: {fileID: 197851542} 195 | - component: {fileID: 197851545} 196 | m_Layer: 0 197 | m_Name: Api 198 | m_TagString: Untagged 199 | m_Icon: {fileID: 0} 200 | m_NavMeshLayer: 0 201 | m_StaticEditorFlags: 0 202 | m_IsActive: 1 203 | --- !u!114 &197851542 204 | MonoBehaviour: 205 | m_ObjectHideFlags: 0 206 | m_CorrespondingSourceObject: {fileID: 0} 207 | m_PrefabInstance: {fileID: 0} 208 | m_PrefabAsset: {fileID: 0} 209 | m_GameObject: {fileID: 197851541} 210 | m_Enabled: 1 211 | m_EditorHideFlags: 0 212 | m_Script: {fileID: 11500000, guid: 24ff16db1efd3084299d1b12d8959c49, type: 3} 213 | m_Name: 214 | m_EditorClassIdentifier: 215 | apiResource: {fileID: 0} 216 | --- !u!114 &197851543 217 | MonoBehaviour: 218 | m_ObjectHideFlags: 0 219 | m_CorrespondingSourceObject: {fileID: 0} 220 | m_PrefabInstance: {fileID: 0} 221 | m_PrefabAsset: {fileID: 0} 222 | m_GameObject: {fileID: 197851541} 223 | m_Enabled: 1 224 | m_EditorHideFlags: 0 225 | m_Script: {fileID: 11500000, guid: aa718f3e195cb7e4880a5e14a85faa1c, type: 3} 226 | m_Name: 227 | m_EditorClassIdentifier: 228 | apiConfig: {fileID: 0} 229 | --- !u!4 &197851544 230 | Transform: 231 | m_ObjectHideFlags: 0 232 | m_CorrespondingSourceObject: {fileID: 0} 233 | m_PrefabInstance: {fileID: 0} 234 | m_PrefabAsset: {fileID: 0} 235 | m_GameObject: {fileID: 197851541} 236 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 237 | m_LocalPosition: {x: 0, y: 0, z: 0} 238 | m_LocalScale: {x: 1, y: 1, z: 1} 239 | m_Children: [] 240 | m_Father: {fileID: 0} 241 | m_RootOrder: 3 242 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 243 | --- !u!114 &197851545 244 | MonoBehaviour: 245 | m_ObjectHideFlags: 0 246 | m_CorrespondingSourceObject: {fileID: 0} 247 | m_PrefabInstance: {fileID: 0} 248 | m_PrefabAsset: {fileID: 0} 249 | m_GameObject: {fileID: 197851541} 250 | m_Enabled: 1 251 | m_EditorHideFlags: 0 252 | m_Script: {fileID: 11500000, guid: 943821442f3dffc4790885a235a3066f, type: 3} 253 | m_Name: 254 | m_EditorClassIdentifier: 255 | authApiResource: {fileID: 11400000, guid: 9776033817cce5f4b9c4c2833283ce3e, type: 2} 256 | apiHeaderAuthorizer: {fileID: 11400000, guid: 386b604548d78a14a8c068a428f097fd, 257 | type: 2} 258 | --- !u!1 &534669902 259 | GameObject: 260 | m_ObjectHideFlags: 0 261 | m_CorrespondingSourceObject: {fileID: 0} 262 | m_PrefabInstance: {fileID: 0} 263 | m_PrefabAsset: {fileID: 0} 264 | serializedVersion: 6 265 | m_Component: 266 | - component: {fileID: 534669905} 267 | - component: {fileID: 534669904} 268 | - component: {fileID: 534669903} 269 | m_Layer: 0 270 | m_Name: Main Camera 271 | m_TagString: MainCamera 272 | m_Icon: {fileID: 0} 273 | m_NavMeshLayer: 0 274 | m_StaticEditorFlags: 0 275 | m_IsActive: 1 276 | --- !u!81 &534669903 277 | AudioListener: 278 | m_ObjectHideFlags: 0 279 | m_CorrespondingSourceObject: {fileID: 0} 280 | m_PrefabInstance: {fileID: 0} 281 | m_PrefabAsset: {fileID: 0} 282 | m_GameObject: {fileID: 534669902} 283 | m_Enabled: 1 284 | --- !u!20 &534669904 285 | Camera: 286 | m_ObjectHideFlags: 0 287 | m_CorrespondingSourceObject: {fileID: 0} 288 | m_PrefabInstance: {fileID: 0} 289 | m_PrefabAsset: {fileID: 0} 290 | m_GameObject: {fileID: 534669902} 291 | m_Enabled: 1 292 | serializedVersion: 2 293 | m_ClearFlags: 1 294 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 295 | m_projectionMatrixMode: 1 296 | m_SensorSize: {x: 36, y: 24} 297 | m_LensShift: {x: 0, y: 0} 298 | m_GateFitMode: 2 299 | m_FocalLength: 50 300 | m_NormalizedViewPortRect: 301 | serializedVersion: 2 302 | x: 0 303 | y: 0 304 | width: 1 305 | height: 1 306 | near clip plane: 0.3 307 | far clip plane: 1000 308 | field of view: 60 309 | orthographic: 0 310 | orthographic size: 5 311 | m_Depth: -1 312 | m_CullingMask: 313 | serializedVersion: 2 314 | m_Bits: 4294967295 315 | m_RenderingPath: -1 316 | m_TargetTexture: {fileID: 0} 317 | m_TargetDisplay: 0 318 | m_TargetEye: 3 319 | m_HDR: 1 320 | m_AllowMSAA: 1 321 | m_AllowDynamicResolution: 0 322 | m_ForceIntoRT: 0 323 | m_OcclusionCulling: 1 324 | m_StereoConvergence: 10 325 | m_StereoSeparation: 0.022 326 | --- !u!4 &534669905 327 | Transform: 328 | m_ObjectHideFlags: 0 329 | m_CorrespondingSourceObject: {fileID: 0} 330 | m_PrefabInstance: {fileID: 0} 331 | m_PrefabAsset: {fileID: 0} 332 | m_GameObject: {fileID: 534669902} 333 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 334 | m_LocalPosition: {x: 0, y: 1, z: -10} 335 | m_LocalScale: {x: 1, y: 1, z: 1} 336 | m_Children: [] 337 | m_Father: {fileID: 0} 338 | m_RootOrder: 0 339 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 340 | --- !u!1 &1784641037 341 | GameObject: 342 | m_ObjectHideFlags: 0 343 | m_CorrespondingSourceObject: {fileID: 0} 344 | m_PrefabInstance: {fileID: 0} 345 | m_PrefabAsset: {fileID: 0} 346 | serializedVersion: 6 347 | m_Component: 348 | - component: {fileID: 1784641038} 349 | - component: {fileID: 1784641039} 350 | - component: {fileID: 1784641040} 351 | m_Layer: 0 352 | m_Name: Try1 353 | m_TagString: Untagged 354 | m_Icon: {fileID: 0} 355 | m_NavMeshLayer: 0 356 | m_StaticEditorFlags: 0 357 | m_IsActive: 1 358 | --- !u!4 &1784641038 359 | Transform: 360 | m_ObjectHideFlags: 0 361 | m_CorrespondingSourceObject: {fileID: 0} 362 | m_PrefabInstance: {fileID: 0} 363 | m_PrefabAsset: {fileID: 0} 364 | m_GameObject: {fileID: 1784641037} 365 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 366 | m_LocalPosition: {x: 0, y: 0, z: 0} 367 | m_LocalScale: {x: 1, y: 1, z: 1} 368 | m_Children: [] 369 | m_Father: {fileID: 0} 370 | m_RootOrder: 2 371 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 372 | --- !u!114 &1784641039 373 | MonoBehaviour: 374 | m_ObjectHideFlags: 0 375 | m_CorrespondingSourceObject: {fileID: 0} 376 | m_PrefabInstance: {fileID: 0} 377 | m_PrefabAsset: {fileID: 0} 378 | m_GameObject: {fileID: 1784641037} 379 | m_Enabled: 1 380 | m_EditorHideFlags: 0 381 | m_Script: {fileID: 11500000, guid: 8d5d9cc84a1b0074fbaa733a87f0f533, type: 3} 382 | m_Name: 383 | m_EditorClassIdentifier: 384 | output: {fileID: 4900000, guid: be4826fc8e1ea884788ecb9b408f29aa, type: 3} 385 | --- !u!114 &1784641040 386 | MonoBehaviour: 387 | m_ObjectHideFlags: 0 388 | m_CorrespondingSourceObject: {fileID: 0} 389 | m_PrefabInstance: {fileID: 0} 390 | m_PrefabAsset: {fileID: 0} 391 | m_GameObject: {fileID: 1784641037} 392 | m_Enabled: 1 393 | m_EditorHideFlags: 0 394 | m_Script: {fileID: 11500000, guid: 8748da88f4bf6f6499574e4fd566f8fa, type: 3} 395 | m_Name: 396 | m_EditorClassIdentifier: 397 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/JsonNetSandbox.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37c2d5f4387216044b4f75aa607e0ca1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/JsonNetTesting.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Newtonsoft.Json; 5 | using System.IO; 6 | #if UNITY_EDITOR 7 | using UnityEditor; 8 | #endif 9 | public class JsonNetTesting : MonoBehaviour 10 | { 11 | #if UNITY_EDITOR 12 | 13 | [SerializeField] private TextAsset output = null; 14 | 15 | [ContextMenu("try1")] 16 | void Try1() 17 | { 18 | var ob = new JsontTestObject() 19 | { 20 | Name = "Kolodi" 21 | }; 22 | 23 | var jsonString = JsonConvert.SerializeObject(ob, Formatting.Indented); 24 | 25 | Debug.Log(jsonString); 26 | 27 | File.WriteAllText(AssetDatabase.GetAssetPath(output), jsonString); 28 | EditorUtility.SetDirty(output); 29 | 30 | var ob1 = JsonConvert.DeserializeObject(jsonString); 31 | 32 | Debug.Log(ob1.ExpirationDate.ToString("G", System.Globalization.CultureInfo.GetCultureInfo("it-IT"))); 33 | 34 | } 35 | #endif 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/JsonNetTesting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d5d9cc84a1b0074fbaa733a87f0f533 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/JsontTestObject.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using UnityEngine; 7 | 8 | public class JsontTestObject 9 | { 10 | 11 | public enum TestEnum 12 | { 13 | V1, 14 | V2, 15 | V333 16 | } 17 | 18 | [JsonConverter(typeof(StringEnumConverter))] 19 | public TestEnum SomeKind { get; private set; } 20 | 21 | [JsonProperty("player_name")] 22 | public string Name { get; set; } 23 | 24 | [JsonProperty("position")] 25 | private Vector3 Position { get; set; } 26 | 27 | [JsonProperty("rotation")] 28 | [JsonConverter(typeof(QuaternionConverter))] 29 | private Quaternion Rotation { get; set; } 30 | 31 | [JsonProperty("creation_date")] 32 | public DateTime CreationDate { get; } 33 | 34 | [JsonProperty("expiration_date")] 35 | public DateTime ExpirationDate { get; } 36 | 37 | public JsontTestObject () 38 | { 39 | Position = new Vector3(1, 2, 3); 40 | Rotation = Quaternion.Euler(10.0f, 20.0f, 50.0f); 41 | CreationDate = DateTime.Now; 42 | ExpirationDate = CreationDate + TimeSpan.FromDays(10); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/JsontTestObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abb104036368ea249ac44c764502830a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Experiments/JSON/output.json: -------------------------------------------------------------------------------- 1 | { 2 | "SomeKind": "V1", 3 | "player_name": "Kolodi", 4 | "position": { 5 | "x": 1.0, 6 | "y": 2.0, 7 | "z": 3.0 8 | }, 9 | "rotation": { 10 | "w": 0.8955386, 11 | "x": 0.150897518, 12 | "y": 0.12050581, 13 | "z": 0.400897533, 14 | "eulerAngles": { 15 | "x": 9.999999, 16 | "y": 20.0000019, 17 | "z": 50.0 18 | } 19 | }, 20 | "creation_date": "2019-02-13T10:56:35.4846241+01:00", 21 | "expiration_date": "2019-02-23T10:56:35.4846241+01:00" 22 | } -------------------------------------------------------------------------------- /Assets/Experiments/JSON/output.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be4826fc8e1ea884788ecb9b408f29aa 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Extensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcd1fa7cf9eba0449b768378c8841ab7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/JsonDotNet.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa4c0f1db1ba47d48b724d6e0f5640d0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 577d9725f58264943855b8ac185531fe 3 | folderAsset: yes 4 | timeCreated: 1466788344 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/AOT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14f21d7a1e53a8c4e87b25526a7eb63c 3 | folderAsset: yes 4 | timeCreated: 1466788345 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.XML.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aadad8ac54f29e44583510294ac5c312 3 | timeCreated: 1466788355 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/AOT/Newtonsoft.Json.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a3c684705042f345975d924f6983e36 3 | timeCreated: 1466788352 4 | licenseType: Store 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 1 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | DefaultValueInitialized: true 23 | OS: AnyOS 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | OSXIntel: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel64: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | SamsungTV: 41 | enabled: 1 42 | settings: 43 | STV_MODEL: STANDARD_13 44 | Tizen: 45 | enabled: 1 46 | settings: {} 47 | WebGL: 48 | enabled: 1 49 | settings: {} 50 | Win: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | Win64: 55 | enabled: 0 56 | settings: 57 | CPU: AnyCPU 58 | WindowsStoreApps: 59 | enabled: 1 60 | settings: 61 | CPU: AnyCPU 62 | DontProcess: False 63 | PlaceholderPath: Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll 64 | SDK: AnySDK 65 | ScriptingBackend: Il2Cpp 66 | iOS: 67 | enabled: 1 68 | settings: 69 | CompileFlags: 70 | FrameworkDependencies: 71 | tvOS: 72 | enabled: 1 73 | settings: {} 74 | userData: 75 | assetBundleName: 76 | assetBundleVariant: 77 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/Standalone.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01ef782d02bb1994dbe418b69432552b 3 | folderAsset: yes 4 | timeCreated: 1466788344 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.XML.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6807fedb8dcaf04682d2c84f0ab753f 3 | timeCreated: 1466788355 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17aef65a15b471f468b5fbeb4ff0c6a1 3 | timeCreated: 1466788349 4 | licenseType: Store 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: AnyCPU 22 | DefaultValueInitialized: true 23 | OS: AnyOS 24 | Linux: 25 | enabled: 1 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 1 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 1 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel: 37 | enabled: 1 38 | settings: 39 | CPU: AnyCPU 40 | OSXIntel64: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 1 46 | settings: 47 | CPU: AnyCPU 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | Win: 53 | enabled: 1 54 | settings: 55 | CPU: AnyCPU 56 | Win64: 57 | enabled: 1 58 | settings: 59 | CPU: AnyCPU 60 | WindowsStoreApps: 61 | enabled: 0 62 | settings: 63 | CPU: AnyCPU 64 | DontProcess: False 65 | PlaceholderPath: 66 | SDK: AnySDK 67 | ScriptingBackend: Il2Cpp 68 | iOS: 69 | enabled: 0 70 | settings: 71 | CompileFlags: 72 | FrameworkDependencies: 73 | userData: 74 | assetBundleName: 75 | assetBundleVariant: 76 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/Windows.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1418141139a6ac443b18cb05c0643a29 3 | folderAsset: yes 4 | timeCreated: 1466788345 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.XML.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36f7323c55864364d8bb88c736e4bca6 3 | timeCreated: 1466788355 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Assets/JsonDotNet/Assemblies/Windows/Newtonsoft.Json.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b6ba260dada0ea4a871a42011f8b87d 3 | timeCreated: 1466788355 4 | licenseType: Store 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | DefaultValueInitialized: true 23 | OS: AnyOS 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | OSXIntel: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel64: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | SamsungTV: 41 | enabled: 0 42 | settings: 43 | STV_MODEL: STANDARD_13 44 | Win: 45 | enabled: 0 46 | settings: 47 | CPU: AnyCPU 48 | Win64: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | WindowsStoreApps: 53 | enabled: 1 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: Assets/JsonDotNet/Assemblies/Standalone/Newtonsoft.Json.dll 58 | SDK: AnySDK 59 | ScriptingBackend: DotNet 60 | iOS: 61 | enabled: 0 62 | settings: 63 | CompileFlags: 64 | FrameworkDependencies: 65 | userData: 66 | assetBundleName: 67 | assetBundleVariant: 68 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Documentation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76f828f47ce26cc43991113c6a39dbbf 3 | folderAsset: yes 4 | timeCreated: 1466010535 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/Documentation/Json Net for Unity 2.0.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/JsonDotNet/Documentation/Json Net for Unity 2.0.1.pdf -------------------------------------------------------------------------------- /Assets/JsonDotNet/Documentation/Json Net for Unity 2.0.1.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e7d9a07cc3f02a41a575406e7230846 3 | timeCreated: 1466788421 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/JsonDotNet201Source.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/JsonDotNet/JsonDotNet201Source.zip -------------------------------------------------------------------------------- /Assets/JsonDotNet/JsonDotNet201Source.zip.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a6f8c7c1ea72ce46831c5e1b6150d0c 3 | timeCreated: 1466790933 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/link.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Assets/JsonDotNet/link.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06314f49bdda26043963578d60a0a7ee 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/PetStore.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec36375c57d70a34eb132093399ad9f8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PetStore/PetshopConsumeExample.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityOpenApi; 5 | using PetStore; 6 | using Newtonsoft.Json; 7 | 8 | public class PetshopConsumeExample : MonoBehaviour 9 | { 10 | [Header("Get Pets")] 11 | [SerializeField] PathItemAsset pets = null; 12 | [SerializeField] string tags = "cat"; 13 | [SerializeField] int limit = 3; 14 | 15 | [Header("Get Single Pet")] 16 | [SerializeField] PathItemAsset pet = null; 17 | [SerializeField] string petIdToGet = "5"; 18 | 19 | [Header("New pet")] 20 | [SerializeField] NewPet newPet = null; 21 | 22 | [ContextMenu("Get Pets")] 23 | public void GetPets() 24 | { 25 | var operation = pets.GetOperation(AOOperationType.GET); 26 | operation.SetParameterValue("tags", tags); 27 | operation.SetParameterValue("limit", limit.ToString()); 28 | operation.ignoreCache = true; 29 | 30 | pets.ExecuteOperation>(operation) 31 | .Then(pets => 32 | { 33 | pets.ForEach(pet => 34 | { 35 | Debug.Log("Pet ID: " + pet.id + ", type: " + pet.type + ", price: " + pet.price); 36 | }); 37 | }) 38 | .Catch(err => 39 | { 40 | Debug.Log(err); 41 | }); 42 | } 43 | 44 | [ContextMenu("Get Single Pet")] 45 | public void GetPet() 46 | { 47 | var operation = pet.GetOperation(AOOperationType.GET); 48 | operation.SetParameterValue("id", petIdToGet); 49 | 50 | pet.ExecuteOperation(operation) 51 | .Then(pet => 52 | { 53 | Debug.Log("Pet ID: " + pet.id + ", type: " + pet.type + ", price: " + pet.price); 54 | }); 55 | } 56 | 57 | [ContextMenu("Create Pet")] 58 | public void CreatePet() 59 | { 60 | var operation = pets.GetOperation(AOOperationType.POST); 61 | var serialized = JsonConvert.SerializeObject(newPet); 62 | operation.SetRequestBody(serialized); 63 | 64 | pets.ExecuteOperation(operation) 65 | .Then(r => 66 | { 67 | var pet = r.pet; 68 | Debug.Log("Pet name: " + pet.name + ", type: " + pet.type + ", price: " + pet.price); 69 | }); 70 | } 71 | 72 | [ContextMenu("Test Hash")] 73 | void TestHash() 74 | { 75 | var operation = pets.GetOperation(AOOperationType.POST); 76 | Debug.Log(operation.OperationCurrentHash); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Assets/PetStore/PetshopConsumeExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33e5c4601367cab42b11a261f6380748 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/PetStore/Swagger Petstore.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 4d2a7184f8e1aaa42b46af10ce732be1, type: 3} 13 | m_Name: Swagger Petstore 14 | m_EditorClassIdentifier: 15 | Http: {fileID: 11400000, guid: 02dd1d39e1c3fcc4c9e42b163921bb8b, type: 2} 16 | _currentServer: 17 | Description: 18 | Url: http://petstore-demo-endpoint.execute-api.com/petstore 19 | Variables: [] 20 | _servers: 21 | - Description: 22 | Url: http://petstore-demo-endpoint.execute-api.com/petstore 23 | Variables: [] 24 | _info: 25 | Title: Swagger Petstore 26 | Description: A sample API that uses a petstore as an example to demonstrate features 27 | in the OpenAPI 3.0 specification 28 | Version: 1.0.0 29 | TermsOfService: http://swagger.io/terms/ 30 | Contact: 31 | Name: Swagger API Team 32 | Url: http://swagger.io/ 33 | Email: apiteam@swagger.io 34 | Present: 1 35 | License: 36 | Name: Apache 2.0 37 | Url: https://www.apache.org/licenses/LICENSE-2.0.html 38 | Present: 1 39 | _externalDocs: 40 | Description: 41 | Url: 42 | pathItemAssets: 43 | - {fileID: 11400000, guid: 9aa1ad2be4b52e148930bc0b75a1e622, type: 2} 44 | - {fileID: 11400000, guid: 86e050ea5e7107a4c99652da82e45aa4, type: 2} 45 | -------------------------------------------------------------------------------- /Assets/PetStore/Swagger Petstore.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8d8582a2c4342949889e466c17358c0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PetStore/_pets.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: da4dbea4eac91844abcb0f7cba90820a, type: 3} 13 | m_Name: _pets 14 | m_EditorClassIdentifier: 15 | ApiAsset: {fileID: 11400000, guid: d8d8582a2c4342949889e466c17358c0, type: 2} 16 | Path: /pets 17 | Summary: 18 | Description: 19 | Operations: 20 | - OperationId: findPets 21 | OperationType: 0 22 | Deprecated: 0 23 | RequestBody: 24 | Description: 25 | Required: 0 26 | LastRequestBody: 27 | Parameters: 28 | - Name: tags 29 | Required: 0 30 | AllowReserved: 0 31 | Explode: 0 32 | AllowEmptyValue: 0 33 | Deprecated: 0 34 | Description: tags to filter by 35 | In: 0 36 | Reference: 37 | Id: 38 | IsPresent: 0 39 | ExternalResource: 40 | Type: 0 41 | IsExternal: 0 42 | IsLocal: 0 43 | Reference: 44 | UnresolvedReference: 0 45 | - Name: limit 46 | Required: 0 47 | AllowReserved: 0 48 | Explode: 0 49 | AllowEmptyValue: 0 50 | Deprecated: 0 51 | Description: maximum number of results to return 52 | In: 0 53 | Reference: 54 | Id: 55 | IsPresent: 0 56 | ExternalResource: 57 | Type: 0 58 | IsExternal: 0 59 | IsLocal: 0 60 | Reference: 61 | UnresolvedReference: 0 62 | ParametersValues: 63 | - parameter: 64 | Name: tags 65 | Required: 0 66 | AllowReserved: 0 67 | Explode: 0 68 | AllowEmptyValue: 0 69 | Deprecated: 0 70 | Description: tags to filter by 71 | In: 0 72 | Reference: 73 | Id: 74 | IsPresent: 0 75 | ExternalResource: 76 | Type: 0 77 | IsExternal: 0 78 | IsLocal: 0 79 | Reference: 80 | UnresolvedReference: 0 81 | value: cat 82 | - parameter: 83 | Name: limit 84 | Required: 0 85 | AllowReserved: 0 86 | Explode: 0 87 | AllowEmptyValue: 0 88 | Deprecated: 0 89 | Description: maximum number of results to return 90 | In: 0 91 | Reference: 92 | Id: 93 | IsPresent: 0 94 | ExternalResource: 95 | Type: 0 96 | IsExternal: 0 97 | IsLocal: 0 98 | Reference: 99 | UnresolvedReference: 0 100 | value: 2 101 | ExternalDocs: 102 | Description: 103 | Url: 104 | Description: 'Returns all pets from the system that the user has access to 105 | 106 | Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis 107 | sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare 108 | eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt 109 | varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, 110 | a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id 111 | aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim 112 | pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. 113 | Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus 114 | dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis 115 | libero sed lacinia. 116 | 117 | 118 | Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum 119 | ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis 120 | elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque 121 | posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend 122 | nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce 123 | malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, 124 | sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan 125 | tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. 126 | Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. 127 | 128 | ' 129 | Summary: 130 | Tags: [] 131 | Servers: [] 132 | pathAsset: {fileID: 11400000} 133 | - OperationId: addPet 134 | OperationType: 2 135 | Deprecated: 0 136 | RequestBody: 137 | Description: Pet to add to the store 138 | Required: 1 139 | LastRequestBody: '{"name":"Birdy","type":"bird","price":157.0}' 140 | Parameters: [] 141 | ParametersValues: [] 142 | ExternalDocs: 143 | Description: 144 | Url: 145 | Description: Creates a new pet in the store. Duplicates are allowed 146 | Summary: 147 | Tags: [] 148 | Servers: [] 149 | pathAsset: {fileID: 11400000} 150 | Servers: [] 151 | Parameters: [] 152 | -------------------------------------------------------------------------------- /Assets/PetStore/_pets.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9aa1ad2be4b52e148930bc0b75a1e622 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PetStore/_pets_{id}.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: da4dbea4eac91844abcb0f7cba90820a, type: 3} 13 | m_Name: _pets_{id} 14 | m_EditorClassIdentifier: 15 | ApiAsset: {fileID: 11400000, guid: d8d8582a2c4342949889e466c17358c0, type: 2} 16 | Path: /pets/{id} 17 | Summary: 18 | Description: 19 | Operations: 20 | - OperationId: find pet by id 21 | OperationType: 0 22 | Deprecated: 0 23 | RequestBody: 24 | Description: 25 | Required: 0 26 | LastRequestBody: 27 | Parameters: 28 | - Name: id 29 | Required: 1 30 | AllowReserved: 0 31 | Explode: 0 32 | AllowEmptyValue: 0 33 | Deprecated: 0 34 | Description: ID of pet to fetch 35 | In: 2 36 | Reference: 37 | Id: 38 | IsPresent: 0 39 | ExternalResource: 40 | Type: 0 41 | IsExternal: 0 42 | IsLocal: 0 43 | Reference: 44 | UnresolvedReference: 0 45 | ParametersValues: 46 | - parameter: 47 | Name: id 48 | Required: 1 49 | AllowReserved: 0 50 | Explode: 0 51 | AllowEmptyValue: 0 52 | Deprecated: 0 53 | Description: ID of pet to fetch 54 | In: 2 55 | Reference: 56 | Id: 57 | IsPresent: 0 58 | ExternalResource: 59 | Type: 0 60 | IsExternal: 0 61 | IsLocal: 0 62 | Reference: 63 | UnresolvedReference: 0 64 | value: 65 | Description: Returns a user based on a single ID, if the user does not have access 66 | to the pet 67 | Summary: 68 | Tags: [] 69 | Servers: [] 70 | pathAsset: {fileID: 11400000} 71 | - OperationId: deletePet 72 | OperationType: 3 73 | Deprecated: 0 74 | RequestBody: 75 | Description: 76 | Required: 0 77 | LastRequestBody: 78 | Parameters: 79 | - Name: id 80 | Required: 1 81 | AllowReserved: 0 82 | Explode: 0 83 | AllowEmptyValue: 0 84 | Deprecated: 0 85 | Description: ID of pet to delete 86 | In: 2 87 | Reference: 88 | Id: 89 | IsPresent: 0 90 | ExternalResource: 91 | Type: 0 92 | IsExternal: 0 93 | IsLocal: 0 94 | Reference: 95 | UnresolvedReference: 0 96 | ParametersValues: 97 | - parameter: 98 | Name: id 99 | Required: 1 100 | AllowReserved: 0 101 | Explode: 0 102 | AllowEmptyValue: 0 103 | Deprecated: 0 104 | Description: ID of pet to delete 105 | In: 2 106 | Reference: 107 | Id: 108 | IsPresent: 0 109 | ExternalResource: 110 | Type: 0 111 | IsExternal: 0 112 | IsLocal: 0 113 | Reference: 114 | UnresolvedReference: 0 115 | value: 116 | Description: deletes a single pet based on the ID supplied 117 | Summary: 118 | Tags: [] 119 | Servers: [] 120 | pathAsset: {fileID: 11400000} 121 | Servers: [] 122 | Parameters: [] 123 | -------------------------------------------------------------------------------- /Assets/PetStore/_pets_{id}.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86e050ea5e7107a4c99652da82e45aa4 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PetStore/data_model.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 612c252126a6bae4b91c8c0118b55483 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PetStore/data_model/Pet.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using UnityEngine; 7 | 8 | namespace PetStore 9 | { 10 | [Serializable] 11 | public class Pet 12 | { 13 | public int id; 14 | public PetType type; 15 | public float price; 16 | } 17 | 18 | [Serializable] 19 | public class NewPet 20 | { 21 | public string name; 22 | [JsonConverter(typeof(StringEnumConverter))] 23 | public PetType type; 24 | public float price; 25 | } 26 | 27 | [Serializable] 28 | public class NewPetResponse 29 | { 30 | public NewPet pet; 31 | public string message; 32 | } 33 | 34 | [Serializable] 35 | public enum PetType 36 | { 37 | dog, cat, fish, bird, gecko 38 | } 39 | } -------------------------------------------------------------------------------- /Assets/PetStore/data_model/Pet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49bc66987e2658f4fa3bfd135f8e79a4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/RestClient.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a53498da54f709c488dd3c2f3030eaf3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64a10827858b48c42b149ac9f4bd2033 3 | folderAsset: yes 4 | timeCreated: 1509415555 5 | licenseType: Store 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Demo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ac2984141c33e84691447d0423d8044 3 | timeCreated: 1509410070 4 | licenseType: Store 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a4a8a106e84a9b419871a8f516b8edf 3 | folderAsset: yes 4 | timeCreated: 1509410070 5 | licenseType: Store 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/MainScript.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using Models; 4 | using Proyecto26; 5 | using System.Collections.Generic; 6 | 7 | public class MainScript : MonoBehaviour { 8 | 9 | private readonly string basePath = "https://jsonplaceholder.typicode.com"; 10 | private RequestHelper currentRequest; 11 | 12 | public void Get(){ 13 | 14 | // We can add default request headers for all requests 15 | RestClient.DefaultRequestHeaders["Authorization"] = "Bearer ..."; 16 | 17 | RequestHelper requestOptions = null; 18 | 19 | RestClient.GetArray(basePath + "/posts").Then(res => { 20 | EditorUtility.DisplayDialog ("Posts", JsonHelper.ArrayToJsonString(res, true), "Ok"); 21 | return RestClient.GetArray(basePath + "/todos"); 22 | }).Then(res => { 23 | EditorUtility.DisplayDialog ("Todos", JsonHelper.ArrayToJsonString(res, true), "Ok"); 24 | return RestClient.GetArray(basePath + "/users"); 25 | }).Then(res => { 26 | EditorUtility.DisplayDialog ("Users", JsonHelper.ArrayToJsonString(res, true), "Ok"); 27 | 28 | 29 | // We can add specific options and override default headers for a request 30 | requestOptions = new RequestHelper { 31 | Uri = basePath + "/photos", 32 | Headers = new Dictionary { 33 | { "Authorization", "Other token..." } 34 | }, 35 | EnableDebug = true 36 | }; 37 | return RestClient.GetArray(requestOptions); 38 | }).Then(res => { 39 | EditorUtility.DisplayDialog("Header", requestOptions.GetHeader("Authorization"), "Ok"); 40 | 41 | // And later we can clean the default headers for all requests 42 | RestClient.CleanDefaultHeaders(); 43 | 44 | }).Catch(err => EditorUtility.DisplayDialog ("Error", err.Message, "Ok")); 45 | } 46 | 47 | public void Post(){ 48 | 49 | currentRequest = new RequestHelper { 50 | Uri = basePath + "/posts", 51 | Body = new Post { 52 | title = "foo", 53 | body = "bar", 54 | userId = 1 55 | } 56 | }; 57 | RestClient.Post(currentRequest) 58 | .Then(res => EditorUtility.DisplayDialog ("Success", JsonUtility.ToJson(res, true), "Ok")) 59 | .Catch(err => EditorUtility.DisplayDialog ("Error", err.Message, "Ok")); 60 | } 61 | 62 | public void Put(){ 63 | 64 | currentRequest = new RequestHelper { 65 | Uri = basePath + "/posts/1", 66 | Body = new Post { 67 | title = "foo", 68 | body = "bar", 69 | userId = 1 70 | }, 71 | Retries = 5, 72 | RetrySecondsDelay = 1, 73 | RetryCallback = (err, retries) => { 74 | Debug.Log (string.Format ("Retry #{0} Status {1}\nError: {2}", retries, err.StatusCode, err)); 75 | } 76 | }; 77 | RestClient.Put(currentRequest, (err, res, body) => { 78 | if(err != null){ 79 | EditorUtility.DisplayDialog ("Error", err.Message, "Ok"); 80 | } 81 | else{ 82 | EditorUtility.DisplayDialog ("Success", JsonUtility.ToJson(body, true), "Ok"); 83 | } 84 | }); 85 | } 86 | 87 | public void Delete(){ 88 | 89 | RestClient.Delete(basePath + "/posts/1", (err, res) => { 90 | if(err != null){ 91 | EditorUtility.DisplayDialog ("Error", err.Message, "Ok"); 92 | } 93 | else{ 94 | EditorUtility.DisplayDialog ("Success", "Status: " + res.StatusCode.ToString(), "Ok"); 95 | } 96 | }); 97 | } 98 | 99 | public void AbortRequest(){ 100 | if (currentRequest != null) { 101 | currentRequest.Abort(); 102 | currentRequest = null; 103 | } 104 | } 105 | } -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/MainScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92b89366f540895438070c1d6e96f5b5 3 | timeCreated: 1509410072 4 | licenseType: Store 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59b224f75a257a8499679ad0491b5ef5 3 | folderAsset: yes 4 | timeCreated: 1509415641 5 | licenseType: Store 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model/Photo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Models 4 | { 5 | [Serializable] 6 | public class Photo 7 | { 8 | public int albumId; 9 | 10 | public int id; 11 | 12 | public string title; 13 | 14 | public string url; 15 | 16 | public string thumbnailUrl; 17 | 18 | public override string ToString(){ 19 | return UnityEngine.JsonUtility.ToJson (this, true); 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model/Photo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fc9f19249cdb9b4db54d74d021637f0 3 | timeCreated: 1509410072 4 | licenseType: Store 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model/Post.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Models 4 | { 5 | [Serializable] 6 | public class Post 7 | { 8 | public int id; 9 | 10 | public int userId; 11 | 12 | public string title; 13 | 14 | public string body; 15 | 16 | public override string ToString(){ 17 | return UnityEngine.JsonUtility.ToJson (this, true); 18 | } 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model/Post.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a789d19056723694dbba1b5e669d6477 3 | timeCreated: 1509410072 4 | licenseType: Store 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model/Todo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Models 4 | { 5 | [Serializable] 6 | public class Todo 7 | { 8 | public int id; 9 | 10 | public int userId; 11 | 12 | public string title; 13 | 14 | public bool completed; 15 | 16 | public override string ToString(){ 17 | return UnityEngine.JsonUtility.ToJson (this, true); 18 | } 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model/Todo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa16cf12a1add014d90251f81dca6a45 3 | timeCreated: 1509410072 4 | licenseType: Store 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Models 4 | { 5 | [Serializable] 6 | public class User 7 | { 8 | public int id; 9 | 10 | public string name; 11 | 12 | public string username; 13 | 14 | public string email; 15 | 16 | public string phone; 17 | 18 | public string website; 19 | 20 | public override string ToString(){ 21 | return UnityEngine.JsonUtility.ToJson (this, true); 22 | } 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Assets/RestClient/DemoScene/Scripts/Model/User.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37c1fa55dd1eb2b4aadbcbbbb4c4272a 3 | timeCreated: 1509410072 4 | licenseType: Store 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 745690b7cc0ad3b40827b0a0ec814fca 3 | folderAsset: yes 4 | timeCreated: 1509411502 5 | licenseType: Store 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 635ebf53860f2423fa32b3ab9cbc16a7 3 | folderAsset: yes 4 | timeCreated: 1548213766 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/RestClient.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RestClient" 3 | } 4 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/RestClient.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c19165e0e495024449fc866ba6c820bd 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/RestClient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94707c19b4d894fe999322dd4081f0d7 3 | timeCreated: 1548213766 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 825e9ce96172247689fdf77b6bd37687 3 | folderAsset: yes 4 | timeCreated: 1548213766 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/CoroutineHolder.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Proyecto26 4 | { 5 | 6 | public class CoroutineHolder : MonoBehaviour 7 | { 8 | public void StopAll() 9 | { 10 | StopAllCoroutines(); 11 | } 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/CoroutineHolder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8724c966ae71954a9865e4560dcb299 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/Extensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.Networking; 2 | 3 | namespace Proyecto26.Common.Extensions 4 | { 5 | public static class Extensions 6 | { 7 | /// 8 | /// Create an object with the response of the server 9 | /// 10 | /// An object with the response. 11 | /// An UnityWebRequest object. 12 | public static ResponseHelper CreateWebResponse(this UnityWebRequest request) 13 | { 14 | return new ResponseHelper(request); 15 | } 16 | 17 | public static bool IsValidRequest(this UnityWebRequest request, RequestHelper options) 18 | { 19 | return request.isDone && 20 | !request.isNetworkError && 21 | ( 22 | !request.isHttpError || options.IgnoreHttpException 23 | ); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/Extensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3ad378ae251444feaf114ac7602b7a7 3 | timeCreated: 1548213766 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/HttpBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Collections; 4 | using UnityEngine; 5 | using UnityEngine.Networking; 6 | using Proyecto26.Common.Extensions; 7 | 8 | namespace Proyecto26 9 | { 10 | public static class HttpBase 11 | { 12 | public static IEnumerator CreateRequestAndRetry(RequestHelper options, Action callback) 13 | { 14 | var retries = 0; 15 | do 16 | { 17 | using (var request = CreateRequest(options)) 18 | { 19 | yield return SendWebRequest(request, options); 20 | var response = request.CreateWebResponse(); 21 | if (request.IsValidRequest(options)) 22 | { 23 | DebugLog(options.EnableDebug, string.Format("Url: {0}\nMethod: {1}\nStatus: {2}\nResponse: {3}", options.Uri, options.Method, request.responseCode, response.Text), false); 24 | callback(null, response); 25 | break; 26 | } 27 | else if (!options.IsAborted && retries < options.Retries) 28 | { 29 | yield return new WaitForSeconds(options.RetrySecondsDelay); 30 | retries++; 31 | if(options.RetryCallback != null) 32 | { 33 | options.RetryCallback(CreateException(request), retries); 34 | } 35 | DebugLog(options.EnableDebug, string.Format("Retry Request\nUrl: {0}\nMethod: {1}", options.Uri, options.Method), false); 36 | } 37 | else 38 | { 39 | var err = CreateException(request); 40 | DebugLog(options.EnableDebug, err, true); 41 | callback(err, response); 42 | break; 43 | } 44 | } 45 | } 46 | while (retries <= options.Retries); 47 | } 48 | 49 | private static UnityWebRequest CreateRequest(RequestHelper options) 50 | { 51 | if (options.FormData is WWWForm && options.Method == UnityWebRequest.kHttpVerbPOST) 52 | { 53 | return UnityWebRequest.Post(options.Uri, options.FormData); 54 | } 55 | else 56 | { 57 | return new UnityWebRequest(options.Uri, options.Method); 58 | } 59 | } 60 | 61 | private static RequestException CreateException(UnityWebRequest request) 62 | { 63 | var message = request.error ?? request.downloadHandler.text; 64 | return new RequestException(message, request.isHttpError, request.isNetworkError, request.responseCode); 65 | } 66 | 67 | private static void DebugLog(bool debugEnabled, object message, bool isError) 68 | { 69 | if (debugEnabled) 70 | { 71 | if (isError) 72 | Debug.LogError(message); 73 | else 74 | Debug.Log(message); 75 | } 76 | } 77 | 78 | public static IEnumerator DefaultUnityWebRequest(RequestHelper options, Action callback) 79 | { 80 | return CreateRequestAndRetry(options, callback); 81 | } 82 | 83 | public static IEnumerator DefaultUnityWebRequest(RequestHelper options, Action callback) 84 | { 85 | return CreateRequestAndRetry(options, (RequestException err, ResponseHelper res) => { 86 | var body = default(TResponse); 87 | if (err == null && !string.IsNullOrEmpty(res.Text)) 88 | { 89 | body = JsonUtility.FromJson(res.Text); 90 | } 91 | callback(err, res, body); 92 | }); 93 | } 94 | 95 | public static IEnumerator DefaultUnityWebRequest(RequestHelper options, Action callback) 96 | { 97 | return CreateRequestAndRetry(options, (RequestException err, ResponseHelper res) => { 98 | var body = default(TResponse[]); 99 | if (err == null && !string.IsNullOrEmpty(res.Text)) 100 | { 101 | body = JsonHelper.ArrayFromJson(res.Text); 102 | } 103 | callback(err, res, body); 104 | }); 105 | } 106 | 107 | /// 108 | /// Send the web request to the server 109 | /// 110 | /// An UnityWebRequestAsyncOperation object. 111 | /// An UnityWebRequest object. 112 | /// An options object. 113 | public static IEnumerator SendWebRequest(UnityWebRequest request, RequestHelper options) 114 | { 115 | byte[] bodyRaw = options.BodyRaw; 116 | string contentType = "application/json"; 117 | if (options.Body != null || !string.IsNullOrEmpty(options.BodyString)) 118 | { 119 | var bodyString = options.BodyString; 120 | if (options.Body != null) 121 | { 122 | bodyString = JsonUtility.ToJson(options.Body); 123 | } 124 | bodyRaw = Encoding.UTF8.GetBytes(bodyString.ToCharArray()); 125 | } 126 | else if (options.SimpleForm != null && options.SimpleForm.Count > 0) 127 | { 128 | bodyRaw = UnityWebRequest.SerializeSimpleForm(options.SimpleForm); 129 | contentType = "application/x-www-form-urlencoded"; 130 | } 131 | else if (options.FormSections != null && options.FormSections.Count > 0) 132 | { 133 | byte[] boundary = UnityWebRequest.GenerateBoundary(); 134 | byte[] formSections = UnityWebRequest.SerializeFormSections(options.FormSections, boundary); 135 | byte[] terminate = Encoding.UTF8.GetBytes(string.Concat("\r\n--", Encoding.UTF8.GetString(boundary), "--")); 136 | bodyRaw = new byte[formSections.Length + terminate.Length]; 137 | System.Buffer.BlockCopy(formSections, 0, bodyRaw, 0, formSections.Length); 138 | System.Buffer.BlockCopy(terminate, 0, bodyRaw, formSections.Length, terminate.Length); 139 | contentType = string.Concat("multipart/form-data; boundary=", Encoding.UTF8.GetString(boundary)); 140 | } 141 | else if (options.FormData is WWWForm) 142 | { 143 | //The Content-Type header will be copied from the formData parameter 144 | contentType = string.Empty; 145 | } 146 | if (!string.IsNullOrEmpty(options.ContentType)) 147 | { 148 | contentType = options.ContentType; 149 | } 150 | #if UNITY_2018_1_OR_NEWER 151 | if (options.CertificateHandler is CertificateHandler) 152 | request.certificateHandler = options.CertificateHandler; 153 | #endif 154 | if (options.UploadHandler is UploadHandler) 155 | request.uploadHandler = options.UploadHandler; 156 | if (bodyRaw != null) 157 | { 158 | request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw); 159 | request.uploadHandler.contentType = contentType; 160 | } 161 | if (options.DownloadHandler is DownloadHandler) 162 | request.downloadHandler = options.DownloadHandler; 163 | else 164 | request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer(); 165 | if (!string.IsNullOrEmpty(contentType)) 166 | { 167 | request.SetRequestHeader("Content-Type", contentType); 168 | } 169 | foreach (var header in RestClient.DefaultRequestHeaders) 170 | { 171 | request.SetRequestHeader(header.Key, header.Value); 172 | } 173 | foreach (var header in options.Headers) 174 | { 175 | request.SetRequestHeader(header.Key, header.Value); 176 | } 177 | if (options.Timeout.HasValue) 178 | { 179 | request.timeout = options.Timeout.Value; 180 | } 181 | if (options.ChunkedTransfer.HasValue) 182 | { 183 | request.chunkedTransfer = options.ChunkedTransfer.Value; 184 | } 185 | if (options.UseHttpContinue.HasValue) 186 | { 187 | request.useHttpContinue = options.UseHttpContinue.Value; 188 | } 189 | if (options.RedirectLimit.HasValue) 190 | { 191 | request.redirectLimit = options.RedirectLimit.Value; 192 | } 193 | options.Request = request; 194 | #if UNITY_2017_2_OR_NEWER 195 | yield return request.SendWebRequest(); 196 | #else 197 | yield return request.Send(); 198 | #endif 199 | } 200 | 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/HttpBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d749678c47fc245aab69542c0d8a2a31 3 | timeCreated: 1548213766 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/JsonHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Proyecto26 5 | { 6 | public static class JsonHelper 7 | { 8 | /// 9 | /// Get an array of objects when the response is an array "[]" instead of a valid JSON "{}" 10 | /// 11 | /// An array of objects. 12 | /// An array returned from the server. 13 | /// The element type of the array. 14 | public static T[] ArrayFromJson(string json) 15 | { 16 | string newJson = "{ \"Items\": " + json + "}"; 17 | var wrapper = JsonUtility.FromJson>(newJson); 18 | return wrapper.Items; 19 | } 20 | 21 | public static T[] FromJsonString(string json) 22 | { 23 | var wrapper = JsonUtility.FromJson>(json); 24 | return wrapper.Items; 25 | } 26 | 27 | public static string ArrayToJsonString(T[] array) 28 | { 29 | var wrapper = new Wrapper(); 30 | wrapper.Items = array; 31 | return JsonUtility.ToJson(wrapper); 32 | } 33 | 34 | public static string ArrayToJsonString(T[] array, bool prettyPrint) 35 | { 36 | var wrapper = new Wrapper(); 37 | wrapper.Items = array; 38 | return JsonUtility.ToJson(wrapper, prettyPrint); 39 | } 40 | 41 | [Serializable] 42 | private class Wrapper 43 | { 44 | public T[] Items; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/JsonHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 558812f9d1f5c4c2aa57f9e95f0146c4 3 | timeCreated: 1548213766 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/RequestException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace Proyecto26 3 | { 4 | public class RequestException : Exception 5 | { 6 | private bool _isHttpError; 7 | public bool IsHttpError 8 | { 9 | get { return _isHttpError; } 10 | private set { _isHttpError = value; } 11 | } 12 | 13 | private bool _isNetworkError; 14 | public bool IsNetworkError 15 | { 16 | get { return _isNetworkError; } 17 | private set { _isNetworkError = value; } 18 | } 19 | 20 | private long _statusCode; 21 | public long StatusCode 22 | { 23 | get { return _statusCode; } 24 | private set { _statusCode = value; } 25 | } 26 | 27 | private string _serverMessage; 28 | public string ServerMessage 29 | { 30 | get { return _serverMessage; } 31 | set { _serverMessage = value; } 32 | } 33 | 34 | public RequestException() { } 35 | 36 | public RequestException(string message): base(message) { } 37 | 38 | public RequestException(string format, params object[] args): base(string.Format(format, args)) { } 39 | 40 | public RequestException(string message, bool isHttpError, bool isNetworkError, long statusCode) : base(message) { 41 | _isHttpError = isHttpError; 42 | _isNetworkError = isNetworkError; 43 | _statusCode = statusCode; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/RequestException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6642118f722594e19b1af345a988e19c 3 | timeCreated: 1548213766 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/RequestHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Networking; 5 | 6 | namespace Proyecto26 7 | { 8 | public class RequestHelper 9 | { 10 | private string _uri; 11 | public string Uri 12 | { 13 | get { return _uri; } 14 | set { _uri = value; } 15 | } 16 | 17 | private string _method; 18 | public string Method 19 | { 20 | get { return _method; } 21 | set { _method = value; } 22 | } 23 | 24 | private object _body; 25 | public object Body 26 | { 27 | get { return _body; } 28 | set { _body = value; } 29 | } 30 | 31 | private string _bodyString; 32 | public string BodyString 33 | { 34 | get { return _bodyString; } 35 | set { _bodyString = value; } 36 | } 37 | 38 | private byte[] _bodyRaw; 39 | public byte[] BodyRaw 40 | { 41 | get { return _bodyRaw; } 42 | set { _bodyRaw = value; } 43 | } 44 | 45 | private int? _timeout; 46 | public int? Timeout 47 | { 48 | get { return _timeout; } 49 | set { _timeout = value; } 50 | } 51 | 52 | private string _contentType; 53 | public string ContentType 54 | { 55 | get { return _contentType; } 56 | set { _contentType = value; } 57 | } 58 | 59 | private int _retries; 60 | public int Retries 61 | { 62 | get { return _retries; } 63 | set { _retries = value; } 64 | } 65 | 66 | private float _retrySecondsDelay; 67 | public float RetrySecondsDelay 68 | { 69 | get { return _retrySecondsDelay; } 70 | set { _retrySecondsDelay = value; } 71 | } 72 | 73 | private Action _retryCallback; 74 | public Action RetryCallback 75 | { 76 | get { return _retryCallback; } 77 | set { _retryCallback = value; } 78 | } 79 | 80 | private bool _enableDebug; 81 | public bool EnableDebug 82 | { 83 | get { return _enableDebug; } 84 | set { _enableDebug = value; } 85 | } 86 | 87 | private bool? _chunkedTransfer; 88 | public bool? ChunkedTransfer 89 | { 90 | get { return _chunkedTransfer; } 91 | set { _chunkedTransfer = value; } 92 | } 93 | 94 | private bool? _useHttpContinue; 95 | public bool? UseHttpContinue 96 | { 97 | get { return _useHttpContinue; } 98 | set { _useHttpContinue = value; } 99 | } 100 | 101 | private int? _redirectLimit; 102 | public int? RedirectLimit 103 | { 104 | get { return _redirectLimit; } 105 | set { _redirectLimit = value; } 106 | } 107 | 108 | private bool _ignoreHttpException; 109 | public bool IgnoreHttpException 110 | { 111 | get { return _ignoreHttpException; } 112 | set { _ignoreHttpException = value; } 113 | } 114 | 115 | private WWWForm _formData; 116 | public WWWForm FormData 117 | { 118 | get { return _formData; } 119 | set { _formData = value; } 120 | } 121 | 122 | private Dictionary _simpleForm; 123 | public Dictionary SimpleForm 124 | { 125 | get { return _simpleForm; } 126 | set { _simpleForm = value; } 127 | } 128 | 129 | private List _formSections; 130 | public List FormSections 131 | { 132 | get { return _formSections; } 133 | set { _formSections = value; } 134 | } 135 | 136 | #if UNITY_2018_1_OR_NEWER 137 | private CertificateHandler _certificateHandler; 138 | public CertificateHandler CertificateHandler 139 | { 140 | get { return _certificateHandler; } 141 | set { _certificateHandler = value; } 142 | } 143 | #endif 144 | 145 | private UploadHandler _uploadHandler; 146 | public UploadHandler UploadHandler 147 | { 148 | get { return _uploadHandler; } 149 | set { _uploadHandler = value; } 150 | } 151 | 152 | private DownloadHandler _downloadHandler; 153 | public DownloadHandler DownloadHandler 154 | { 155 | get { return _downloadHandler; } 156 | set { _downloadHandler = value; } 157 | } 158 | 159 | private Dictionary _headers; 160 | public Dictionary Headers 161 | { 162 | get 163 | { 164 | if (_headers == null) 165 | { 166 | _headers = new Dictionary(); 167 | } 168 | return _headers; 169 | } 170 | set { _headers = value; } 171 | } 172 | 173 | public float UploadProgress 174 | { 175 | get 176 | { 177 | float progress = 0; 178 | if(this.Request != null) 179 | { 180 | progress = this.Request.uploadProgress; 181 | } 182 | return progress; 183 | } 184 | } 185 | 186 | public ulong UploadedBytes 187 | { 188 | get 189 | { 190 | ulong bytes = 0; 191 | if (this.Request != null) 192 | { 193 | bytes = this.Request.uploadedBytes; 194 | } 195 | return bytes; 196 | } 197 | } 198 | 199 | public float DownloadProgress 200 | { 201 | get 202 | { 203 | float progress = 0; 204 | if (this.Request != null) 205 | { 206 | progress = this.Request.downloadProgress; 207 | } 208 | return progress; 209 | } 210 | } 211 | 212 | public ulong DownloadedBytes 213 | { 214 | get 215 | { 216 | ulong bytes = 0; 217 | if (this.Request != null) 218 | { 219 | bytes = this.Request.downloadedBytes; 220 | } 221 | return bytes; 222 | } 223 | } 224 | 225 | /// 226 | /// Internal use 227 | /// 228 | public UnityWebRequest Request { private get; set; } 229 | 230 | /// 231 | /// Get the value of a header 232 | /// 233 | /// The string value of the header. 234 | /// The name of the header. 235 | public string GetHeader(string name) 236 | { 237 | string headerValue; 238 | if (this.Request != null) 239 | { 240 | headerValue = this.Request.GetRequestHeader(name); 241 | } 242 | else 243 | { 244 | this.Headers.TryGetValue(name, out headerValue); 245 | } 246 | return headerValue; 247 | } 248 | 249 | private bool _isAborted; 250 | public bool IsAborted 251 | { 252 | get { return _isAborted; } 253 | set { _isAborted = value; } 254 | } 255 | 256 | /// 257 | /// Abort the request manually 258 | /// 259 | public void Abort() { 260 | if (this.Request != null && !this.IsAborted) 261 | { 262 | try 263 | { 264 | this.IsAborted = true; 265 | this.Request.Abort(); 266 | } 267 | finally 268 | { 269 | this.Request = null; 270 | } 271 | } 272 | } 273 | } 274 | } 275 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/RequestHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d085442359e8c48e49b5a8025e7e0d95 3 | timeCreated: 1548213766 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/ResponseHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using System.Collections.Generic; 4 | using UnityEngine.Networking; 5 | 6 | namespace Proyecto26 7 | { 8 | [Serializable] 9 | public class ResponseHelper 10 | { 11 | public UnityWebRequest Request { get; private set; } 12 | 13 | public ResponseHelper(UnityWebRequest request) 14 | { 15 | Request = request; 16 | } 17 | 18 | public long StatusCode 19 | { 20 | get { return Request.responseCode; } 21 | } 22 | 23 | public byte[] Data 24 | { 25 | get { 26 | byte[] _data; 27 | try 28 | { 29 | _data = Request.downloadHandler.data; 30 | } 31 | catch (Exception) 32 | { 33 | _data = null; 34 | } 35 | return _data; 36 | } 37 | } 38 | 39 | public string Text 40 | { 41 | get 42 | { 43 | string _text; 44 | try 45 | { 46 | _text = Request.downloadHandler.text; 47 | } 48 | catch (Exception) 49 | { 50 | _text = string.Empty; 51 | } 52 | return _text; 53 | } 54 | } 55 | 56 | public string Error 57 | { 58 | get { return Request.error; } 59 | } 60 | 61 | public Dictionary Headers 62 | { 63 | get { return Request.GetResponseHeaders(); } 64 | } 65 | 66 | public override string ToString() 67 | { 68 | return JsonUtility.ToJson(this, true); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/ResponseHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 997e74285ae094d9284a037fb14207ae 3 | timeCreated: 1548213766 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/StaticCoroutine.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Proyecto26 5 | { 6 | public static class StaticCoroutine 7 | { 8 | private static CoroutineHolder _runner; 9 | private static CoroutineHolder runner 10 | { 11 | get 12 | { 13 | if (_runner == null) 14 | { 15 | _runner = Object.FindObjectOfType(); 16 | if (_runner == null) 17 | { 18 | _runner = new GameObject("Coroutine Holder").AddComponent(); 19 | if (Application.isPlaying) 20 | { 21 | Object.DontDestroyOnLoad(_runner); 22 | } 23 | } 24 | } 25 | return _runner; 26 | } 27 | } 28 | 29 | public static Coroutine StartCoroutine(IEnumerator coroutine) 30 | { 31 | return runner.StartCoroutine(coroutine); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/Proyecto26.RestClient/Utils/StaticCoroutine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cac085bc43198486caefc7afb2fc4e41 3 | timeCreated: 1548213766 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/RestClient/Packages/RSG.Promise.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/RestClient/Packages/RSG.Promise.dll -------------------------------------------------------------------------------- /Assets/RestClient/Packages/RSG.Promise.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d78a1ebcbdb85412f8d5b56eceafa4fa 3 | timeCreated: 1547099974 4 | licenseType: Store 5 | PluginImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | iconMap: {} 9 | executionOrder: {} 10 | isPreloaded: 0 11 | isOverridable: 0 12 | platformData: 13 | - first: 14 | Any: 15 | second: 16 | enabled: 1 17 | settings: {} 18 | - first: 19 | Editor: Editor 20 | second: 21 | enabled: 0 22 | settings: 23 | DefaultValueInitialized: true 24 | - first: 25 | Windows Store Apps: WindowsStoreApps 26 | second: 27 | enabled: 0 28 | settings: 29 | CPU: AnyCPU 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Assets/RestClient/RestClient.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/RestClient/RestClient.pdf -------------------------------------------------------------------------------- /Assets/RestClient/RestClient.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 475015657fb064908b91cc94e2364d3d 3 | timeCreated: 1545279230 4 | licenseType: Store 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54ea1e13ae177bd46b6ab28a7566d971 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/ApiTesting.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 1 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 500 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 1 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &929404283 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 929404285} 124 | - component: {fileID: 929404284} 125 | m_Layer: 0 126 | m_Name: Pets Example 127 | m_TagString: Untagged 128 | m_Icon: {fileID: 0} 129 | m_NavMeshLayer: 0 130 | m_StaticEditorFlags: 0 131 | m_IsActive: 1 132 | --- !u!114 &929404284 133 | MonoBehaviour: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInstance: {fileID: 0} 137 | m_PrefabAsset: {fileID: 0} 138 | m_GameObject: {fileID: 929404283} 139 | m_Enabled: 1 140 | m_EditorHideFlags: 0 141 | m_Script: {fileID: 11500000, guid: 33e5c4601367cab42b11a261f6380748, type: 3} 142 | m_Name: 143 | m_EditorClassIdentifier: 144 | pets: {fileID: 11400000, guid: 9aa1ad2be4b52e148930bc0b75a1e622, type: 2} 145 | tags: cat 146 | limit: 3 147 | pet: {fileID: 11400000, guid: 86e050ea5e7107a4c99652da82e45aa4, type: 2} 148 | petIdToGet: 5 149 | newPet: 150 | name: Birdy 151 | type: 3 152 | price: 157 153 | --- !u!4 &929404285 154 | Transform: 155 | m_ObjectHideFlags: 0 156 | m_CorrespondingSourceObject: {fileID: 0} 157 | m_PrefabInstance: {fileID: 0} 158 | m_PrefabAsset: {fileID: 0} 159 | m_GameObject: {fileID: 929404283} 160 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 161 | m_LocalPosition: {x: 0, y: 0, z: 0} 162 | m_LocalScale: {x: 1, y: 1, z: 1} 163 | m_Children: [] 164 | m_Father: {fileID: 0} 165 | m_RootOrder: 2 166 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 167 | --- !u!1 &1422073862 168 | GameObject: 169 | m_ObjectHideFlags: 0 170 | m_CorrespondingSourceObject: {fileID: 0} 171 | m_PrefabInstance: {fileID: 0} 172 | m_PrefabAsset: {fileID: 0} 173 | serializedVersion: 6 174 | m_Component: 175 | - component: {fileID: 1422073864} 176 | - component: {fileID: 1422073863} 177 | m_Layer: 0 178 | m_Name: Directional Light 179 | m_TagString: Untagged 180 | m_Icon: {fileID: 0} 181 | m_NavMeshLayer: 0 182 | m_StaticEditorFlags: 0 183 | m_IsActive: 1 184 | --- !u!108 &1422073863 185 | Light: 186 | m_ObjectHideFlags: 0 187 | m_CorrespondingSourceObject: {fileID: 0} 188 | m_PrefabInstance: {fileID: 0} 189 | m_PrefabAsset: {fileID: 0} 190 | m_GameObject: {fileID: 1422073862} 191 | m_Enabled: 1 192 | serializedVersion: 8 193 | m_Type: 1 194 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 195 | m_Intensity: 1 196 | m_Range: 10 197 | m_SpotAngle: 30 198 | m_CookieSize: 10 199 | m_Shadows: 200 | m_Type: 2 201 | m_Resolution: -1 202 | m_CustomResolution: -1 203 | m_Strength: 1 204 | m_Bias: 0.05 205 | m_NormalBias: 0.4 206 | m_NearPlane: 0.2 207 | m_Cookie: {fileID: 0} 208 | m_DrawHalo: 0 209 | m_Flare: {fileID: 0} 210 | m_RenderMode: 0 211 | m_CullingMask: 212 | serializedVersion: 2 213 | m_Bits: 4294967295 214 | m_Lightmapping: 4 215 | m_LightShadowCasterMode: 0 216 | m_AreaSize: {x: 1, y: 1} 217 | m_BounceIntensity: 1 218 | m_ColorTemperature: 6570 219 | m_UseColorTemperature: 0 220 | m_ShadowRadius: 0 221 | m_ShadowAngle: 0 222 | --- !u!4 &1422073864 223 | Transform: 224 | m_ObjectHideFlags: 0 225 | m_CorrespondingSourceObject: {fileID: 0} 226 | m_PrefabInstance: {fileID: 0} 227 | m_PrefabAsset: {fileID: 0} 228 | m_GameObject: {fileID: 1422073862} 229 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 230 | m_LocalPosition: {x: 0, y: 3, z: 0} 231 | m_LocalScale: {x: 1, y: 1, z: 1} 232 | m_Children: [] 233 | m_Father: {fileID: 0} 234 | m_RootOrder: 1 235 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 236 | --- !u!1 &1604746916 237 | GameObject: 238 | m_ObjectHideFlags: 0 239 | m_CorrespondingSourceObject: {fileID: 0} 240 | m_PrefabInstance: {fileID: 0} 241 | m_PrefabAsset: {fileID: 0} 242 | serializedVersion: 6 243 | m_Component: 244 | - component: {fileID: 1604746919} 245 | - component: {fileID: 1604746918} 246 | - component: {fileID: 1604746917} 247 | m_Layer: 0 248 | m_Name: Main Camera 249 | m_TagString: MainCamera 250 | m_Icon: {fileID: 0} 251 | m_NavMeshLayer: 0 252 | m_StaticEditorFlags: 0 253 | m_IsActive: 1 254 | --- !u!81 &1604746917 255 | AudioListener: 256 | m_ObjectHideFlags: 0 257 | m_CorrespondingSourceObject: {fileID: 0} 258 | m_PrefabInstance: {fileID: 0} 259 | m_PrefabAsset: {fileID: 0} 260 | m_GameObject: {fileID: 1604746916} 261 | m_Enabled: 1 262 | --- !u!20 &1604746918 263 | Camera: 264 | m_ObjectHideFlags: 0 265 | m_CorrespondingSourceObject: {fileID: 0} 266 | m_PrefabInstance: {fileID: 0} 267 | m_PrefabAsset: {fileID: 0} 268 | m_GameObject: {fileID: 1604746916} 269 | m_Enabled: 1 270 | serializedVersion: 2 271 | m_ClearFlags: 1 272 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 273 | m_projectionMatrixMode: 1 274 | m_SensorSize: {x: 36, y: 24} 275 | m_LensShift: {x: 0, y: 0} 276 | m_GateFitMode: 2 277 | m_FocalLength: 50 278 | m_NormalizedViewPortRect: 279 | serializedVersion: 2 280 | x: 0 281 | y: 0 282 | width: 1 283 | height: 1 284 | near clip plane: 0.3 285 | far clip plane: 1000 286 | field of view: 60 287 | orthographic: 0 288 | orthographic size: 5 289 | m_Depth: -1 290 | m_CullingMask: 291 | serializedVersion: 2 292 | m_Bits: 4294967295 293 | m_RenderingPath: -1 294 | m_TargetTexture: {fileID: 0} 295 | m_TargetDisplay: 0 296 | m_TargetEye: 3 297 | m_HDR: 1 298 | m_AllowMSAA: 1 299 | m_AllowDynamicResolution: 0 300 | m_ForceIntoRT: 0 301 | m_OcclusionCulling: 1 302 | m_StereoConvergence: 10 303 | m_StereoSeparation: 0.022 304 | --- !u!4 &1604746919 305 | Transform: 306 | m_ObjectHideFlags: 0 307 | m_CorrespondingSourceObject: {fileID: 0} 308 | m_PrefabInstance: {fileID: 0} 309 | m_PrefabAsset: {fileID: 0} 310 | m_GameObject: {fileID: 1604746916} 311 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 312 | m_LocalPosition: {x: 0, y: 1, z: -10} 313 | m_LocalScale: {x: 1, y: 1, z: 1} 314 | m_Children: [] 315 | m_Father: {fileID: 0} 316 | m_RootOrder: 0 317 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 318 | --- !u!1 &1782624292 319 | GameObject: 320 | m_ObjectHideFlags: 0 321 | m_CorrespondingSourceObject: {fileID: 0} 322 | m_PrefabInstance: {fileID: 0} 323 | m_PrefabAsset: {fileID: 0} 324 | serializedVersion: 6 325 | m_Component: 326 | - component: {fileID: 1782624294} 327 | - component: {fileID: 1782624293} 328 | m_Layer: 0 329 | m_Name: Coroutine Holder 330 | m_TagString: Untagged 331 | m_Icon: {fileID: 0} 332 | m_NavMeshLayer: 0 333 | m_StaticEditorFlags: 0 334 | m_IsActive: 1 335 | --- !u!114 &1782624293 336 | MonoBehaviour: 337 | m_ObjectHideFlags: 0 338 | m_CorrespondingSourceObject: {fileID: 0} 339 | m_PrefabInstance: {fileID: 0} 340 | m_PrefabAsset: {fileID: 0} 341 | m_GameObject: {fileID: 1782624292} 342 | m_Enabled: 1 343 | m_EditorHideFlags: 0 344 | m_Script: {fileID: 11500000, guid: f8724c966ae71954a9865e4560dcb299, type: 3} 345 | m_Name: 346 | m_EditorClassIdentifier: 347 | --- !u!4 &1782624294 348 | Transform: 349 | m_ObjectHideFlags: 0 350 | m_CorrespondingSourceObject: {fileID: 0} 351 | m_PrefabInstance: {fileID: 0} 352 | m_PrefabAsset: {fileID: 0} 353 | m_GameObject: {fileID: 1782624292} 354 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 355 | m_LocalPosition: {x: 0, y: 0, z: 0} 356 | m_LocalScale: {x: 1, y: 1, z: 1} 357 | m_Children: [] 358 | m_Father: {fileID: 0} 359 | m_RootOrder: 3 360 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 361 | -------------------------------------------------------------------------------- /Assets/Scenes/ApiTesting.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5657eb1f8f12104bb69c0b00263e1f4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69b3e38f4ac76cb4bbacc96af7b5318a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19f667ff1496a2042ab4589ba60e4020 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/Api Parser.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a06f7085ffbc11b4caab468e88e66f90, type: 3} 13 | m_Name: Api Parser 14 | m_EditorClassIdentifier: 15 | textAsset: {fileID: 4900000, guid: a229ccf01b02ff343a6fb3ad1a40846a, type: 3} 16 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/Api Parser.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c5b3ef7096f6d64ca8c70f8f272e326 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/AssetsHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | public class AssetsHelper 7 | { 8 | public static T GetOrCreateScriptableObject(string path, string subpath, string ext = ".asset", bool setDirty = true) 9 | where T : ScriptableObject 10 | { 11 | if (path[path.Length - 1] != '/') path += "/"; 12 | if (subpath[0] == '/') subpath = subpath.Substring(1); 13 | string assetFullPath = path + subpath + ext; 14 | T asset = AssetDatabase.LoadAssetAtPath(assetFullPath); 15 | if (asset == null) 16 | { 17 | asset = ScriptableObject.CreateInstance(); 18 | Debug.Log("Creating new asset at: " + assetFullPath); 19 | AssetDatabase.CreateAsset(asset, assetFullPath); 20 | } else 21 | { 22 | Debug.Log("Getting reference to the existing asset at: " + assetFullPath); 23 | } 24 | if (setDirty) 25 | { 26 | EditorUtility.SetDirty(asset); 27 | } 28 | return asset; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/AssetsHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 255649800bddf434fab50f7860f2b7b4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/Example APIs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d849cf8f7de3da4c98ce509ae2a40fd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/Example APIs/justeat.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e32d42e860aa554fac15e9a810736d7 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/Example APIs/petstore_json.json: -------------------------------------------------------------------------------- 1 | { 2 | "openapi": "3.0.0", 3 | "info": { 4 | "version": "1.0.0", 5 | "title": "Swagger Petstore", 6 | "description": "A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification", 7 | "termsOfService": "http://swagger.io/terms/", 8 | "contact": { 9 | "name": "Swagger API Team", 10 | "email": "apiteam@swagger.io", 11 | "url": "http://swagger.io" 12 | }, 13 | "license": { 14 | "name": "Apache 2.0", 15 | "url": "https://www.apache.org/licenses/LICENSE-2.0.html" 16 | } 17 | }, 18 | "servers": [ 19 | { 20 | "url": "http://petstore-demo-endpoint.execute-api.com/petstore" 21 | } 22 | ], 23 | "paths": { 24 | "/pets": { 25 | "get": { 26 | "description": "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n", 27 | "operationId": "findPets", 28 | "parameters": [ 29 | { 30 | "name": "tags", 31 | "in": "query", 32 | "description": "tags to filter by", 33 | "required": false, 34 | "style": "form", 35 | "schema": { 36 | "type": "array", 37 | "items": { 38 | "type": "string" 39 | } 40 | } 41 | }, 42 | { 43 | "name": "limit", 44 | "in": "query", 45 | "description": "maximum number of results to return", 46 | "required": false, 47 | "schema": { 48 | "type": "integer", 49 | "format": "int32" 50 | } 51 | } 52 | ], 53 | "responses": { 54 | "200": { 55 | "description": "pet response", 56 | "content": { 57 | "application/json": { 58 | "schema": { 59 | "type": "array", 60 | "items": { 61 | "$ref": "#/components/schemas/Pet" 62 | } 63 | } 64 | } 65 | } 66 | }, 67 | "default": { 68 | "description": "unexpected error", 69 | "content": { 70 | "application/json": { 71 | "schema": { 72 | "$ref": "#/components/schemas/Error" 73 | } 74 | } 75 | } 76 | } 77 | } 78 | }, 79 | "post": { 80 | "description": "Creates a new pet in the store. Duplicates are allowed", 81 | "operationId": "addPet", 82 | "requestBody": { 83 | "description": "Pet to add to the store", 84 | "required": true, 85 | "content": { 86 | "application/json": { 87 | "schema": { 88 | "$ref": "#/components/schemas/NewPet" 89 | } 90 | } 91 | } 92 | }, 93 | "responses": { 94 | "200": { 95 | "description": "pet response", 96 | "content": { 97 | "application/json": { 98 | "schema": { 99 | "$ref": "#/components/schemas/Pet" 100 | } 101 | } 102 | } 103 | }, 104 | "default": { 105 | "description": "unexpected error", 106 | "content": { 107 | "application/json": { 108 | "schema": { 109 | "$ref": "#/components/schemas/Error" 110 | } 111 | } 112 | } 113 | } 114 | } 115 | } 116 | }, 117 | "/pets/{id}": { 118 | "get": { 119 | "description": "Returns a user based on a single ID, if the user does not have access to the pet", 120 | "operationId": "find pet by id", 121 | "parameters": [ 122 | { 123 | "name": "id", 124 | "in": "path", 125 | "description": "ID of pet to fetch", 126 | "required": true, 127 | "schema": { 128 | "type": "integer", 129 | "format": "int64" 130 | } 131 | } 132 | ], 133 | "responses": { 134 | "200": { 135 | "description": "pet response", 136 | "content": { 137 | "application/json": { 138 | "schema": { 139 | "$ref": "#/components/schemas/Pet" 140 | } 141 | } 142 | } 143 | }, 144 | "default": { 145 | "description": "unexpected error", 146 | "content": { 147 | "application/json": { 148 | "schema": { 149 | "$ref": "#/components/schemas/Error" 150 | } 151 | } 152 | } 153 | } 154 | } 155 | }, 156 | "delete": { 157 | "description": "deletes a single pet based on the ID supplied", 158 | "operationId": "deletePet", 159 | "parameters": [ 160 | { 161 | "name": "id", 162 | "in": "path", 163 | "description": "ID of pet to delete", 164 | "required": true, 165 | "schema": { 166 | "type": "integer", 167 | "format": "int64" 168 | } 169 | } 170 | ], 171 | "responses": { 172 | "204": { 173 | "description": "pet deleted" 174 | }, 175 | "default": { 176 | "description": "unexpected error", 177 | "content": { 178 | "application/json": { 179 | "schema": { 180 | "$ref": "#/components/schemas/Error" 181 | } 182 | } 183 | } 184 | } 185 | } 186 | } 187 | } 188 | }, 189 | "components": { 190 | "schemas": { 191 | "Pet": { 192 | "allOf": [ 193 | { 194 | "$ref": "#/components/schemas/NewPet" 195 | }, 196 | { 197 | "required": [ 198 | "id" 199 | ], 200 | "properties": { 201 | "id": { 202 | "type": "integer", 203 | "format": "int64" 204 | } 205 | } 206 | } 207 | ] 208 | }, 209 | "NewPet": { 210 | "required": [ 211 | "name" 212 | ], 213 | "properties": { 214 | "name": { 215 | "type": "string" 216 | }, 217 | "tag": { 218 | "type": "string" 219 | } 220 | } 221 | }, 222 | "Error": { 223 | "required": [ 224 | "code", 225 | "message" 226 | ], 227 | "properties": { 228 | "code": { 229 | "type": "integer", 230 | "format": "int32" 231 | }, 232 | "message": { 233 | "type": "string" 234 | } 235 | } 236 | } 237 | } 238 | } 239 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/Example APIs/petstore_json.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e48fffb3bfd8644a85d07e980944416 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/Example APIs/petstore_yaml.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | info: 3 | version: 1.0.0 4 | title: Swagger Petstore 5 | description: A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification 6 | termsOfService: http://swagger.io/terms/ 7 | contact: 8 | name: Swagger API Team 9 | email: apiteam@swagger.io 10 | url: http://swagger.io 11 | license: 12 | name: Apache 2.0 13 | url: https://www.apache.org/licenses/LICENSE-2.0.html 14 | servers: 15 | - url: http://petstore-demo-endpoint.execute-api.com/petstore 16 | paths: 17 | /pets: 18 | get: 19 | description: | 20 | Returns all pets from the system that the user has access to 21 | Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. 22 | 23 | Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. 24 | operationId: findPets 25 | parameters: 26 | - name: tags 27 | in: query 28 | description: tags to filter by 29 | required: false 30 | style: form 31 | schema: 32 | type: array 33 | items: 34 | type: string 35 | - name: limit 36 | in: query 37 | description: maximum number of results to return 38 | required: false 39 | schema: 40 | type: integer 41 | format: int32 42 | responses: 43 | '200': 44 | description: pet response 45 | content: 46 | application/json: 47 | schema: 48 | type: array 49 | items: 50 | $ref: '#/components/schemas/Pet' 51 | default: 52 | description: unexpected error 53 | content: 54 | application/json: 55 | schema: 56 | $ref: '#/components/schemas/Error' 57 | post: 58 | description: Creates a new pet in the store. Duplicates are allowed 59 | operationId: addPet 60 | requestBody: 61 | description: Pet to add to the store 62 | required: true 63 | content: 64 | application/json: 65 | schema: 66 | $ref: '#/components/schemas/NewPet' 67 | responses: 68 | '200': 69 | description: pet response 70 | content: 71 | application/json: 72 | schema: 73 | $ref: '#/components/schemas/Pet' 74 | default: 75 | description: unexpected error 76 | content: 77 | application/json: 78 | schema: 79 | $ref: '#/components/schemas/Error' 80 | /pets/{id}: 81 | get: 82 | description: Returns a user based on a single ID, if the user does not have access to the pet 83 | operationId: find pet by id 84 | parameters: 85 | - name: id 86 | in: path 87 | description: ID of pet to fetch 88 | required: true 89 | schema: 90 | type: integer 91 | format: int64 92 | responses: 93 | '200': 94 | description: pet response 95 | content: 96 | application/json: 97 | schema: 98 | $ref: '#/components/schemas/Pet' 99 | default: 100 | description: unexpected error 101 | content: 102 | application/json: 103 | schema: 104 | $ref: '#/components/schemas/Error' 105 | delete: 106 | description: deletes a single pet based on the ID supplied 107 | operationId: deletePet 108 | parameters: 109 | - name: id 110 | in: path 111 | description: ID of pet to delete 112 | required: true 113 | schema: 114 | type: integer 115 | format: int64 116 | responses: 117 | '204': 118 | description: pet deleted 119 | default: 120 | description: unexpected error 121 | content: 122 | application/json: 123 | schema: 124 | $ref: '#/components/schemas/Error' 125 | components: 126 | schemas: 127 | Pet: 128 | allOf: 129 | - $ref: '#/components/schemas/NewPet' 130 | - required: 131 | - id 132 | properties: 133 | id: 134 | type: integer 135 | format: int64 136 | 137 | NewPet: 138 | required: 139 | - name 140 | properties: 141 | name: 142 | type: string 143 | tag: 144 | type: string 145 | 146 | Error: 147 | required: 148 | - code 149 | - message 150 | properties: 151 | code: 152 | type: integer 153 | format: int32 154 | message: 155 | type: string 156 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/Example APIs/petstore_yaml.yaml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dde3cc8bc2f86c4b85083dce35aa820 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/HTTP.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: ce20fa77d8f07a84790c12a3b78afbcc, type: 3} 13 | m_Name: HTTP 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/HTTP.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02dd1d39e1c3fcc4c9e42b163921bb8b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/OpenApiParser.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using Microsoft.OpenApi.Readers; 4 | using System.IO; 5 | using Microsoft.OpenApi.Validations; 6 | using Microsoft.OpenApi.Models; 7 | using UnityOpenApi; 8 | using System.Linq; 9 | using System.Collections.Generic; 10 | using Proyecto26; 11 | 12 | [CreateAssetMenu(menuName = "Unity Open API/Parser")] 13 | public class OpenApiParser : ScriptableObject 14 | { 15 | [SerializeField] 16 | [HideInInspector] 17 | private TextAsset textAsset = null; 18 | 19 | private string _lastAssetPath = "Assets"; 20 | 21 | public void ParseFromAsset() 22 | { 23 | var doc = Parse(textAsset.text); 24 | GenerateAssets(doc); 25 | } 26 | 27 | public OpenApiDocument Parse(string json) 28 | { 29 | var stream = CreateStream(json); 30 | var parsed = new OpenApiStreamReader(new OpenApiReaderSettings 31 | { 32 | ReferenceResolution = ReferenceResolutionSetting.ResolveLocalReferences, 33 | RuleSet = ValidationRuleSet.GetDefaultRuleSet() 34 | }).Read(stream, out var openApiDiagnostic); 35 | Debug.Log("Successfully parsed API Description: " + parsed.Info.Title); 36 | return parsed; 37 | } 38 | 39 | public void ParseFromUrl(string url) 40 | { 41 | RestClient.Get(url) 42 | .Then(result => 43 | { 44 | var doc = Parse(result.Text); 45 | GenerateAssets(doc); 46 | }) 47 | .Catch(err => Debug.LogError(err.Message)); 48 | } 49 | 50 | private MemoryStream CreateStream(string text) 51 | { 52 | var stream = new MemoryStream(); 53 | var writer = new StreamWriter(stream); 54 | 55 | writer.Write(text); 56 | writer.Flush(); 57 | stream.Position = 0; 58 | 59 | return stream; 60 | } 61 | 62 | public void GenerateAssets(OpenApiDocument doc) 63 | { 64 | string assetsPath = EditorUtility.OpenFolderPanel("Select assets folder", _lastAssetPath, ""); 65 | _lastAssetPath = assetsPath; 66 | assetsPath = assetsPath.Substring(assetsPath.IndexOf("Assets")); 67 | ApiAsset apiAsset = AssetsHelper.GetOrCreateScriptableObject(assetsPath, doc.Info.Title); 68 | 69 | #region ApiAsset update 70 | apiAsset.info = new OAInfo() 71 | { 72 | Title = doc.Info.Title, 73 | Description = doc.Info.Description, 74 | Version = doc.Info.Version, 75 | TermsOfService = doc.Info.TermsOfService == null ? "" : doc.Info.TermsOfService.ToString(), 76 | Contact = CreateContact(doc.Info.Contact), 77 | License = CreateLicence(doc.Info.License), 78 | }; 79 | 80 | apiAsset.externalDocs = CreateExternalDocs(doc.ExternalDocs); 81 | 82 | apiAsset.servers = doc.Servers.Select(s => CreateAOServer(s)).ToList(); 83 | 84 | 85 | apiAsset.pathItemAssets = new List(); 86 | 87 | #endregion 88 | 89 | foreach (var p in doc.Paths) 90 | { 91 | string fileName = p.Key.Replace('/', '_'); 92 | PathItemAsset a = AssetsHelper.GetOrCreateScriptableObject(assetsPath, fileName); 93 | a.ApiAsset = apiAsset; 94 | 95 | #region path item update 96 | 97 | 98 | a.Path = p.Key; 99 | 100 | a.Summary = p.Value.Summary; 101 | a.Description = p.Value.Description; 102 | a.Parameters = p.Value.Parameters.Select(par => CreateAOParameter(par)).ToList(); 103 | a.Operations = p.Value.Operations.Select(o => CreateAOOperation(o.Key, o.Value, a)).ToList(); 104 | a.Servers = p.Value.Servers.Select(s => CreateAOServer(s)).ToList(); 105 | 106 | #endregion 107 | 108 | apiAsset.pathItemAssets.Add(a); 109 | } 110 | 111 | 112 | 113 | AssetDatabase.SaveAssets(); 114 | } 115 | 116 | private OAParameter CreateAOParameter(OpenApiParameter openApiParameter) 117 | { 118 | return new OAParameter() 119 | { 120 | Name = openApiParameter.Name, 121 | Required = openApiParameter.Required, 122 | AllowReserved = openApiParameter.AllowReserved, 123 | Explode = openApiParameter.Explode, 124 | AllowEmptyValue = openApiParameter.AllowEmptyValue, 125 | Deprecated = openApiParameter.Deprecated, 126 | Description = openApiParameter.Description, 127 | UnresolvedReference = openApiParameter.UnresolvedReference, 128 | 129 | In = (OAParameterLocation)openApiParameter.In, 130 | 131 | Reference = CreateReference(openApiParameter.Reference), 132 | }; 133 | } 134 | 135 | private OAOperation CreateAOOperation(OperationType operationType, OpenApiOperation op, PathItemAsset pathItemAsset) 136 | { 137 | var operation = new OAOperation() 138 | { 139 | pathAsset = pathItemAsset, 140 | OperationId = op.OperationId, 141 | OperationType = (AOOperationType)operationType, 142 | Summary = op.Summary, 143 | Description = op.Description, 144 | Deprecated = op.Deprecated, 145 | 146 | Parameters = op.Parameters.Count > 0 ? 147 | op.Parameters.Select(p => CreateAOParameter(p)).ToList() : 148 | pathItemAsset.Parameters, 149 | 150 | 151 | Servers = op.Servers.Select(s => CreateAOServer(s)).ToList(), 152 | 153 | Tags = op.Tags.Select(t => CreateOATag(t)).ToList(), 154 | 155 | RequestBody = CreateOARequestBody(op.RequestBody), 156 | 157 | ExternalDocs = CreateExternalDocs(op.ExternalDocs), 158 | }; 159 | operation.ParametersValues = operation.Parameters.Select(p => new ParameterValue { parameter = p }).ToList(); 160 | 161 | return operation; 162 | } 163 | 164 | private OATag CreateOATag(OpenApiTag openApiTag) 165 | { 166 | return new OATag() 167 | { 168 | Name = openApiTag.Name, 169 | Description = openApiTag.Description, 170 | ExternalDocs = CreateExternalDocs(openApiTag.ExternalDocs), 171 | }; 172 | } 173 | 174 | public OARequestBody CreateOARequestBody(OpenApiRequestBody requestBody) 175 | { 176 | if (requestBody == null) return new OARequestBody(); 177 | 178 | return new OARequestBody() 179 | { 180 | Description = requestBody.Description, 181 | Required = requestBody.Required, 182 | }; 183 | } 184 | 185 | private OAReference CreateReference(OpenApiReference openApiReference) 186 | { 187 | if (openApiReference == null) return new OAReference(); 188 | 189 | return new OAReference() 190 | { 191 | IsPresent = true, 192 | ExternalResource = openApiReference.ExternalResource, 193 | Type = (OAReferenceType)openApiReference.Type, 194 | Id = openApiReference.Id, 195 | IsExternal = openApiReference.IsExternal, 196 | IsLocal = openApiReference.IsLocal, 197 | Reference = string.IsNullOrEmpty(openApiReference.ReferenceV2) 198 | ? openApiReference.ReferenceV3 : openApiReference.ReferenceV2, 199 | }; 200 | } 201 | 202 | private OAContact CreateContact(OpenApiContact openApiContact) 203 | { 204 | if (openApiContact == null) 205 | return new OAContact(); 206 | 207 | return new OAContact() 208 | { 209 | Url = openApiContact.Url.ToString(), 210 | Name = openApiContact.Name, 211 | Email = openApiContact.Email, 212 | Present = true, 213 | }; 214 | } 215 | 216 | private OALicense CreateLicence(OpenApiLicense openApiLicense) 217 | { 218 | if (openApiLicense == null) return new OALicense(); 219 | 220 | return new OALicense() 221 | { 222 | Name = openApiLicense.Name, 223 | Url = openApiLicense.Url.ToString(), 224 | Present = true, 225 | }; 226 | } 227 | 228 | private OAExternalDocs CreateExternalDocs(OpenApiExternalDocs ExternalDocs) 229 | { 230 | if (ExternalDocs != null) 231 | { 232 | return new OAExternalDocs() 233 | { 234 | Description = ExternalDocs.Description, 235 | Url = ExternalDocs.Url.ToString(), 236 | }; 237 | } 238 | return new OAExternalDocs(); 239 | } 240 | 241 | private OAServer CreateAOServer(OpenApiServer s) 242 | { 243 | var server = new OAServer() 244 | { 245 | Description = s.Description, 246 | Url = s.Url, 247 | Variables = s.Variables.ToDictionary(v => v.Key, v => new OAServerVariable() 248 | { 249 | Name = v.Key, 250 | Description = v.Value.Description, 251 | Default = v.Value.Default, 252 | Enum = new List(v.Value.Enum), 253 | Current = v.Value.Enum.IndexOf(v.Value.Default) 254 | }).Values.ToList(), 255 | }; 256 | server.Variables.ForEach(v => 257 | { 258 | v.Default = v.Default.Trim('/'); 259 | if (v.Enum.Count == 0) 260 | { 261 | v.Enum = new List { v.Default }; 262 | } 263 | else 264 | { 265 | // trim all slashes for variants 266 | v.Enum = new List(v.Enum.Select(e => e.Trim('/'))); 267 | } 268 | v.Current = 0; 269 | }); 270 | return server; 271 | } 272 | 273 | } 274 | 275 | [CustomEditor(typeof(OpenApiParser))] 276 | public class OpenApiParserEditor : Editor 277 | { 278 | string url = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/uspto.yaml"; 279 | public override void OnInspectorGUI() 280 | { 281 | base.OnInspectorGUI(); 282 | 283 | GUILayout.Space(10); 284 | 285 | var t = (OpenApiParser)target; 286 | 287 | GUILayout.BeginVertical(); 288 | var a = serializedObject.FindProperty("textAsset"); 289 | EditorGUILayout.ObjectField(a); 290 | serializedObject.ApplyModifiedProperties(); 291 | if (GUILayout.Button("Parse From Asset")) 292 | { 293 | t.ParseFromAsset(); 294 | } 295 | GUILayout.EndVertical(); 296 | 297 | GUILayout.Space(10); 298 | 299 | GUILayout.BeginVertical(); 300 | url = EditorGUILayout.TextField(new GUIContent("URL"), url); 301 | if (GUILayout.Button("Parse From Url")) 302 | { 303 | t.ParseFromUrl(url); 304 | } 305 | GUILayout.EndVertical(); 306 | 307 | EditorUtility.SetDirty(target); 308 | } 309 | } 310 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Editor/OpenApiParser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a06f7085ffbc11b4caab468e88e66f90 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d13166a2989c4542a0fd057b43ec79e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e52e981da86682742871d7a8617788dc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi/net46.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b865e07d455e1e34eb57a9641775571c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi/net46/Microsoft.OpenApi.Readers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/UnityOpenApi/Microsoft/OpenApi/net46/Microsoft.OpenApi.Readers.dll -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi/net46/Microsoft.OpenApi.Readers.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04e1a3880872ddd4196fe1370541b217 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | platformData: 13 | - first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 0 20 | Exclude Linux: 1 21 | Exclude Linux64: 1 22 | Exclude LinuxUniversal: 1 23 | Exclude OSXUniversal: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude WindowsStoreApps: 1 28 | - first: 29 | Any: 30 | second: 31 | enabled: 0 32 | settings: {} 33 | - first: 34 | Editor: Editor 35 | second: 36 | enabled: 1 37 | settings: 38 | DefaultValueInitialized: true 39 | - first: 40 | Facebook: Win 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: None 45 | - first: 46 | Facebook: Win64 47 | second: 48 | enabled: 0 49 | settings: 50 | CPU: None 51 | - first: 52 | Standalone: Linux 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: None 57 | - first: 58 | Standalone: Linux64 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: None 63 | - first: 64 | Standalone: LinuxUniversal 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: None 69 | - first: 70 | Standalone: OSXUniversal 71 | second: 72 | enabled: 0 73 | settings: 74 | CPU: x86 75 | - first: 76 | Standalone: Win 77 | second: 78 | enabled: 0 79 | settings: 80 | CPU: None 81 | - first: 82 | Standalone: Win64 83 | second: 84 | enabled: 0 85 | settings: 86 | CPU: None 87 | - first: 88 | Windows Store Apps: WindowsStoreApps 89 | second: 90 | enabled: 0 91 | settings: 92 | CPU: AnyCPU 93 | userData: 94 | assetBundleName: 95 | assetBundleVariant: 96 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi/net46/Microsoft.OpenApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/UnityOpenApi/Microsoft/OpenApi/net46/Microsoft.OpenApi.dll -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi/net46/Microsoft.OpenApi.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c99d1994ed048334eb7b361326ce52ad 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | platformData: 13 | - first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 0 20 | Exclude Linux: 1 21 | Exclude Linux64: 1 22 | Exclude LinuxUniversal: 1 23 | Exclude OSXUniversal: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude WindowsStoreApps: 1 28 | - first: 29 | Any: 30 | second: 31 | enabled: 0 32 | settings: {} 33 | - first: 34 | Editor: Editor 35 | second: 36 | enabled: 1 37 | settings: 38 | DefaultValueInitialized: true 39 | - first: 40 | Facebook: Win 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: None 45 | - first: 46 | Facebook: Win64 47 | second: 48 | enabled: 0 49 | settings: 50 | CPU: None 51 | - first: 52 | Standalone: Linux 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: None 57 | - first: 58 | Standalone: Linux64 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: None 63 | - first: 64 | Standalone: LinuxUniversal 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: None 69 | - first: 70 | Standalone: OSXUniversal 71 | second: 72 | enabled: 0 73 | settings: 74 | CPU: x86 75 | - first: 76 | Standalone: Win 77 | second: 78 | enabled: 0 79 | settings: 80 | CPU: None 81 | - first: 82 | Standalone: Win64 83 | second: 84 | enabled: 0 85 | settings: 86 | CPU: None 87 | - first: 88 | Windows Store Apps: WindowsStoreApps 89 | second: 90 | enabled: 0 91 | settings: 92 | CPU: AnyCPU 93 | userData: 94 | assetBundleName: 95 | assetBundleVariant: 96 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi/net46/Microsoft.OpenApi.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27ff7b56d9cd63741abca398dc82ebf9 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi/net46/SharpYaml.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kolodi/UnityOpenApi/9309e036c81fa8ab393600c644397d940917e0c6/Assets/UnityOpenApi/Microsoft/OpenApi/net46/SharpYaml.dll -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Microsoft/OpenApi/net46/SharpYaml.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 927cfa8fd01d5a3468dfc432bb670577 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | platformData: 13 | - first: 14 | Any: 15 | second: 16 | enabled: 1 17 | settings: {} 18 | - first: 19 | Editor: Editor 20 | second: 21 | enabled: 0 22 | settings: 23 | DefaultValueInitialized: true 24 | - first: 25 | Windows Store Apps: WindowsStoreApps 26 | second: 27 | enabled: 0 28 | settings: 29 | CPU: AnyCPU 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a89fda3385ba9ab4b9b85efaa8dde764 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/ApiAsset.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using System.Linq; 4 | using System; 5 | using System.Text; 6 | using Proyecto26; 7 | using RSG; 8 | #if UNITY_EDITOR 9 | using UnityEditor; 10 | #endif 11 | 12 | namespace UnityOpenApi 13 | { 14 | [CreateAssetMenu(menuName = "Unity Open API/API Assets/API", fileName = "API asset")] 15 | public class ApiAsset : ScriptableObject 16 | { 17 | [SerializeField] 18 | [HideInInspector] 19 | OAServer _currentServer; 20 | public OAServer CurrentServer { get => _currentServer; set => _currentServer = value; } 21 | [SerializeField] 22 | [HideInInspector] 23 | public List servers; 24 | [SerializeField] 25 | public OAInfo info; 26 | [SerializeField] 27 | public OAExternalDocs externalDocs; 28 | public List pathItemAssets; 29 | 30 | internal IPromise ExecuteOperation(OAOperation operation) 31 | { 32 | var errorPromise = new Promise(); 33 | 34 | foreach(var p in operation.ParametersValues) 35 | { 36 | if (p.parameter.Required && string.IsNullOrEmpty(p.value)) 37 | { 38 | errorPromise.Reject(new Exception("Reuired parameter value missed")); 39 | return errorPromise; 40 | } 41 | } 42 | 43 | var paramsWithValues = operation.ParametersValues.Where(p => !string.IsNullOrEmpty(p.value)); 44 | 45 | var queryParams = paramsWithValues.Where(p => p.parameter.In == OAParameterLocation.Query) 46 | .ToDictionary(p => p.parameter.Name, p => p.value); 47 | 48 | var pathParams = paramsWithValues.Where(p => p.parameter.In == OAParameterLocation.Path) 49 | .ToDictionary(p => p.parameter.Name, p => p.value); 50 | 51 | var headerParams = paramsWithValues.Where(p => p.parameter.In == OAParameterLocation.Header) 52 | .ToDictionary(p => p.parameter.Name, p => p.value); 53 | 54 | string operationPath = BuildPathWithParams(operation.pathAsset.Path, pathParams); 55 | 56 | StringBuilder urlSb = new StringBuilder(BaseUrl); 57 | urlSb.Append(operationPath); 58 | urlSb.Append(BuildQueryString(queryParams)); 59 | 60 | string url = urlSb.ToString(); 61 | 62 | RequestHelper requestOptions = new RequestHelper() 63 | { 64 | Method = operation.OperationType.ToString(), 65 | Headers = headerParams, 66 | Uri = url, 67 | EnableDebug = true 68 | }; 69 | return RestClient.Request(requestOptions); 70 | 71 | } 72 | 73 | public string BaseUrl 74 | { 75 | get 76 | { 77 | var d = CurrentServer.Variables.ToDictionary(v => v.Name, v => v.Enum[v.Current]); 78 | return BuildPathWithParams(CurrentServer.Url, d); 79 | } 80 | } 81 | 82 | public string BuildPathWithParams(string path, Dictionary pathParams) 83 | { 84 | StringBuilder sb = new StringBuilder(path); 85 | foreach (var p in pathParams) 86 | { 87 | sb.Replace("{" + p.Key + "}", p.Value); 88 | } 89 | return sb.ToString(); 90 | } 91 | 92 | public string BuildQueryString(Dictionary parameters) 93 | { 94 | if (parameters.Count == 0) 95 | { 96 | return string.Empty; 97 | } 98 | StringBuilder sb = new StringBuilder("?"); 99 | 100 | foreach (var par in parameters) 101 | { 102 | 103 | sb.AppendFormat("{0}={1}&", par.Key, par.Value); 104 | 105 | } 106 | 107 | string result = sb.ToString(); 108 | int lastAnd = result.LastIndexOf('&'); 109 | if (lastAnd > 3) 110 | { 111 | result = result.Remove(lastAnd); 112 | } 113 | 114 | return result; 115 | } 116 | } 117 | 118 | #if UNITY_EDITOR 119 | [CustomEditor(typeof(ApiAsset))] 120 | public class ApiAssetEditor : Editor 121 | { 122 | int _currentServerIndex = 0; 123 | public override void OnInspectorGUI() 124 | { 125 | base.OnInspectorGUI(); 126 | 127 | var apiAsset = target as ApiAsset; 128 | var _servers = apiAsset.servers.Select(s => s.Url.Replace('/', '+')).ToArray(); 129 | GUILayout.Label("Current server: "); 130 | _currentServerIndex = EditorGUILayout.Popup(_currentServerIndex, _servers); 131 | 132 | apiAsset.CurrentServer = apiAsset.servers[_currentServerIndex]; 133 | 134 | if (apiAsset.CurrentServer.Variables != null) 135 | { 136 | GUILayout.Label("Variables: "); 137 | apiAsset.CurrentServer.Variables.ForEach(v => 138 | { 139 | v.Current = EditorGUILayout.Popup(v.Name, v.Current, v.Enum.ToArray()); 140 | }); 141 | } 142 | 143 | // Save the changes back to the object 144 | EditorUtility.SetDirty(target); 145 | } 146 | } 147 | #endif 148 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/ApiAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d2a7184f8e1aaa42b46af10ce732be1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAContact.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | 4 | namespace UnityOpenApi 5 | { 6 | [Serializable] 7 | public class OAContact 8 | { 9 | public string Name; 10 | public string Url; 11 | public string Email; 12 | public bool Present; 13 | } 14 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAContact.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c60468b4d536d24dbe89356edfd21c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAExternalDocs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public class OAExternalDocs 7 | { 8 | public string Description; 9 | public string Url; 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAExternalDocs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1e8ae84a3d2caa4e8c277536ca8f3a9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public class OAInfo 7 | { 8 | public string Title; 9 | public string Description; 10 | public string Version; 11 | public string TermsOfService; 12 | public OAContact Contact; 13 | public OALicense License; 14 | } 15 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efb7943ab188555438ddbe4f729b5769 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OALicense.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public class OALicense 7 | { 8 | public string Name; 9 | public string Url; 10 | public bool Present; 11 | } 12 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OALicense.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 665fb760b1e207848bb76f02bf83c352 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAOperation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace UnityOpenApi 8 | { 9 | [Serializable] 10 | public class OAOperation 11 | { 12 | 13 | public string OperationId; 14 | public AOOperationType OperationType; 15 | //public IList Security; 16 | public bool Deprecated; 17 | //public IDictionary Callbacks; 18 | //public OpenApiResponses Responses; 19 | public OARequestBody RequestBody; 20 | public List Parameters; 21 | public List ParametersValues; 22 | public OAExternalDocs ExternalDocs; 23 | public string Description; 24 | public string Summary; 25 | public List Tags; 26 | public List Servers; 27 | public PathItemAsset pathAsset; 28 | [SerializeField] private string cache; 29 | public string Cache 30 | { 31 | get { return cache; } 32 | set 33 | { 34 | cache = value; 35 | } 36 | } 37 | public bool ignoreCache = false; 38 | 39 | public bool GetFromCache(out string cache) 40 | { 41 | if (string.IsNullOrEmpty(this.Cache)) 42 | { 43 | cache = string.Empty; 44 | return false; 45 | } 46 | 47 | cache = this.Cache; 48 | return true; 49 | } 50 | 51 | public int OperationCurrentHash 52 | { 53 | get 54 | { 55 | // NOTE: the following does not guarantee the uniqueness of the hash :( 56 | int h = OperationType.GetHashCode(); 57 | 58 | if (string.IsNullOrEmpty(RequestBody.LastRequestBody) == false) 59 | h += RequestBody.LastRequestBody.GetHashCode(); 60 | 61 | ParametersValues.ForEach(pm => 62 | { 63 | if (pm.HasValue) h += pm.value.GetHashCode(); 64 | }); 65 | 66 | return h; 67 | } 68 | } 69 | 70 | 71 | public void SetParameterValue(string parameterName, string val) 72 | { 73 | var parVal = ParametersValues.FirstOrDefault(p => p.parameter.Name == parameterName); 74 | if (parVal == null) 75 | { 76 | throw new Exception("No parameter with name <" + parameterName + "> found in operation " + OperationId); 77 | } 78 | parVal.value = val; 79 | } 80 | 81 | public void SetRequestBody(string body) 82 | { 83 | RequestBody.LastRequestBody = body; 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAOperation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1459177d51db4a14086f88f6bdf91f93 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public class OAParameter 7 | { 8 | public string Name; 9 | public bool Required; 10 | public bool AllowReserved; 11 | public bool Explode; 12 | //public ParameterStyle? Style; 13 | public bool AllowEmptyValue; 14 | public bool Deprecated; 15 | public string Description; 16 | public OAParameterLocation In; 17 | public OAReference Reference; 18 | public bool UnresolvedReference; 19 | //public IDictionary Content; 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAParameter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fcc4e1ce5caf41498f8b485f1443a53 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAParameterLocation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public enum OAParameterLocation 7 | { 8 | Query = 0, 9 | Header = 1, 10 | Path = 2, 11 | Cookie = 3 12 | } 13 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAParameterLocation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e11f8e7dd971f294383407fd7762f537 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAReference.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public class OAReference 7 | { 8 | public string Id; 9 | public bool IsPresent; 10 | public string ExternalResource; 11 | public OAReferenceType Type; 12 | public bool IsExternal; 13 | public bool IsLocal; 14 | public string Reference; 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAReference.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4a768203fe9317b46b11082d9c38be54 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAReferenceType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public enum OAReferenceType 7 | { 8 | Schema = 0, 9 | Response = 1, 10 | Parameter = 2, 11 | Example = 3, 12 | RequestBody = 4, 13 | Header = 5, 14 | SecurityScheme = 6, 15 | Link = 7, 16 | Callback = 8, 17 | Tag = 9 18 | } 19 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAReferenceType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbf387c0be870c04e8260f5154d254d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OARequestBody.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public class OARequestBody 7 | { 8 | public string Description; 9 | public bool Required; 10 | 11 | public string LastRequestBody; 12 | } 13 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OARequestBody.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d3e7c3f23c3abe48b48255d4cd3a492 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAServer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace UnityOpenApi 6 | { 7 | [Serializable] 8 | public class OAServer 9 | { 10 | public string Description; 11 | public string Url; 12 | public List Variables; 13 | } 14 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAServer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c269a2887a3834a4699e99d86ee8a897 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAServerVariable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace UnityOpenApi 5 | { 6 | [Serializable] 7 | public class OAServerVariable 8 | { 9 | public string Name; 10 | public string Description; 11 | public string Default; 12 | public List Enum; 13 | public int Current; 14 | } 15 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OAServerVariable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f56be115e58fbd4bb43e403ad152c93 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OATag.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityOpenApi 4 | { 5 | [Serializable] 6 | public class OATag 7 | { 8 | public string Name; 9 | public string Description; 10 | public OAExternalDocs ExternalDocs; 11 | } 12 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OATag.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95291412d0b993e43bfb79191e8545bc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OperationType.cs: -------------------------------------------------------------------------------- 1 | namespace UnityOpenApi 2 | { 3 | public enum AOOperationType 4 | { 5 | GET = 0, 6 | PUT = 1, 7 | POST = 2, 8 | DELETE = 3, 9 | OPTIONS = 4, 10 | HEAD = 5, 11 | CREATE = 6 12 | } 13 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/OperationType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f447ecea76ea99745b0ecbf4ca6f2506 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/ParametersValues.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | #endif 6 | 7 | namespace UnityOpenApi 8 | { 9 | [Serializable] 10 | public class ParameterValue 11 | { 12 | [HideInInspector] 13 | public OAParameter parameter; 14 | public string value; 15 | public bool HasValue 16 | { 17 | get 18 | { 19 | return string.IsNullOrEmpty(value) == false; 20 | } 21 | } 22 | } 23 | 24 | #if UNITY_EDITOR 25 | [CustomPropertyDrawer(typeof(ParameterValue))] 26 | public class ParameterValueEditor : PropertyDrawer 27 | { 28 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 29 | { 30 | //OAParameter parameter = property.FindPropertyRelative("parameter"); 31 | var parNameRect = new Rect(position.x, position.y, EditorGUIUtility.labelWidth, position.height); 32 | var parValueRect = new Rect(position.x + EditorGUIUtility.labelWidth, position.y, position.width - (EditorGUIUtility.labelWidth), position.height); 33 | EditorGUI.LabelField(parNameRect, property.FindPropertyRelative("parameter.Name").stringValue); 34 | EditorGUI.PropertyField(parValueRect, property.FindPropertyRelative("value"), GUIContent.none); 35 | } 36 | } 37 | #endif 38 | } 39 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/ParametersValues.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7009db8b2fc78b847b5cae140ed2318b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/PathItemAsset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | using Newtonsoft.Json; 7 | using RSG; 8 | using Proyecto26; 9 | #if UNITY_EDITOR 10 | using UnityEditor; 11 | #endif 12 | 13 | namespace UnityOpenApi 14 | { 15 | [CreateAssetMenu(menuName = "Unity Open API/API Assets/Path Item", fileName = "Path asset")] 16 | public class PathItemAsset : ScriptableObject 17 | { 18 | [HideInInspector] 19 | public ApiAsset ApiAsset; 20 | 21 | public string Path; 22 | public string Summary; 23 | public string Description; 24 | public List Operations; 25 | public List Servers; 26 | public List Parameters; 27 | 28 | public OAOperation GetOperation(string operationId) 29 | { 30 | return Operations.First(o => o.OperationId == operationId); 31 | } 32 | 33 | public OAOperation GetOperation(AOOperationType operationType) 34 | { 35 | return Operations.First(o => o.OperationType == operationType); 36 | } 37 | 38 | /// 39 | /// To be used only for string type responses, like JSON. 40 | /// The string response is cached by default. 41 | /// 42 | /// API operation to execute 43 | /// A promise with a string response 44 | public IPromise ExecuteOperation(OAOperation operation) 45 | { 46 | var promise = new Promise(); 47 | 48 | if (operation.ignoreCache == false) 49 | { 50 | string data; 51 | if (operation.GetFromCache(out data)) 52 | { 53 | Debug.Log("From cahce"); 54 | promise.Resolve(data); 55 | return promise; 56 | } 57 | } 58 | 59 | 60 | ApiAsset.ExecuteOperation(operation) 61 | .Then(res => 62 | { 63 | if (res.Error == null) 64 | { 65 | operation.Cache = res.Text; 66 | } 67 | promise.Resolve(res.Text); 68 | }) 69 | .Catch(err => promise.Reject(err)); 70 | 71 | return promise; 72 | } 73 | 74 | /// 75 | /// Use this for not JSON responses like binary textures or asset bundles 76 | /// 77 | /// API operation to execute 78 | /// A promise with complete response wrapper containing UnityWebRequest with all data 79 | public IPromise ExecuteOperationRaw(OAOperation operation) 80 | { 81 | return ApiAsset.ExecuteOperation(operation); 82 | } 83 | 84 | /// 85 | /// Use this method for JSON data response only. 86 | /// The string response is cached by default. 87 | /// 88 | /// 89 | /// API operation to execute 90 | /// A promise with automatically parsed data from JSON 91 | public IPromise ExecuteOperation(OAOperation operation) 92 | { 93 | var promise = new Promise(); 94 | 95 | ExecuteOperation(operation) 96 | .Then(res => promise.Resolve(JsonConvert.DeserializeObject(res))) 97 | .Catch(err => promise.Reject(err)); 98 | 99 | return promise; 100 | } 101 | 102 | } 103 | 104 | #if UNITY_EDITOR 105 | [CustomEditor(typeof(PathItemAsset))] 106 | public class PathItemAssetEditor : Editor 107 | { 108 | public override void OnInspectorGUI() 109 | { 110 | base.OnInspectorGUI(); 111 | PathItemAsset pathItemAsset = (PathItemAsset)target; 112 | 113 | GUILayout.Space(10); 114 | GUILayout.Label("operations:"); 115 | GUILayout.BeginHorizontal(); 116 | pathItemAsset.Operations.ForEach(operation => 117 | { 118 | if (GUILayout.Button("Test " + operation.OperationId)) 119 | { 120 | pathItemAsset.ExecuteOperation(operation) 121 | .Then(response => 122 | { 123 | Debug.Log(response); 124 | }); 125 | } 126 | }); 127 | GUILayout.EndHorizontal(); 128 | } 129 | } 130 | #endif 131 | } 132 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/PathItemAsset.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da4dbea4eac91844abcb0f7cba90820a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/UnityOpenApi.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UnityOpenApi", 3 | "references": [ 4 | "RestClient" 5 | ], 6 | "optionalUnityReferences": [], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [] 14 | } -------------------------------------------------------------------------------- /Assets/UnityOpenApi/Scripts/UnityOpenApi.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e54514ce499d9a644b8f2ab80670f8e3 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.editorcoroutines": "0.0.2-preview.1", 4 | "com.unity.package-manager-ui": "2.0.3", 5 | "com.unity.modules.ai": "1.0.0", 6 | "com.unity.modules.animation": "1.0.0", 7 | "com.unity.modules.assetbundle": "1.0.0", 8 | "com.unity.modules.audio": "1.0.0", 9 | "com.unity.modules.cloth": "1.0.0", 10 | "com.unity.modules.director": "1.0.0", 11 | "com.unity.modules.imageconversion": "1.0.0", 12 | "com.unity.modules.imgui": "1.0.0", 13 | "com.unity.modules.jsonserialize": "1.0.0", 14 | "com.unity.modules.particlesystem": "1.0.0", 15 | "com.unity.modules.physics": "1.0.0", 16 | "com.unity.modules.physics2d": "1.0.0", 17 | "com.unity.modules.screencapture": "1.0.0", 18 | "com.unity.modules.terrain": "1.0.0", 19 | "com.unity.modules.terrainphysics": "1.0.0", 20 | "com.unity.modules.tilemap": "1.0.0", 21 | "com.unity.modules.ui": "1.0.0", 22 | "com.unity.modules.uielements": "1.0.0", 23 | "com.unity.modules.umbra": "1.0.0", 24 | "com.unity.modules.unityanalytics": "1.0.0", 25 | "com.unity.modules.unitywebrequest": "1.0.0", 26 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 27 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 28 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 29 | "com.unity.modules.unitywebrequestwww": "1.0.0", 30 | "com.unity.modules.vehicles": "1.0.0", 31 | "com.unity.modules.video": "1.0.0", 32 | "com.unity.modules.vr": "1.0.0", 33 | "com.unity.modules.wind": "1.0.0", 34 | "com.unity.modules.xr": "1.0.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 8 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Experiments/JSON/JsonNetSandbox.unity 10 | guid: 37c2d5f4387216044b4f75aa607e0ca1 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 41 | m_PreloadedShaders: [] 42 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 43 | type: 0} 44 | m_CustomRenderPipeline: {fileID: 0} 45 | m_TransparencySortMode: 0 46 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 47 | m_DefaultRenderingPath: 1 48 | m_DefaultMobileRenderingPath: 1 49 | m_TierSettings: [] 50 | m_LightmapStripping: 0 51 | m_FogStripping: 0 52 | m_InstancingStripping: 0 53 | m_LightmapKeepPlain: 1 54 | m_LightmapKeepDirCombined: 1 55 | m_LightmapKeepDynamicPlain: 1 56 | m_LightmapKeepDynamicDirCombined: 1 57 | m_LightmapKeepShadowMask: 1 58 | m_LightmapKeepSubtractive: 1 59 | m_FogKeepLinear: 1 60 | m_FogKeepExp: 1 61 | m_FogKeepExp2: 1 62 | m_AlbedoSwatchInfos: [] 63 | m_LightsUseLinearIntensity: 0 64 | m_LightsUseColorTemperature: 0 65 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_ReuseCollisionCallbacks: 1 28 | m_AutoSyncTransforms: 0 29 | m_AlwaysShowColliders: 0 30 | m_ShowColliderSleep: 1 31 | m_ShowColliderContacts: 0 32 | m_ShowColliderAABB: 0 33 | m_ContactArrowScale: 0.2 34 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 35 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 36 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 37 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 38 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 39 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | productGUID: 595ca6fd229730e45b7855cfa12cde41 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: OpenAPI 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 1 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | resizableWindow: 0 83 | useMacAppStoreValidation: 0 84 | macAppStoreCategory: public.app-category.games 85 | gpuSkinning: 1 86 | graphicsJobs: 0 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | graphicsJobMode: 0 95 | fullscreenMode: 1 96 | xboxSpeechDB: 0 97 | xboxEnableHeadOrientation: 0 98 | xboxEnableGuest: 0 99 | xboxEnablePIXSampling: 0 100 | metalFramebufferOnly: 0 101 | xboxOneResolution: 0 102 | xboxOneSResolution: 0 103 | xboxOneXResolution: 3 104 | xboxOneMonoLoggingLevel: 0 105 | xboxOneLoggingLevel: 1 106 | xboxOneDisableEsram: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 0 109 | vulkanEnableSetSRGBWrite: 0 110 | m_SupportedAspectRatios: 111 | 4:3: 1 112 | 5:4: 1 113 | 16:10: 1 114 | 16:9: 1 115 | Others: 1 116 | bundleVersion: 0.1 117 | preloadedAssets: [] 118 | metroInputSource: 0 119 | wsaTransparentSwapchain: 0 120 | m_HolographicPauseOnTrackingLoss: 1 121 | xboxOneDisableKinectGpuReservation: 0 122 | xboxOneEnable7thCore: 0 123 | isWsaHolographicRemotingEnabled: 0 124 | vrSettings: 125 | cardboard: 126 | depthFormat: 0 127 | enableTransitionView: 0 128 | daydream: 129 | depthFormat: 0 130 | useSustainedPerformanceMode: 0 131 | enableVideoLayer: 0 132 | useProtectedVideoMemory: 0 133 | minimumSupportedHeadTracking: 0 134 | maximumSupportedHeadTracking: 1 135 | hololens: 136 | depthFormat: 1 137 | depthBufferSharingEnabled: 0 138 | oculus: 139 | sharedDepthBuffer: 1 140 | dashSupport: 1 141 | enable360StereoCapture: 0 142 | protectGraphicsMemory: 0 143 | enableFrameTimingStats: 0 144 | useHDRDisplay: 0 145 | m_ColorGamuts: 00000000 146 | targetPixelDensity: 30 147 | resolutionScalingMode: 0 148 | androidSupportedAspectRatio: 1 149 | androidMaxAspectRatio: 2.1 150 | applicationIdentifier: {} 151 | buildNumber: {} 152 | AndroidBundleVersionCode: 1 153 | AndroidMinSdkVersion: 16 154 | AndroidTargetSdkVersion: 0 155 | AndroidPreferredInstallLocation: 1 156 | aotOptions: 157 | stripEngineCode: 1 158 | iPhoneStrippingLevel: 0 159 | iPhoneScriptCallOptimization: 0 160 | ForceInternetPermission: 0 161 | ForceSDCardPermission: 0 162 | CreateWallpaper: 0 163 | APKExpansionFiles: 0 164 | keepLoadedShadersAlive: 0 165 | StripUnusedMeshComponents: 1 166 | VertexChannelCompressionMask: 4054 167 | iPhoneSdkVersion: 988 168 | iOSTargetOSVersionString: 9.0 169 | tvOSSdkVersion: 0 170 | tvOSRequireExtendedGameController: 0 171 | tvOSTargetOSVersionString: 9.0 172 | uIPrerenderedIcon: 0 173 | uIRequiresPersistentWiFi: 0 174 | uIRequiresFullScreen: 1 175 | uIStatusBarHidden: 1 176 | uIExitOnSuspend: 0 177 | uIStatusBarStyle: 0 178 | iPhoneSplashScreen: {fileID: 0} 179 | iPhoneHighResSplashScreen: {fileID: 0} 180 | iPhoneTallHighResSplashScreen: {fileID: 0} 181 | iPhone47inSplashScreen: {fileID: 0} 182 | iPhone55inPortraitSplashScreen: {fileID: 0} 183 | iPhone55inLandscapeSplashScreen: {fileID: 0} 184 | iPhone58inPortraitSplashScreen: {fileID: 0} 185 | iPhone58inLandscapeSplashScreen: {fileID: 0} 186 | iPadPortraitSplashScreen: {fileID: 0} 187 | iPadHighResPortraitSplashScreen: {fileID: 0} 188 | iPadLandscapeSplashScreen: {fileID: 0} 189 | iPadHighResLandscapeSplashScreen: {fileID: 0} 190 | appleTVSplashScreen: {fileID: 0} 191 | appleTVSplashScreen2x: {fileID: 0} 192 | tvOSSmallIconLayers: [] 193 | tvOSSmallIconLayers2x: [] 194 | tvOSLargeIconLayers: [] 195 | tvOSLargeIconLayers2x: [] 196 | tvOSTopShelfImageLayers: [] 197 | tvOSTopShelfImageLayers2x: [] 198 | tvOSTopShelfImageWideLayers: [] 199 | tvOSTopShelfImageWideLayers2x: [] 200 | iOSLaunchScreenType: 0 201 | iOSLaunchScreenPortrait: {fileID: 0} 202 | iOSLaunchScreenLandscape: {fileID: 0} 203 | iOSLaunchScreenBackgroundColor: 204 | serializedVersion: 2 205 | rgba: 0 206 | iOSLaunchScreenFillPct: 100 207 | iOSLaunchScreenSize: 100 208 | iOSLaunchScreenCustomXibPath: 209 | iOSLaunchScreeniPadType: 0 210 | iOSLaunchScreeniPadImage: {fileID: 0} 211 | iOSLaunchScreeniPadBackgroundColor: 212 | serializedVersion: 2 213 | rgba: 0 214 | iOSLaunchScreeniPadFillPct: 100 215 | iOSLaunchScreeniPadSize: 100 216 | iOSLaunchScreeniPadCustomXibPath: 217 | iOSUseLaunchScreenStoryboard: 0 218 | iOSLaunchScreenCustomStoryboardPath: 219 | iOSDeviceRequirements: [] 220 | iOSURLSchemes: [] 221 | iOSBackgroundModes: 0 222 | iOSMetalForceHardShadows: 0 223 | metalEditorSupport: 1 224 | metalAPIValidation: 1 225 | iOSRenderExtraFrameOnPause: 0 226 | appleDeveloperTeamID: 227 | iOSManualSigningProvisioningProfileID: 228 | tvOSManualSigningProvisioningProfileID: 229 | iOSManualSigningProvisioningProfileType: 0 230 | tvOSManualSigningProvisioningProfileType: 0 231 | appleEnableAutomaticSigning: 0 232 | iOSRequireARKit: 0 233 | appleEnableProMotion: 0 234 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 235 | templatePackageId: com.unity.template.3d@1.0.4 236 | templateDefaultScene: Assets/Scenes/SampleScene.unity 237 | AndroidTargetArchitectures: 5 238 | AndroidSplashScreenScale: 0 239 | androidSplashScreen: {fileID: 0} 240 | AndroidKeystoreName: 241 | AndroidKeyaliasName: 242 | AndroidBuildApkPerCpuArchitecture: 0 243 | AndroidTVCompatibility: 1 244 | AndroidIsGame: 1 245 | AndroidEnableTango: 0 246 | androidEnableBanner: 1 247 | androidUseLowAccuracyLocation: 0 248 | m_AndroidBanners: 249 | - width: 320 250 | height: 180 251 | banner: {fileID: 0} 252 | androidGamepadSupportLevel: 0 253 | resolutionDialogBanner: {fileID: 0} 254 | m_BuildTargetIcons: [] 255 | m_BuildTargetPlatformIcons: [] 256 | m_BuildTargetBatching: 257 | - m_BuildTarget: Standalone 258 | m_StaticBatching: 1 259 | m_DynamicBatching: 0 260 | - m_BuildTarget: tvOS 261 | m_StaticBatching: 1 262 | m_DynamicBatching: 0 263 | - m_BuildTarget: Android 264 | m_StaticBatching: 1 265 | m_DynamicBatching: 0 266 | - m_BuildTarget: iPhone 267 | m_StaticBatching: 1 268 | m_DynamicBatching: 0 269 | - m_BuildTarget: WebGL 270 | m_StaticBatching: 0 271 | m_DynamicBatching: 0 272 | m_BuildTargetGraphicsAPIs: 273 | - m_BuildTarget: AndroidPlayer 274 | m_APIs: 0b00000008000000 275 | m_Automatic: 1 276 | - m_BuildTarget: iOSSupport 277 | m_APIs: 10000000 278 | m_Automatic: 1 279 | - m_BuildTarget: AppleTVSupport 280 | m_APIs: 10000000 281 | m_Automatic: 0 282 | - m_BuildTarget: WebGLSupport 283 | m_APIs: 0b000000 284 | m_Automatic: 1 285 | m_BuildTargetVRSettings: 286 | - m_BuildTarget: Standalone 287 | m_Enabled: 0 288 | m_Devices: 289 | - Oculus 290 | - OpenVR 291 | m_BuildTargetEnableVuforiaSettings: [] 292 | openGLRequireES31: 0 293 | openGLRequireES31AEP: 0 294 | m_TemplateCustomTags: {} 295 | mobileMTRendering: 296 | Android: 1 297 | iPhone: 1 298 | tvOS: 1 299 | m_BuildTargetGroupLightmapEncodingQuality: [] 300 | m_BuildTargetGroupLightmapSettings: [] 301 | playModeTestRunnerEnabled: 0 302 | runPlayModeTestAsEditModeTest: 0 303 | actionOnDotNetUnhandledException: 1 304 | enableInternalProfiler: 0 305 | logObjCUncaughtExceptions: 1 306 | enableCrashReportAPI: 0 307 | cameraUsageDescription: 308 | locationUsageDescription: 309 | microphoneUsageDescription: 310 | switchNetLibKey: 311 | switchSocketMemoryPoolSize: 6144 312 | switchSocketAllocatorPoolSize: 128 313 | switchSocketConcurrencyLimit: 14 314 | switchScreenResolutionBehavior: 2 315 | switchUseCPUProfiler: 0 316 | switchApplicationID: 0x01004b9000490000 317 | switchNSODependencies: 318 | switchTitleNames_0: 319 | switchTitleNames_1: 320 | switchTitleNames_2: 321 | switchTitleNames_3: 322 | switchTitleNames_4: 323 | switchTitleNames_5: 324 | switchTitleNames_6: 325 | switchTitleNames_7: 326 | switchTitleNames_8: 327 | switchTitleNames_9: 328 | switchTitleNames_10: 329 | switchTitleNames_11: 330 | switchTitleNames_12: 331 | switchTitleNames_13: 332 | switchTitleNames_14: 333 | switchPublisherNames_0: 334 | switchPublisherNames_1: 335 | switchPublisherNames_2: 336 | switchPublisherNames_3: 337 | switchPublisherNames_4: 338 | switchPublisherNames_5: 339 | switchPublisherNames_6: 340 | switchPublisherNames_7: 341 | switchPublisherNames_8: 342 | switchPublisherNames_9: 343 | switchPublisherNames_10: 344 | switchPublisherNames_11: 345 | switchPublisherNames_12: 346 | switchPublisherNames_13: 347 | switchPublisherNames_14: 348 | switchIcons_0: {fileID: 0} 349 | switchIcons_1: {fileID: 0} 350 | switchIcons_2: {fileID: 0} 351 | switchIcons_3: {fileID: 0} 352 | switchIcons_4: {fileID: 0} 353 | switchIcons_5: {fileID: 0} 354 | switchIcons_6: {fileID: 0} 355 | switchIcons_7: {fileID: 0} 356 | switchIcons_8: {fileID: 0} 357 | switchIcons_9: {fileID: 0} 358 | switchIcons_10: {fileID: 0} 359 | switchIcons_11: {fileID: 0} 360 | switchIcons_12: {fileID: 0} 361 | switchIcons_13: {fileID: 0} 362 | switchIcons_14: {fileID: 0} 363 | switchSmallIcons_0: {fileID: 0} 364 | switchSmallIcons_1: {fileID: 0} 365 | switchSmallIcons_2: {fileID: 0} 366 | switchSmallIcons_3: {fileID: 0} 367 | switchSmallIcons_4: {fileID: 0} 368 | switchSmallIcons_5: {fileID: 0} 369 | switchSmallIcons_6: {fileID: 0} 370 | switchSmallIcons_7: {fileID: 0} 371 | switchSmallIcons_8: {fileID: 0} 372 | switchSmallIcons_9: {fileID: 0} 373 | switchSmallIcons_10: {fileID: 0} 374 | switchSmallIcons_11: {fileID: 0} 375 | switchSmallIcons_12: {fileID: 0} 376 | switchSmallIcons_13: {fileID: 0} 377 | switchSmallIcons_14: {fileID: 0} 378 | switchManualHTML: 379 | switchAccessibleURLs: 380 | switchLegalInformation: 381 | switchMainThreadStackSize: 1048576 382 | switchPresenceGroupId: 383 | switchLogoHandling: 0 384 | switchReleaseVersion: 0 385 | switchDisplayVersion: 1.0.0 386 | switchStartupUserAccount: 0 387 | switchTouchScreenUsage: 0 388 | switchSupportedLanguagesMask: 0 389 | switchLogoType: 0 390 | switchApplicationErrorCodeCategory: 391 | switchUserAccountSaveDataSize: 0 392 | switchUserAccountSaveDataJournalSize: 0 393 | switchApplicationAttribute: 0 394 | switchCardSpecSize: -1 395 | switchCardSpecClock: -1 396 | switchRatingsMask: 0 397 | switchRatingsInt_0: 0 398 | switchRatingsInt_1: 0 399 | switchRatingsInt_2: 0 400 | switchRatingsInt_3: 0 401 | switchRatingsInt_4: 0 402 | switchRatingsInt_5: 0 403 | switchRatingsInt_6: 0 404 | switchRatingsInt_7: 0 405 | switchRatingsInt_8: 0 406 | switchRatingsInt_9: 0 407 | switchRatingsInt_10: 0 408 | switchRatingsInt_11: 0 409 | switchLocalCommunicationIds_0: 410 | switchLocalCommunicationIds_1: 411 | switchLocalCommunicationIds_2: 412 | switchLocalCommunicationIds_3: 413 | switchLocalCommunicationIds_4: 414 | switchLocalCommunicationIds_5: 415 | switchLocalCommunicationIds_6: 416 | switchLocalCommunicationIds_7: 417 | switchParentalControl: 0 418 | switchAllowsScreenshot: 1 419 | switchAllowsVideoCapturing: 1 420 | switchAllowsRuntimeAddOnContentInstall: 0 421 | switchDataLossConfirmation: 0 422 | switchUserAccountLockEnabled: 0 423 | switchSupportedNpadStyles: 3 424 | switchNativeFsCacheSize: 32 425 | switchIsHoldTypeHorizontal: 0 426 | switchSupportedNpadCount: 8 427 | switchSocketConfigEnabled: 0 428 | switchTcpInitialSendBufferSize: 32 429 | switchTcpInitialReceiveBufferSize: 64 430 | switchTcpAutoSendBufferSizeMax: 256 431 | switchTcpAutoReceiveBufferSizeMax: 256 432 | switchUdpSendBufferSize: 9 433 | switchUdpReceiveBufferSize: 42 434 | switchSocketBufferEfficiency: 4 435 | switchSocketInitializeEnabled: 1 436 | switchNetworkInterfaceManagerInitializeEnabled: 1 437 | switchPlayerConnectionEnabled: 1 438 | ps4NPAgeRating: 12 439 | ps4NPTitleSecret: 440 | ps4NPTrophyPackPath: 441 | ps4ParentalLevel: 11 442 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 443 | ps4Category: 0 444 | ps4MasterVersion: 01.00 445 | ps4AppVersion: 01.00 446 | ps4AppType: 0 447 | ps4ParamSfxPath: 448 | ps4VideoOutPixelFormat: 0 449 | ps4VideoOutInitialWidth: 1920 450 | ps4VideoOutBaseModeInitialWidth: 1920 451 | ps4VideoOutReprojectionRate: 60 452 | ps4PronunciationXMLPath: 453 | ps4PronunciationSIGPath: 454 | ps4BackgroundImagePath: 455 | ps4StartupImagePath: 456 | ps4StartupImagesFolder: 457 | ps4IconImagesFolder: 458 | ps4SaveDataImagePath: 459 | ps4SdkOverride: 460 | ps4BGMPath: 461 | ps4ShareFilePath: 462 | ps4ShareOverlayImagePath: 463 | ps4PrivacyGuardImagePath: 464 | ps4NPtitleDatPath: 465 | ps4RemotePlayKeyAssignment: -1 466 | ps4RemotePlayKeyMappingDir: 467 | ps4PlayTogetherPlayerCount: 0 468 | ps4EnterButtonAssignment: 1 469 | ps4ApplicationParam1: 0 470 | ps4ApplicationParam2: 0 471 | ps4ApplicationParam3: 0 472 | ps4ApplicationParam4: 0 473 | ps4DownloadDataSize: 0 474 | ps4GarlicHeapSize: 2048 475 | ps4ProGarlicHeapSize: 2560 476 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 477 | ps4pnSessions: 1 478 | ps4pnPresence: 1 479 | ps4pnFriends: 1 480 | ps4pnGameCustomData: 1 481 | playerPrefsSupport: 0 482 | enableApplicationExit: 0 483 | resetTempFolder: 1 484 | restrictedAudioUsageRights: 0 485 | ps4UseResolutionFallback: 0 486 | ps4ReprojectionSupport: 0 487 | ps4UseAudio3dBackend: 0 488 | ps4SocialScreenEnabled: 0 489 | ps4ScriptOptimizationLevel: 0 490 | ps4Audio3dVirtualSpeakerCount: 14 491 | ps4attribCpuUsage: 0 492 | ps4PatchPkgPath: 493 | ps4PatchLatestPkgPath: 494 | ps4PatchChangeinfoPath: 495 | ps4PatchDayOne: 0 496 | ps4attribUserManagement: 0 497 | ps4attribMoveSupport: 0 498 | ps4attrib3DSupport: 0 499 | ps4attribShareSupport: 0 500 | ps4attribExclusiveVR: 0 501 | ps4disableAutoHideSplash: 0 502 | ps4videoRecordingFeaturesUsed: 0 503 | ps4contentSearchFeaturesUsed: 0 504 | ps4attribEyeToEyeDistanceSettingVR: 0 505 | ps4IncludedModules: [] 506 | monoEnv: 507 | splashScreenBackgroundSourceLandscape: {fileID: 0} 508 | splashScreenBackgroundSourcePortrait: {fileID: 0} 509 | spritePackerPolicy: 510 | webGLMemorySize: 256 511 | webGLExceptionSupport: 1 512 | webGLNameFilesAsHashes: 0 513 | webGLDataCaching: 1 514 | webGLDebugSymbols: 0 515 | webGLEmscriptenArgs: 516 | webGLModulesDirectory: 517 | webGLTemplate: APPLICATION:Default 518 | webGLAnalyzeBuildSize: 0 519 | webGLUseEmbeddedResources: 0 520 | webGLCompressionFormat: 1 521 | webGLLinkerTarget: 1 522 | webGLThreadsSupport: 0 523 | scriptingDefineSymbols: {} 524 | platformArchitecture: {} 525 | scriptingBackend: {} 526 | il2cppCompilerConfiguration: {} 527 | managedStrippingLevel: {} 528 | incrementalIl2cppBuild: {} 529 | allowUnsafeCode: 0 530 | additionalIl2CppArgs: 531 | scriptingRuntimeVersion: 1 532 | apiCompatibilityLevelPerPlatform: {} 533 | m_RenderingPath: 1 534 | m_MobileRenderingPath: 1 535 | metroPackageName: Template_3D 536 | metroPackageVersion: 537 | metroCertificatePath: 538 | metroCertificatePassword: 539 | metroCertificateSubject: 540 | metroCertificateIssuer: 541 | metroCertificateNotAfter: 0000000000000000 542 | metroApplicationDescription: Template_3D 543 | wsaImages: {} 544 | metroTileShortName: 545 | metroTileShowName: 0 546 | metroMediumTileShowName: 0 547 | metroLargeTileShowName: 0 548 | metroWideTileShowName: 0 549 | metroSupportStreamingInstall: 0 550 | metroLastRequiredScene: 0 551 | metroDefaultTileSize: 1 552 | metroTileForegroundText: 2 553 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 554 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 555 | a: 1} 556 | metroSplashScreenUseBackgroundColor: 0 557 | platformCapabilities: {} 558 | metroTargetDeviceFamilies: {} 559 | metroFTAName: 560 | metroFTAFileTypes: [] 561 | metroProtocolName: 562 | metroCompilationOverrides: 1 563 | XboxOneProductId: 564 | XboxOneUpdateKey: 565 | XboxOneSandboxId: 566 | XboxOneContentId: 567 | XboxOneTitleId: 568 | XboxOneSCId: 569 | XboxOneGameOsOverridePath: 570 | XboxOnePackagingOverridePath: 571 | XboxOneAppManifestOverridePath: 572 | XboxOneVersion: 1.0.0.0 573 | XboxOnePackageEncryption: 0 574 | XboxOnePackageUpdateGranularity: 2 575 | XboxOneDescription: 576 | XboxOneLanguage: 577 | - enus 578 | XboxOneCapability: [] 579 | XboxOneGameRating: {} 580 | XboxOneIsContentPackage: 0 581 | XboxOneEnableGPUVariability: 0 582 | XboxOneSockets: {} 583 | XboxOneSplashScreen: {fileID: 0} 584 | XboxOneAllowedProductIds: [] 585 | XboxOnePersistentLocalStorageSize: 0 586 | XboxOneXTitleMemory: 8 587 | xboxOneScriptCompiler: 0 588 | XboxOneOverrideIdentityName: 589 | vrEditorSettings: 590 | daydream: 591 | daydreamIconForeground: {fileID: 0} 592 | daydreamIconBackground: {fileID: 0} 593 | cloudServicesEnabled: 594 | UNet: 1 595 | luminIcon: 596 | m_Name: 597 | m_ModelFolderPath: 598 | m_PortalFolderPath: 599 | luminCert: 600 | m_CertPath: 601 | m_PrivateKeyPath: 602 | luminIsChannelApp: 0 603 | luminVersion: 604 | m_VersionCode: 1 605 | m_VersionName: 606 | facebookSdkVersion: 7.9.4 607 | facebookAppId: 608 | facebookCookies: 1 609 | facebookLogging: 1 610 | facebookStatus: 1 611 | facebookXfbml: 0 612 | facebookFrictionlessRequests: 1 613 | apiCompatibilityLevel: 6 614 | cloudProjectId: 615 | framebufferDepthMemorylessMode: 0 616 | projectName: 617 | organizationId: 618 | cloudEnabled: 0 619 | enableNativePlatformBackendsForNewInputSystem: 0 620 | disableOldInputManagerSupport: 0 621 | legacyClampBlendShapeWeights: 0 622 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.3.3f1 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 4 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 16 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 16 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 16 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 16 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 16 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 16 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - PostProcessing 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityOpenApi 2 | 3 | Open API parser and client generator for Unity 4 | 5 | ## [Concept diagram](https://docs.google.com/drawings/d/1c1kjdK5TJ_ZHc8onSXXMQAmeI5XNVedIPpmzbtxMUb0/edit?usp=sharing) 6 | 7 | ![Concept diagram](https://docs.google.com/drawings/d/e/2PACX-1vQ6CBoYeIMd8nBpVpFzsYqGuJ-uEJyfCSUIWKjCc_XvJu1M7GhKFNqHP_eoJxzDkhxCsJPp6mewKzZA/pub?w=844&h=617) 8 | 9 | ## Purpose 10 | 11 | Parsing OpenAPI documents and creating reusable Unity assets for easy API consuming in your Unity projects. Designed to work on any target platform. 12 | 13 | ## Getting Started 14 | 15 | Use **Api Parser** ScriptableObject to parse OpenAPI description from file or url. You will be prompted to select the folder where to put the generated API assets. You can select the same folder next time to update assets, this will aslo assure to preserve all existing references to these assets within the project. 16 | 17 | There are 2 types of assets generated: 18 | * The main API Asset containing all common data and settings 19 | * The path assets for each individual path in the API, these assets are then references in different places of your project to consume the API. 20 | 21 | ### Prerequisites 22 | 23 | Unity 2018.3 was used, but it should be compatible with older versions as well. 24 | 25 | ### Installing 26 | 27 | Just clone the repository and open the project in Unity. 28 | All meta files are preserved. 29 | During the first launch, Unity can take a bit to generate caches. 30 | 31 | ## Running the tests 32 | 33 | There are no automated tests for now 34 | 35 | ## Third party libraries and packages 36 | 37 | * [Editor Coroutines](https://docs.unity3d.com/Packages/com.unity.editorcoroutines@0.0/manual/index.html) - allows you to test web requests in editor without hitting play button 38 | * [JSON.NET for Unity](https://www.parentelement.com/assets/json_net_unity) - parsing your data 39 | * [OpenAPI.NET](https://github.com/Microsoft/OpenAPI.NET) - parsing Swagger and OpenAPI3 documents (JSON and YAML) 40 | * [RestClient](https://github.com/proyecto26/RestClient) - Multiplatform promise based Http Handler 41 | 42 | ## Roadmap 43 | - [x] support all http methods 44 | - [ ] authorization assets generation and automatic use for where required 45 | - [ ] data model generation 46 | - [x] better http response wrapper, support for progress callbacks/events 47 | 48 | ## Contributing 49 | 50 | Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us. 51 | 52 | ## Authors 53 | 54 | * **Kolodi** - *Initial work* - [kolodi](https://github.com/kolodi) 55 | 56 | ## License 57 | 58 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details 59 | 60 | ## Acknowledgments 61 | 62 | * Inspired by [OpenAPI Tools](https://github.com/OpenAPITools) 63 | --------------------------------------------------------------------------------