├── .gitignore ├── .vsconfig ├── Assets ├── PreviewImage.jpg ├── PreviewImage.jpg.meta ├── Scenes.meta ├── Scenes │ ├── MainScene.unity │ ├── MainScene.unity.meta │ ├── Scene2.unity │ └── Scene2.unity.meta ├── Scripts.meta └── Scripts │ ├── Logger.cs │ ├── Logger.cs.meta │ ├── SceneSwitcher.cs │ ├── SceneSwitcher.cs.meta │ ├── SteamAppsTest.cs │ ├── SteamAppsTest.cs.meta │ ├── SteamClientTest.cs │ ├── SteamClientTest.cs.meta │ ├── SteamFriendsTest.cs │ ├── SteamFriendsTest.cs.meta │ ├── SteamHTMLSurfaceTest.cs │ ├── SteamHTMLSurfaceTest.cs.meta │ ├── SteamHTTPTest.cs │ ├── SteamHTTPTest.cs.meta │ ├── SteamInputTest.cs │ ├── SteamInputTest.cs.meta │ ├── SteamInventoryTest.cs │ ├── SteamInventoryTest.cs.meta │ ├── SteamMatchmakingServersTest.cs │ ├── SteamMatchmakingServersTest.cs.meta │ ├── SteamMatchmakingTest.cs │ ├── SteamMatchmakingTest.cs.meta │ ├── SteamMusicRemoteTest.cs │ ├── SteamMusicRemoteTest.cs.meta │ ├── SteamMusicTest.cs │ ├── SteamMusicTest.cs.meta │ ├── SteamNetworkingTest.cs │ ├── SteamNetworkingTest.cs.meta │ ├── SteamParentalSettingsTest.cs │ ├── SteamParentalSettingsTest.cs.meta │ ├── SteamPartiesTest.cs │ ├── SteamPartiesTest.cs.meta │ ├── SteamRemoteStorageTest.cs │ ├── SteamRemoteStorageTest.cs.meta │ ├── SteamScreenshotsTest.cs │ ├── SteamScreenshotsTest.cs.meta │ ├── SteamTest.cs │ ├── SteamTest.cs.meta │ ├── SteamTimelineTest.cs │ ├── SteamTimelineTest.cs.meta │ ├── SteamUGCTest.cs │ ├── SteamUGCTest.cs.meta │ ├── SteamUserStatsTest.cs │ ├── SteamUserStatsTest.cs.meta │ ├── SteamUserTest.cs │ ├── SteamUserTest.cs.meta │ ├── SteamUtilsTest.cs │ ├── SteamUtilsTest.cs.meta │ ├── SteamVideoTest.cs │ ├── SteamVideoTest.cs.meta │ ├── TestConstants.cs │ └── TestConstants.cs.meta ├── LICENSE.txt ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Folders 2 | /.DS_Store/ 3 | /.vs/ 4 | /.vscode/ 5 | /Library/ 6 | /obj/ 7 | /Temp/ 8 | /Logs/ 9 | /UserSettings/ 10 | 11 | # Files 12 | *.csproj 13 | *.sln 14 | *.VC.db 15 | /steam_appid.txt 16 | -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/PreviewImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rlabrecque/Steamworks.NET-Test/7745874b04a01bff06c7bdb3a3525f29e48bd525/Assets/PreviewImage.jpg -------------------------------------------------------------------------------- /Assets/PreviewImage.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8741a2d9febd84048afc77d2b2d24a22 3 | timeCreated: 1495643570 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0e0e2ca8ea7ab54b9e0e11923a8f865 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Scenes/MainScene.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.2, g: 0.2, b: 0.2, a: 1} 24 | m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} 25 | m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 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, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &4 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 1 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: 1 59 | m_BakeResolution: 50 60 | m_AtlasSize: 1024 61 | m_AO: 1 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: 0 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 1 74 | m_BakeBackend: 0 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: 0 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: 0 93 | --- !u!196 &5 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.16666666 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &132980946 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: 132980947} 124 | - component: {fileID: 132980948} 125 | - component: {fileID: 132980950} 126 | - component: {fileID: 132980949} 127 | m_Layer: 0 128 | m_Name: Steamworks 129 | m_TagString: Untagged 130 | m_Icon: {fileID: 0} 131 | m_NavMeshLayer: 0 132 | m_StaticEditorFlags: 0 133 | m_IsActive: 1 134 | --- !u!4 &132980947 135 | Transform: 136 | m_ObjectHideFlags: 0 137 | m_CorrespondingSourceObject: {fileID: 0} 138 | m_PrefabInstance: {fileID: 0} 139 | m_PrefabAsset: {fileID: 0} 140 | m_GameObject: {fileID: 132980946} 141 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 142 | m_LocalPosition: {x: 0, y: 0, z: 0} 143 | m_LocalScale: {x: 1, y: 1, z: 1} 144 | m_Children: [] 145 | m_Father: {fileID: 0} 146 | m_RootOrder: 0 147 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 148 | --- !u!114 &132980948 149 | MonoBehaviour: 150 | m_ObjectHideFlags: 0 151 | m_CorrespondingSourceObject: {fileID: 0} 152 | m_PrefabInstance: {fileID: 0} 153 | m_PrefabAsset: {fileID: 0} 154 | m_GameObject: {fileID: 132980946} 155 | m_Enabled: 1 156 | m_EditorHideFlags: 0 157 | m_Script: {fileID: 11500000, guid: 9abdaac55413bc14a99f1423017a29df, type: 3} 158 | m_Name: 159 | m_EditorClassIdentifier: 160 | --- !u!114 &132980949 161 | MonoBehaviour: 162 | m_ObjectHideFlags: 0 163 | m_CorrespondingSourceObject: {fileID: 0} 164 | m_PrefabInstance: {fileID: 0} 165 | m_PrefabAsset: {fileID: 0} 166 | m_GameObject: {fileID: 132980946} 167 | m_Enabled: 1 168 | m_EditorHideFlags: 0 169 | m_Script: {fileID: 11500000, guid: ab12582c09dc3054b84569c6e889d60b, type: 3} 170 | m_Name: 171 | m_EditorClassIdentifier: 172 | --- !u!114 &132980950 173 | MonoBehaviour: 174 | m_ObjectHideFlags: 0 175 | m_CorrespondingSourceObject: {fileID: 0} 176 | m_PrefabInstance: {fileID: 0} 177 | m_PrefabAsset: {fileID: 0} 178 | m_GameObject: {fileID: 132980946} 179 | m_Enabled: 1 180 | m_EditorHideFlags: 0 181 | m_Script: {fileID: 11500000, guid: cf808364797b1dd4491ffd139efff999, type: 3} 182 | m_Name: 183 | m_EditorClassIdentifier: 184 | --- !u!1 &454704941 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: 454704944} 193 | - component: {fileID: 454704943} 194 | - component: {fileID: 454704942} 195 | m_Layer: 0 196 | m_Name: Camera 197 | m_TagString: Untagged 198 | m_Icon: {fileID: 0} 199 | m_NavMeshLayer: 0 200 | m_StaticEditorFlags: 0 201 | m_IsActive: 1 202 | --- !u!81 &454704942 203 | AudioListener: 204 | m_ObjectHideFlags: 0 205 | m_CorrespondingSourceObject: {fileID: 0} 206 | m_PrefabInstance: {fileID: 0} 207 | m_PrefabAsset: {fileID: 0} 208 | m_GameObject: {fileID: 454704941} 209 | m_Enabled: 1 210 | --- !u!20 &454704943 211 | Camera: 212 | m_ObjectHideFlags: 0 213 | m_CorrespondingSourceObject: {fileID: 0} 214 | m_PrefabInstance: {fileID: 0} 215 | m_PrefabAsset: {fileID: 0} 216 | m_GameObject: {fileID: 454704941} 217 | m_Enabled: 1 218 | serializedVersion: 2 219 | m_ClearFlags: 1 220 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 221 | m_projectionMatrixMode: 1 222 | m_SensorSize: {x: 36, y: 24} 223 | m_LensShift: {x: 0, y: 0} 224 | m_GateFitMode: 2 225 | m_FocalLength: 50 226 | m_NormalizedViewPortRect: 227 | serializedVersion: 2 228 | x: 0 229 | y: 0 230 | width: 1 231 | height: 1 232 | near clip plane: 0.3 233 | far clip plane: 1000 234 | field of view: 60 235 | orthographic: 0 236 | orthographic size: 5 237 | m_Depth: 0 238 | m_CullingMask: 239 | serializedVersion: 2 240 | m_Bits: 4294967295 241 | m_RenderingPath: -1 242 | m_TargetTexture: {fileID: 0} 243 | m_TargetDisplay: 0 244 | m_TargetEye: 3 245 | m_HDR: 1 246 | m_AllowMSAA: 1 247 | m_AllowDynamicResolution: 0 248 | m_ForceIntoRT: 0 249 | m_OcclusionCulling: 1 250 | m_StereoConvergence: 10 251 | m_StereoSeparation: 0.022 252 | --- !u!4 &454704944 253 | Transform: 254 | m_ObjectHideFlags: 0 255 | m_CorrespondingSourceObject: {fileID: 0} 256 | m_PrefabInstance: {fileID: 0} 257 | m_PrefabAsset: {fileID: 0} 258 | m_GameObject: {fileID: 454704941} 259 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 260 | m_LocalPosition: {x: 0, y: 0, z: 0} 261 | m_LocalScale: {x: 1, y: 1, z: 1} 262 | m_Children: [] 263 | m_Father: {fileID: 0} 264 | m_RootOrder: 2 265 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 266 | --- !u!1 &726568690 267 | GameObject: 268 | m_ObjectHideFlags: 0 269 | m_CorrespondingSourceObject: {fileID: 0} 270 | m_PrefabInstance: {fileID: 0} 271 | m_PrefabAsset: {fileID: 0} 272 | serializedVersion: 6 273 | m_Component: 274 | - component: {fileID: 726568694} 275 | - component: {fileID: 726568693} 276 | - component: {fileID: 726568692} 277 | - component: {fileID: 726568691} 278 | m_Layer: 5 279 | m_Name: Canvas 280 | m_TagString: Untagged 281 | m_Icon: {fileID: 0} 282 | m_NavMeshLayer: 0 283 | m_StaticEditorFlags: 0 284 | m_IsActive: 1 285 | --- !u!114 &726568691 286 | MonoBehaviour: 287 | m_ObjectHideFlags: 0 288 | m_CorrespondingSourceObject: {fileID: 0} 289 | m_PrefabInstance: {fileID: 0} 290 | m_PrefabAsset: {fileID: 0} 291 | m_GameObject: {fileID: 726568690} 292 | m_Enabled: 1 293 | m_EditorHideFlags: 0 294 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 295 | m_Name: 296 | m_EditorClassIdentifier: 297 | m_Material: {fileID: 0} 298 | m_Color: {r: 0.23529412, g: 0.23529412, b: 0.23529412, a: 1} 299 | m_RaycastTarget: 1 300 | m_OnCullStateChanged: 301 | m_PersistentCalls: 302 | m_Calls: [] 303 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 304 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 305 | m_Sprite: {fileID: 0} 306 | m_Type: 0 307 | m_PreserveAspect: 0 308 | m_FillCenter: 1 309 | m_FillMethod: 4 310 | m_FillAmount: 1 311 | m_FillClockwise: 1 312 | m_FillOrigin: 0 313 | m_UseSpriteMesh: 0 314 | --- !u!222 &726568692 315 | CanvasRenderer: 316 | m_ObjectHideFlags: 0 317 | m_CorrespondingSourceObject: {fileID: 0} 318 | m_PrefabInstance: {fileID: 0} 319 | m_PrefabAsset: {fileID: 0} 320 | m_GameObject: {fileID: 726568690} 321 | m_CullTransparentMesh: 0 322 | --- !u!223 &726568693 323 | Canvas: 324 | m_ObjectHideFlags: 0 325 | m_CorrespondingSourceObject: {fileID: 0} 326 | m_PrefabInstance: {fileID: 0} 327 | m_PrefabAsset: {fileID: 0} 328 | m_GameObject: {fileID: 726568690} 329 | m_Enabled: 1 330 | serializedVersion: 3 331 | m_RenderMode: 0 332 | m_Camera: {fileID: 0} 333 | m_PlaneDistance: 100 334 | m_PixelPerfect: 0 335 | m_ReceivesEvents: 1 336 | m_OverrideSorting: 0 337 | m_OverridePixelPerfect: 0 338 | m_SortingBucketNormalizedSize: 0 339 | m_AdditionalShaderChannelsFlag: 0 340 | m_SortingLayerID: 0 341 | m_SortingOrder: 0 342 | m_TargetDisplay: 0 343 | --- !u!224 &726568694 344 | RectTransform: 345 | m_ObjectHideFlags: 0 346 | m_CorrespondingSourceObject: {fileID: 0} 347 | m_PrefabInstance: {fileID: 0} 348 | m_PrefabAsset: {fileID: 0} 349 | m_GameObject: {fileID: 726568690} 350 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 351 | m_LocalPosition: {x: 0, y: 0, z: 0} 352 | m_LocalScale: {x: 0, y: 0, z: 0} 353 | m_Children: [] 354 | m_Father: {fileID: 0} 355 | m_RootOrder: 1 356 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 357 | m_AnchorMin: {x: 0, y: 0} 358 | m_AnchorMax: {x: 0, y: 0} 359 | m_AnchoredPosition: {x: 0, y: 0} 360 | m_SizeDelta: {x: 0, y: 0} 361 | m_Pivot: {x: 0, y: 0} 362 | -------------------------------------------------------------------------------- /Assets/Scenes/MainScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fabc9a0bea08b6b4aad1c2522651e657 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Scenes/Scene2.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | SceneSettings: 5 | m_ObjectHideFlags: 0 6 | m_PVSData: 7 | m_PVSObjectsArray: [] 8 | m_PVSPortalsArray: [] 9 | m_OcclusionBakeSettings: 10 | smallestOccluder: 5 11 | smallestHole: .25 12 | backfaceThreshold: 100 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_Fog: 0 16 | m_FogColor: {r: .5, g: .5, b: .5, a: 1} 17 | m_FogMode: 3 18 | m_FogDensity: .00999999978 19 | m_LinearFogStart: 0 20 | m_LinearFogEnd: 300 21 | m_AmbientLight: {r: .200000003, g: .200000003, b: .200000003, a: 1} 22 | m_SkyboxMaterial: {fileID: 0} 23 | m_HaloStrength: .5 24 | m_FlareStrength: 1 25 | m_FlareFadeSpeed: 3 26 | m_HaloTexture: {fileID: 0} 27 | m_SpotCookie: {fileID: 0} 28 | m_ObjectHideFlags: 0 29 | --- !u!127 &3 30 | LevelGameManager: 31 | m_ObjectHideFlags: 0 32 | --- !u!157 &4 33 | LightmapSettings: 34 | m_ObjectHideFlags: 0 35 | m_LightProbes: {fileID: 0} 36 | m_Lightmaps: [] 37 | m_LightmapsMode: 1 38 | m_BakedColorSpace: 0 39 | m_UseDualLightmapsInForward: 0 40 | m_LightmapEditorSettings: 41 | m_Resolution: 50 42 | m_LastUsedResolution: 0 43 | m_TextureWidth: 1024 44 | m_TextureHeight: 1024 45 | m_BounceBoost: 1 46 | m_BounceIntensity: 1 47 | m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1} 48 | m_SkyLightIntensity: 0 49 | m_Quality: 0 50 | m_Bounces: 1 51 | m_FinalGatherRays: 1000 52 | m_FinalGatherContrastThreshold: .0500000007 53 | m_FinalGatherGradientThreshold: 0 54 | m_FinalGatherInterpolationPoints: 15 55 | m_AOAmount: 0 56 | m_AOMaxDistance: .100000001 57 | m_AOContrast: 1 58 | m_LODSurfaceMappingDistance: 1 59 | m_Padding: 0 60 | m_TextureCompression: 0 61 | m_LockAtlas: 0 62 | --- !u!196 &5 63 | NavMeshSettings: 64 | m_ObjectHideFlags: 0 65 | m_BuildSettings: 66 | agentRadius: .5 67 | agentHeight: 2 68 | agentSlope: 45 69 | agentClimb: .400000006 70 | ledgeDropHeight: 0 71 | maxJumpAcrossDistance: 0 72 | accuratePlacement: 0 73 | minRegionArea: 2 74 | widthInaccuracy: 16.666666 75 | heightInaccuracy: 10 76 | m_NavMesh: {fileID: 0} 77 | --- !u!1 &1104760521 78 | GameObject: 79 | m_ObjectHideFlags: 0 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 0} 82 | serializedVersion: 4 83 | m_Component: 84 | - 4: {fileID: 1104760527} 85 | - 20: {fileID: 1104760526} 86 | - 92: {fileID: 1104760525} 87 | - 124: {fileID: 1104760524} 88 | - 81: {fileID: 1104760523} 89 | - 132: {fileID: 1104760522} 90 | - 114: {fileID: 1104760528} 91 | m_Layer: 0 92 | m_Name: Main Camera 93 | m_TagString: MainCamera 94 | m_Icon: {fileID: 0} 95 | m_NavMeshLayer: 0 96 | m_StaticEditorFlags: 0 97 | m_IsActive: 1 98 | --- !u!132 &1104760522 99 | GUIText: 100 | m_ObjectHideFlags: 0 101 | m_PrefabParentObject: {fileID: 0} 102 | m_PrefabInternal: {fileID: 0} 103 | m_GameObject: {fileID: 1104760521} 104 | m_Enabled: 1 105 | serializedVersion: 3 106 | m_Text: Scene 2 - Press F5 to return to Scene 1 107 | m_Anchor: 0 108 | m_Alignment: 1 109 | m_PixelOffset: {x: 0, y: 0} 110 | m_LineSpacing: 1 111 | m_TabSize: 4 112 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 113 | m_Material: {fileID: 0} 114 | m_FontSize: 20 115 | m_FontStyle: 1 116 | m_Color: 117 | serializedVersion: 2 118 | rgba: 4294967295 119 | m_PixelCorrect: 1 120 | m_RichText: 1 121 | --- !u!81 &1104760523 122 | AudioListener: 123 | m_ObjectHideFlags: 0 124 | m_PrefabParentObject: {fileID: 0} 125 | m_PrefabInternal: {fileID: 0} 126 | m_GameObject: {fileID: 1104760521} 127 | m_Enabled: 1 128 | --- !u!124 &1104760524 129 | Behaviour: 130 | m_ObjectHideFlags: 0 131 | m_PrefabParentObject: {fileID: 0} 132 | m_PrefabInternal: {fileID: 0} 133 | m_GameObject: {fileID: 1104760521} 134 | m_Enabled: 1 135 | --- !u!92 &1104760525 136 | Behaviour: 137 | m_ObjectHideFlags: 0 138 | m_PrefabParentObject: {fileID: 0} 139 | m_PrefabInternal: {fileID: 0} 140 | m_GameObject: {fileID: 1104760521} 141 | m_Enabled: 1 142 | --- !u!20 &1104760526 143 | Camera: 144 | m_ObjectHideFlags: 0 145 | m_PrefabParentObject: {fileID: 0} 146 | m_PrefabInternal: {fileID: 0} 147 | m_GameObject: {fileID: 1104760521} 148 | m_Enabled: 1 149 | serializedVersion: 2 150 | m_ClearFlags: 1 151 | m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} 152 | m_NormalizedViewPortRect: 153 | serializedVersion: 2 154 | x: 0 155 | y: 0 156 | width: 1 157 | height: 1 158 | near clip plane: .300000012 159 | far clip plane: 1000 160 | field of view: 60 161 | orthographic: 0 162 | orthographic size: 5 163 | m_Depth: -1 164 | m_CullingMask: 165 | serializedVersion: 2 166 | m_Bits: 4294967295 167 | m_RenderingPath: -1 168 | m_TargetTexture: {fileID: 0} 169 | m_HDR: 0 170 | m_OcclusionCulling: 1 171 | --- !u!4 &1104760527 172 | Transform: 173 | m_ObjectHideFlags: 0 174 | m_PrefabParentObject: {fileID: 0} 175 | m_PrefabInternal: {fileID: 0} 176 | m_GameObject: {fileID: 1104760521} 177 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 178 | m_LocalPosition: {x: 0, y: 1, z: -10} 179 | m_LocalScale: {x: 1, y: 1, z: 1} 180 | m_Children: [] 181 | m_Father: {fileID: 0} 182 | --- !u!114 &1104760528 183 | MonoBehaviour: 184 | m_ObjectHideFlags: 0 185 | m_PrefabParentObject: {fileID: 0} 186 | m_PrefabInternal: {fileID: 0} 187 | m_GameObject: {fileID: 1104760521} 188 | m_Enabled: 1 189 | m_EditorHideFlags: 0 190 | m_Script: {fileID: 11500000, guid: cf808364797b1dd4491ffd139efff999, type: 3} 191 | m_Name: 192 | m_EditorClassIdentifier: 193 | -------------------------------------------------------------------------------- /Assets/Scenes/Scene2.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7cf81f78145abf64e92cce8b23d533c2 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62e3fde59caddd548836fd5356b70735 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Scripts/Logger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | public class Logger : MonoBehaviour { 5 | #if !UNITY_EDITOR 6 | static Queue queue = new Queue(6); 7 | void OnEnable() { 8 | Application.logMessageReceived += HandleLog; 9 | } 10 | 11 | void OnDisable() { 12 | Application.logMessageReceived -= HandleLog; 13 | } 14 | 15 | void OnGUI() { 16 | GUILayout.BeginArea(new Rect(0, Screen.height - 140, Screen.width, 140)); 17 | foreach (string s in queue) { 18 | GUILayout.Label(s); 19 | } 20 | GUILayout.EndArea(); 21 | } 22 | 23 | void HandleLog(string message, string stackTrace, LogType type) { 24 | queue.Enqueue(Time.time + " - " + message); 25 | if (queue.Count > 5) { 26 | queue.Dequeue(); 27 | } 28 | } 29 | #endif 30 | } 31 | -------------------------------------------------------------------------------- /Assets/Scripts/Logger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab12582c09dc3054b84569c6e889d60b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SceneSwitcher.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.SceneManagement; 3 | 4 | /// 5 | /// This is to test if Steamworks.NET behaves well when switching between scenes. 6 | /// 7 | public class SceneSwitcher : MonoBehaviour { 8 | void Update() { 9 | if (Input.GetKeyDown(KeyCode.F5)) { 10 | if (SceneManager.GetActiveScene().buildIndex == 0) { 11 | SceneManager.LoadScene(1); 12 | } 13 | else { 14 | SceneManager.LoadScene(0); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Scripts/SceneSwitcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf808364797b1dd4491ffd139efff999 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamAppsTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamAppsTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | 8 | protected Callback m_DlcInstalled; 9 | protected Callback m_NewUrlLaunchParameters; 10 | protected Callback m_AppProofOfPurchaseKeyResponse; 11 | protected Callback m_TimedTrialStatus; 12 | 13 | private CallResult OnFileDetailsResultCallResult; 14 | 15 | public void OnEnable() { 16 | m_DlcInstalled = Callback.Create(OnDlcInstalled); 17 | m_NewUrlLaunchParameters = Callback.Create(OnNewUrlLaunchParameters); 18 | m_AppProofOfPurchaseKeyResponse = Callback.Create(OnAppProofOfPurchaseKeyResponse); 19 | m_TimedTrialStatus = Callback.Create(OnTimedTrialStatus); 20 | 21 | OnFileDetailsResultCallResult = CallResult.Create(OnFileDetailsResult); 22 | } 23 | 24 | public void RenderOnGUI() { 25 | GUILayout.BeginVertical("box"); 26 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 27 | 28 | GUILayout.Label("BIsSubscribed() : " + SteamApps.BIsSubscribed()); 29 | 30 | GUILayout.Label("BIsLowViolence() : " + SteamApps.BIsLowViolence()); 31 | 32 | GUILayout.Label("BIsCybercafe() : " + SteamApps.BIsCybercafe()); 33 | 34 | GUILayout.Label("BIsVACBanned() : " + SteamApps.BIsVACBanned()); 35 | 36 | GUILayout.Label("GetCurrentGameLanguage() : " + SteamApps.GetCurrentGameLanguage()); 37 | 38 | GUILayout.Label("GetAvailableGameLanguages() : " + SteamApps.GetAvailableGameLanguages()); 39 | 40 | GUILayout.Label("BIsSubscribedApp(SteamUtils.GetAppID()) : " + SteamApps.BIsSubscribedApp(SteamUtils.GetAppID())); 41 | 42 | GUILayout.Label("BIsDlcInstalled(TestConstants.Instance.k_AppId_PieterwTestDLC) : " + SteamApps.BIsDlcInstalled(TestConstants.Instance.k_AppId_PieterwTestDLC)); 43 | 44 | GUILayout.Label("GetEarliestPurchaseUnixTime(SteamUtils.GetAppID()) : " + SteamApps.GetEarliestPurchaseUnixTime(SteamUtils.GetAppID())); 45 | 46 | GUILayout.Label("BIsSubscribedFromFreeWeekend() : " + SteamApps.BIsSubscribedFromFreeWeekend()); 47 | 48 | GUILayout.Label("GetDLCCount() : " + SteamApps.GetDLCCount()); 49 | 50 | for (int iDLC = 0; iDLC < SteamApps.GetDLCCount(); ++iDLC) { 51 | AppId_t AppID; 52 | bool Available; 53 | string Name; 54 | bool ret = SteamApps.BGetDLCDataByIndex(iDLC, out AppID, out Available, out Name, 128); 55 | GUILayout.Label("BGetDLCDataByIndex(" + iDLC + ", out AppID, out Available, out Name, 128) : " + ret + " -- " + AppID + " -- " + Available + " -- " + Name); 56 | } 57 | 58 | if (GUILayout.Button("InstallDLC(TestConstants.Instance.k_AppId_PieterwTestDLC)")) { 59 | SteamApps.InstallDLC(TestConstants.Instance.k_AppId_PieterwTestDLC); 60 | print("SteamApps.InstallDLC(" + TestConstants.Instance.k_AppId_PieterwTestDLC + ")"); 61 | } 62 | 63 | if (GUILayout.Button("UninstallDLC(TestConstants.Instance.k_AppId_PieterwTestDLC)")) { 64 | SteamApps.UninstallDLC(TestConstants.Instance.k_AppId_PieterwTestDLC); 65 | print("SteamApps.UninstallDLC(" + TestConstants.Instance.k_AppId_PieterwTestDLC + ")"); 66 | } 67 | 68 | if (GUILayout.Button("RequestAppProofOfPurchaseKey(SteamUtils.GetAppID())")) { 69 | SteamApps.RequestAppProofOfPurchaseKey(SteamUtils.GetAppID()); 70 | print("SteamApps.RequestAppProofOfPurchaseKey(" + SteamUtils.GetAppID() + ")"); 71 | } 72 | 73 | { 74 | string Name; 75 | bool ret = SteamApps.GetCurrentBetaName(out Name, 128); 76 | if (Name == null) { 77 | Name = ""; 78 | } 79 | GUILayout.Label("GetCurrentBetaName(out Name, 128) : " + ret + " -- " + Name); 80 | } 81 | 82 | if (GUILayout.Button("MarkContentCorrupt(true)")) { 83 | bool ret = SteamApps.MarkContentCorrupt(true); 84 | print("SteamApps.MarkContentCorrupt(" + true + ") : " + ret); 85 | } 86 | 87 | if (GUILayout.Button("SteamApps.GetInstalledDepots(SteamUtils.GetAppID(), Depots, 32)")) { 88 | DepotId_t[] Depots = new DepotId_t[32]; 89 | uint ret = SteamApps.GetInstalledDepots(SteamUtils.GetAppID(), Depots, 32); 90 | for (int i = 0; i < ret; ++i) { 91 | print("SteamApps.GetInstalledDepots(SteamUtils.GetAppID(), Depots, 32) : " + ret + " -- #" + i + " -- " + Depots[i]); 92 | } 93 | } 94 | 95 | { 96 | string Folder; 97 | uint ret = SteamApps.GetAppInstallDir(SteamUtils.GetAppID(), out Folder, 260); 98 | if (Folder == null) { 99 | Folder = ""; 100 | } 101 | GUILayout.Label("GetAppInstallDir(SteamUtils.GetAppID(), out Folder, 260) : " + ret + " -- " + Folder); 102 | } 103 | 104 | GUILayout.Label("BIsAppInstalled(SteamUtils.GetAppID()) : " + SteamApps.BIsAppInstalled(SteamUtils.GetAppID())); 105 | 106 | GUILayout.Label("GetAppOwner() : " + SteamApps.GetAppOwner()); 107 | 108 | { 109 | // Run the test and then use steam://run/480//?test=testing;param2=value2; in your browser to try this out 110 | string ret = SteamApps.GetLaunchQueryParam("test"); 111 | GUILayout.Label("GetLaunchQueryParam(\"test\") : " + ret); 112 | } 113 | 114 | { 115 | ulong BytesDownloaded; 116 | ulong BytesTotal; 117 | bool ret = SteamApps.GetDlcDownloadProgress(TestConstants.Instance.k_AppId_PieterwTestDLC, out BytesDownloaded, out BytesTotal); 118 | GUILayout.Label("GetDlcDownloadProgress(TestConstants.Instance.k_AppId_PieterwTestDLC, out BytesDownloaded, out BytesTotal) : " + ret + " -- " + BytesDownloaded + " -- " + BytesTotal); 119 | } 120 | 121 | GUILayout.Label("GetAppBuildId() : " + SteamApps.GetAppBuildId()); 122 | 123 | if (GUILayout.Button("RequestAllProofOfPurchaseKeys()")) { 124 | SteamApps.RequestAllProofOfPurchaseKeys(); 125 | print("SteamApps.RequestAllProofOfPurchaseKeys()"); 126 | } 127 | 128 | if (GUILayout.Button("GetFileDetails(\"steam_api.dll\")")) { 129 | SteamAPICall_t handle = SteamApps.GetFileDetails("steam_api.dll"); 130 | OnFileDetailsResultCallResult.Set(handle); 131 | print("SteamApps.GetFileDetails(" + "\"steam_api.dll\"" + ") : " + handle); 132 | } 133 | 134 | { 135 | string CommandLine; 136 | int ret = SteamApps.GetLaunchCommandLine(out CommandLine, 260); 137 | if (CommandLine == null) { 138 | CommandLine = ""; 139 | } 140 | GUILayout.Label("GetLaunchCommandLine(out CommandLine, 260) : " + ret + " -- " + CommandLine); 141 | } 142 | 143 | GUILayout.Label("BIsSubscribedFromFamilySharing() : " + SteamApps.BIsSubscribedFromFamilySharing()); 144 | 145 | { 146 | uint punSecondsAllowed; 147 | uint punSecondsPlayed; 148 | bool ret = SteamApps.BIsTimedTrial(out punSecondsAllowed, out punSecondsPlayed); 149 | GUILayout.Label("BIsTimedTrial(out punSecondsAllowed, out punSecondsPlayed) : " + ret + " -- " + punSecondsAllowed + " -- " + punSecondsPlayed); 150 | } 151 | 152 | if (GUILayout.Button("SetDlcContext((AppId_t)0)")) { 153 | bool ret = SteamApps.SetDlcContext((AppId_t)0); 154 | print("SteamApps.SetDlcContext(" + (AppId_t)0 + ") : " + ret); 155 | } 156 | 157 | //SteamApps.GetNumBetas() // Crashes the Steam client. 158 | 159 | //SteamApps.GetBetaInfo() // [Probably] Crashes the Steam client. 160 | 161 | //SteamApps.SetActiveBeta() // [Probably] Crashes the Steam client. 162 | 163 | GUILayout.EndScrollView(); 164 | GUILayout.EndVertical(); 165 | } 166 | 167 | void OnDlcInstalled(DlcInstalled_t pCallback) { 168 | Debug.Log("[" + DlcInstalled_t.k_iCallback + " - DlcInstalled] - " + pCallback.m_nAppID); 169 | } 170 | 171 | void OnNewUrlLaunchParameters(NewUrlLaunchParameters_t pCallback) { 172 | Debug.Log("[" + NewUrlLaunchParameters_t.k_iCallback + " - NewUrlLaunchParameters]"); 173 | } 174 | 175 | void OnAppProofOfPurchaseKeyResponse(AppProofOfPurchaseKeyResponse_t pCallback) { 176 | Debug.Log("[" + AppProofOfPurchaseKeyResponse_t.k_iCallback + " - AppProofOfPurchaseKeyResponse] - " + pCallback.m_eResult + " -- " + pCallback.m_nAppID + " -- " + pCallback.m_cchKeyLength + " -- " + pCallback.m_rgchKey); 177 | } 178 | 179 | void OnFileDetailsResult(FileDetailsResult_t pCallback, bool bIOFailure) { 180 | Debug.Log("[" + FileDetailsResult_t.k_iCallback + " - FileDetailsResult] - " + pCallback.m_eResult + " -- " + pCallback.m_ulFileSize + " -- " + pCallback.m_FileSHA + " -- " + pCallback.m_unFlags); 181 | } 182 | 183 | void OnTimedTrialStatus(TimedTrialStatus_t pCallback) { 184 | Debug.Log("[" + TimedTrialStatus_t.k_iCallback + " - TimedTrialStatus] - " + pCallback.m_unAppID + " -- " + pCallback.m_bIsOffline + " -- " + pCallback.m_unSecondsAllowed + " -- " + pCallback.m_unSecondsPlayed); 185 | } 186 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamAppsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 969a9b40e5a912241bce19cfa9988e29 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamClientTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamClientTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private HSteamPipe m_Pipe; 8 | private HSteamUser m_GlobalUser; 9 | private HSteamPipe m_LocalPipe; 10 | private HSteamUser m_LocalUser; 11 | 12 | public void OnEnable() { 13 | } 14 | 15 | public void RenderOnGUI() { 16 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 17 | GUILayout.Label("Variables:"); 18 | GUILayout.Label("m_Pipe: " + m_Pipe); 19 | GUILayout.Label("m_GlobalUser: " + m_GlobalUser); 20 | GUILayout.Label("m_LocalPipe: " + m_LocalPipe); 21 | GUILayout.Label("m_LocalUser: " + m_LocalUser); 22 | GUILayout.EndArea(); 23 | 24 | GUILayout.BeginVertical("box"); 25 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 26 | 27 | GUILayout.Label("DON'T TOUCH THESE IF YOU DO NOT KNOW WHAT THEY DO, YOU COULD CRASH YOUR STEAM CLIENT"); 28 | 29 | if (GUILayout.Button("CreateSteamPipe()")) { 30 | m_Pipe = SteamClient.CreateSteamPipe(); 31 | print("SteamClient.CreateSteamPipe() : " + m_Pipe); 32 | } 33 | 34 | if (GUILayout.Button("BReleaseSteamPipe(m_Pipe)")) { 35 | bool ret = SteamClient.BReleaseSteamPipe(m_Pipe); 36 | print("SteamClient.BReleaseSteamPipe(" + m_Pipe + ") : " + ret); 37 | } 38 | 39 | if (GUILayout.Button("ConnectToGlobalUser(m_Pipe)")) { 40 | m_GlobalUser = SteamClient.ConnectToGlobalUser(m_Pipe); 41 | print("SteamClient.ConnectToGlobalUser(" + m_Pipe + ") : " + m_GlobalUser); 42 | } 43 | 44 | if (GUILayout.Button("CreateLocalUser(out m_LocalPipe, EAccountType.k_EAccountTypeGameServer)")) { 45 | m_LocalUser = SteamClient.CreateLocalUser(out m_LocalPipe, EAccountType.k_EAccountTypeGameServer); 46 | print("SteamClient.CreateLocalUser(" + "out m_LocalPipe" + ", " + EAccountType.k_EAccountTypeGameServer + ") : " + m_LocalUser + " -- " + m_LocalPipe); 47 | } 48 | 49 | if (GUILayout.Button("ReleaseUser(m_LocalPipe, m_LocalUser)")) { 50 | SteamClient.ReleaseUser(m_LocalPipe, m_LocalUser); 51 | print("SteamClient.ReleaseUser(" + m_LocalPipe + ", " + m_LocalUser + ")"); 52 | } 53 | 54 | if (GUILayout.Button("GetISteamUser(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMUSER_INTERFACE_VERSION)")) { 55 | System.IntPtr ret = SteamClient.GetISteamUser(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMUSER_INTERFACE_VERSION); 56 | print("SteamClient.GetISteamUser(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMUSER_INTERFACE_VERSION + ") : " + ret); 57 | } 58 | 59 | if (GUILayout.Button("GetISteamGameServer(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMGAMESERVER_INTERFACE_VERSION)")) { 60 | System.IntPtr ret = SteamClient.GetISteamGameServer(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMGAMESERVER_INTERFACE_VERSION); 61 | print("SteamClient.GetISteamGameServer(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMGAMESERVER_INTERFACE_VERSION + ") : " + ret); 62 | } 63 | 64 | if (GUILayout.Button("SetLocalIPBinding(ref IpAddress127_0_0_1, TestConstants.k_Port27015)")) { 65 | SteamIPAddress_t IpAddress127_0_0_1 = TestConstants.Instance.k_IpAddress127_0_0_1; 66 | SteamClient.SetLocalIPBinding(ref IpAddress127_0_0_1, TestConstants.k_Port27015); 67 | print("SteamClient.SetLocalIPBinding(" + "ref IpAddress127_0_0_1" + ", " + TestConstants.k_Port27015 + ")" + " -- " + IpAddress127_0_0_1); 68 | } 69 | 70 | if (GUILayout.Button("GetISteamFriends(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMFRIENDS_INTERFACE_VERSION)")) { 71 | System.IntPtr ret = SteamClient.GetISteamFriends(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMFRIENDS_INTERFACE_VERSION); 72 | print("SteamClient.GetISteamFriends(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMFRIENDS_INTERFACE_VERSION + ") : " + ret); 73 | } 74 | 75 | if (GUILayout.Button("GetISteamUtils(SteamAPI.GetHSteamPipe(), Constants.STEAMUTILS_INTERFACE_VERSION)")) { 76 | System.IntPtr ret = SteamClient.GetISteamUtils(SteamAPI.GetHSteamPipe(), Constants.STEAMUTILS_INTERFACE_VERSION); 77 | print("SteamClient.GetISteamUtils(" + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMUTILS_INTERFACE_VERSION + ") : " + ret); 78 | } 79 | 80 | if (GUILayout.Button("GetISteamMatchmaking(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMMATCHMAKING_INTERFACE_VERSION)")) { 81 | System.IntPtr ret = SteamClient.GetISteamMatchmaking(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMMATCHMAKING_INTERFACE_VERSION); 82 | print("SteamClient.GetISteamMatchmaking(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMMATCHMAKING_INTERFACE_VERSION + ") : " + ret); 83 | } 84 | 85 | if (GUILayout.Button("GetISteamMatchmakingServers(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION)")) { 86 | System.IntPtr ret = SteamClient.GetISteamMatchmakingServers(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION); 87 | print("SteamClient.GetISteamMatchmakingServers(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION + ") : " + ret); 88 | } 89 | 90 | if (GUILayout.Button("GetISteamGenericInterface(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMAPPTICKET_INTERFACE_VERSION)")) { 91 | System.IntPtr ret = SteamClient.GetISteamGenericInterface(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMAPPTICKET_INTERFACE_VERSION); 92 | print("SteamClient.GetISteamGenericInterface(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMAPPTICKET_INTERFACE_VERSION + ") : " + ret); 93 | } 94 | 95 | if (GUILayout.Button("GetISteamUserStats(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMUSERSTATS_INTERFACE_VERSION)")) { 96 | System.IntPtr ret = SteamClient.GetISteamUserStats(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMUSERSTATS_INTERFACE_VERSION); 97 | print("SteamClient.GetISteamUserStats(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMUSERSTATS_INTERFACE_VERSION + ") : " + ret); 98 | } 99 | 100 | if (GUILayout.Button("GetISteamGameServerStats(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMGAMESERVERSTATS_INTERFACE_VERSION)")) { 101 | System.IntPtr ret = SteamClient.GetISteamGameServerStats(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMGAMESERVERSTATS_INTERFACE_VERSION); 102 | print("SteamClient.GetISteamGameServerStats(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMGAMESERVERSTATS_INTERFACE_VERSION + ") : " + ret); 103 | } 104 | 105 | if (GUILayout.Button("GetISteamApps(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMAPPS_INTERFACE_VERSION)")) { 106 | System.IntPtr ret = SteamClient.GetISteamApps(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMAPPS_INTERFACE_VERSION); 107 | print("SteamClient.GetISteamApps(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMAPPS_INTERFACE_VERSION + ") : " + ret); 108 | } 109 | 110 | if (GUILayout.Button("GetISteamNetworking(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMNETWORKING_INTERFACE_VERSION)")) { 111 | System.IntPtr ret = SteamClient.GetISteamNetworking(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMNETWORKING_INTERFACE_VERSION); 112 | print("SteamClient.GetISteamNetworking(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMNETWORKING_INTERFACE_VERSION + ") : " + ret); 113 | } 114 | 115 | if (GUILayout.Button("GetISteamRemoteStorage(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMREMOTESTORAGE_INTERFACE_VERSION)")) { 116 | System.IntPtr ret = SteamClient.GetISteamRemoteStorage(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMREMOTESTORAGE_INTERFACE_VERSION); 117 | print("SteamClient.GetISteamRemoteStorage(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMREMOTESTORAGE_INTERFACE_VERSION + ") : " + ret); 118 | } 119 | 120 | if (GUILayout.Button("GetISteamScreenshots(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMSCREENSHOTS_INTERFACE_VERSION)")) { 121 | System.IntPtr ret = SteamClient.GetISteamScreenshots(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMSCREENSHOTS_INTERFACE_VERSION); 122 | print("SteamClient.GetISteamScreenshots(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMSCREENSHOTS_INTERFACE_VERSION + ") : " + ret); 123 | } 124 | 125 | if (GUILayout.Button("GetISteamGameSearch(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMGAMESEARCH_INTERFACE_VERSION)")) { 126 | System.IntPtr ret = SteamClient.GetISteamGameSearch(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMGAMESEARCH_INTERFACE_VERSION); 127 | print("SteamClient.GetISteamGameSearch(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMGAMESEARCH_INTERFACE_VERSION + ") : " + ret); 128 | } 129 | 130 | GUILayout.Label("GetIPCCallCount() : " + SteamClient.GetIPCCallCount()); 131 | 132 | //GUILayout.Label("SteamClient.SetWarningMessageHook : " + SteamClient.SetWarningMessageHook()); // N/A - Check out SteamTest.cs for example usage. 133 | 134 | if (GUILayout.Button("BShutdownIfAllPipesClosed()")) { 135 | bool ret = SteamClient.BShutdownIfAllPipesClosed(); 136 | print("SteamClient.BShutdownIfAllPipesClosed() : " + ret); 137 | } 138 | 139 | if (GUILayout.Button("GetISteamHTTP(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMHTTP_INTERFACE_VERSION)")) { 140 | System.IntPtr ret = SteamClient.GetISteamHTTP(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMHTTP_INTERFACE_VERSION); 141 | print("SteamClient.GetISteamHTTP(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMHTTP_INTERFACE_VERSION + ") : " + ret); 142 | } 143 | 144 | //if (GUILayout.Button("GetISteamController(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMCONTROLLER_INTERFACE_VERSION)")) { 145 | // System.IntPtr ret = SteamClient.GetISteamController(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMCONTROLLER_INTERFACE_VERSION); 146 | // print("SteamClient.GetISteamController(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMCONTROLLER_INTERFACE_VERSION + ") : " + ret); 147 | //} 148 | 149 | if (GUILayout.Button("GetISteamUGC(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMUGC_INTERFACE_VERSION)")) { 150 | System.IntPtr ret = SteamClient.GetISteamUGC(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMUGC_INTERFACE_VERSION); 151 | print("SteamClient.GetISteamUGC(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMUGC_INTERFACE_VERSION + ") : " + ret); 152 | } 153 | 154 | if (GUILayout.Button("GetISteamMusic(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMMUSIC_INTERFACE_VERSION)")) { 155 | System.IntPtr ret = SteamClient.GetISteamMusic(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMMUSIC_INTERFACE_VERSION); 156 | print("SteamClient.GetISteamMusic(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMMUSIC_INTERFACE_VERSION + ") : " + ret); 157 | } 158 | 159 | if (GUILayout.Button("GetISteamMusicRemote(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMMUSICREMOTE_INTERFACE_VERSION)")) { 160 | System.IntPtr ret = SteamClient.GetISteamMusicRemote(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMMUSICREMOTE_INTERFACE_VERSION); 161 | print("SteamClient.GetISteamMusicRemote(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMMUSICREMOTE_INTERFACE_VERSION + ") : " + ret); 162 | } 163 | 164 | if (GUILayout.Button("GetISteamHTMLSurface(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMHTMLSURFACE_INTERFACE_VERSION)")) { 165 | System.IntPtr ret = SteamClient.GetISteamHTMLSurface(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMHTMLSURFACE_INTERFACE_VERSION); 166 | print("SteamClient.GetISteamHTMLSurface(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMHTMLSURFACE_INTERFACE_VERSION + ") : " + ret); 167 | } 168 | 169 | if (GUILayout.Button("GetISteamInventory(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMINVENTORY_INTERFACE_VERSION)")) { 170 | System.IntPtr ret = SteamClient.GetISteamInventory(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMINVENTORY_INTERFACE_VERSION); 171 | print("SteamClient.GetISteamInventory(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMINVENTORY_INTERFACE_VERSION + ") : " + ret); 172 | } 173 | 174 | if (GUILayout.Button("GetISteamVideo(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMVIDEO_INTERFACE_VERSION)")) { 175 | System.IntPtr ret = SteamClient.GetISteamVideo(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMVIDEO_INTERFACE_VERSION); 176 | print("SteamClient.GetISteamVideo(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMVIDEO_INTERFACE_VERSION + ") : " + ret); 177 | } 178 | 179 | if (GUILayout.Button("GetISteamParentalSettings(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMPARENTALSETTINGS_INTERFACE_VERSION)")) { 180 | System.IntPtr ret = SteamClient.GetISteamParentalSettings(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMPARENTALSETTINGS_INTERFACE_VERSION); 181 | print("SteamClient.GetISteamParentalSettings(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMPARENTALSETTINGS_INTERFACE_VERSION + ") : " + ret); 182 | } 183 | 184 | if (GUILayout.Button("GetISteamInput(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMINPUT_INTERFACE_VERSION)")) { 185 | System.IntPtr ret = SteamClient.GetISteamInput(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMINPUT_INTERFACE_VERSION); 186 | print("SteamClient.GetISteamInput(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMINPUT_INTERFACE_VERSION + ") : " + ret); 187 | } 188 | 189 | if (GUILayout.Button("GetISteamParties(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMPARTIES_INTERFACE_VERSION)")) { 190 | System.IntPtr ret = SteamClient.GetISteamParties(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMPARTIES_INTERFACE_VERSION); 191 | print("SteamClient.GetISteamParties(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMPARTIES_INTERFACE_VERSION + ") : " + ret); 192 | } 193 | 194 | if (GUILayout.Button("GetISteamRemotePlay(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMREMOTEPLAY_INTERFACE_VERSION)")) { 195 | System.IntPtr ret = SteamClient.GetISteamRemotePlay(SteamAPI.GetHSteamUser(), SteamAPI.GetHSteamPipe(), Constants.STEAMREMOTEPLAY_INTERFACE_VERSION); 196 | print("SteamClient.GetISteamRemotePlay(" + SteamAPI.GetHSteamUser() + ", " + SteamAPI.GetHSteamPipe() + ", " + Constants.STEAMREMOTEPLAY_INTERFACE_VERSION + ") : " + ret); 197 | } 198 | 199 | GUILayout.EndScrollView(); 200 | GUILayout.EndVertical(); 201 | } 202 | 203 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamClientTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75693635875a770438a7f46e293448ae 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamFriendsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 261c146b08151564dad46bfb5fd4c1bd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamHTMLSurfaceTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b130c2f385a590843b59402e18ce37cf 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamHTTPTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamHTTPTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private HTTPRequestHandle m_RequestHandle; 8 | private ulong m_ContextValue; 9 | private uint m_Offset; 10 | private uint m_BufferSize; 11 | private HTTPCookieContainerHandle m_CookieContainer; 12 | 13 | protected Callback m_HTTPRequestHeadersReceived; 14 | protected Callback m_HTTPRequestDataReceived; 15 | 16 | private CallResult OnHTTPRequestCompletedCallResult; 17 | 18 | public void OnEnable() { 19 | m_RequestHandle = HTTPRequestHandle.Invalid; 20 | m_CookieContainer = HTTPCookieContainerHandle.Invalid; 21 | 22 | m_HTTPRequestHeadersReceived = Callback.Create(OnHTTPRequestHeadersReceived); 23 | m_HTTPRequestDataReceived = Callback.Create(OnHTTPRequestDataReceived); 24 | 25 | OnHTTPRequestCompletedCallResult = CallResult.Create(OnHTTPRequestCompleted); 26 | } 27 | 28 | public void OnDisable() { 29 | ReleaseCookieContainer(); 30 | } 31 | 32 | void ReleaseCookieContainer() { 33 | if (m_CookieContainer != HTTPCookieContainerHandle.Invalid) { 34 | print("SteamHTTP.ReleaseCookieContainer(" + m_CookieContainer + ") - " + SteamHTTP.ReleaseCookieContainer(m_CookieContainer)); 35 | m_CookieContainer = HTTPCookieContainerHandle.Invalid; 36 | } 37 | } 38 | 39 | public void RenderOnGUI() { 40 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 41 | GUILayout.Label("Variables:"); 42 | GUILayout.Label("m_RequestHandle: " + m_RequestHandle); 43 | GUILayout.Label("m_ContextValue: " + m_ContextValue); 44 | GUILayout.Label("m_Offset: " + m_Offset); 45 | GUILayout.Label("m_BufferSize: " + m_BufferSize); 46 | GUILayout.Label("m_CookieContainer: " + m_CookieContainer); 47 | GUILayout.EndArea(); 48 | 49 | GUILayout.BeginVertical("box"); 50 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 51 | 52 | if (GUILayout.Button("CreateHTTPRequest(EHTTPMethod.k_EHTTPMethodGET, \"http://httpbin.org/get\")")) { 53 | HTTPRequestHandle ret = SteamHTTP.CreateHTTPRequest(EHTTPMethod.k_EHTTPMethodGET, "http://httpbin.org/get"); 54 | m_RequestHandle = ret; 55 | print("SteamHTTP.CreateHTTPRequest(" + EHTTPMethod.k_EHTTPMethodGET + ", " + "\"http://httpbin.org/get\"" + ") : " + ret); 56 | } 57 | 58 | if (GUILayout.Button("SetHTTPRequestContextValue(m_RequestHandle, 1)")) { 59 | bool ret = SteamHTTP.SetHTTPRequestContextValue(m_RequestHandle, 1); 60 | print("SteamHTTP.SetHTTPRequestContextValue(" + m_RequestHandle + ", " + 1 + ") : " + ret); 61 | } 62 | 63 | if (GUILayout.Button("SetHTTPRequestNetworkActivityTimeout(m_RequestHandle, 30)")) { 64 | bool ret = SteamHTTP.SetHTTPRequestNetworkActivityTimeout(m_RequestHandle, 30); 65 | print("SteamHTTP.SetHTTPRequestNetworkActivityTimeout(" + m_RequestHandle + ", " + 30 + ") : " + ret); 66 | } 67 | 68 | if (GUILayout.Button("SetHTTPRequestHeaderValue(m_RequestHandle, \"From\", \"support@rileylabrecque.com\")")) { 69 | bool ret = SteamHTTP.SetHTTPRequestHeaderValue(m_RequestHandle, "From", "support@rileylabrecque.com"); 70 | print("SteamHTTP.SetHTTPRequestHeaderValue(" + m_RequestHandle + ", " + "\"From\"" + ", " + "\"support@rileylabrecque.com\"" + ") : " + ret); 71 | } 72 | 73 | if (GUILayout.Button("SetHTTPRequestGetOrPostParameter(m_RequestHandle, \"testing\", \"Steamworks.NET\")")) { 74 | bool ret = SteamHTTP.SetHTTPRequestGetOrPostParameter(m_RequestHandle, "testing", "Steamworks.NET"); 75 | print("SteamHTTP.SetHTTPRequestGetOrPostParameter(" + m_RequestHandle + ", " + "\"testing\"" + ", " + "\"Steamworks.NET\"" + ") : " + ret); 76 | } 77 | 78 | if (GUILayout.Button("SendHTTPRequest(m_RequestHandle, out handle)")) { 79 | SteamAPICall_t handle; 80 | bool ret = SteamHTTP.SendHTTPRequest(m_RequestHandle, out handle); 81 | OnHTTPRequestCompletedCallResult.Set(handle); 82 | print("SteamHTTP.SendHTTPRequest(" + m_RequestHandle + ", " + "out handle" + ") : " + ret + " -- " + handle); 83 | } 84 | 85 | if (GUILayout.Button("SendHTTPRequestAndStreamResponse(m_RequestHandle, out handle)")) { 86 | SteamAPICall_t handle; 87 | bool ret = SteamHTTP.SendHTTPRequestAndStreamResponse(m_RequestHandle, out handle); 88 | OnHTTPRequestCompletedCallResult.Set(handle); 89 | print("SteamHTTP.SendHTTPRequestAndStreamResponse(" + m_RequestHandle + ", " + "out handle" + ") : " + ret + " -- " + handle); 90 | } 91 | 92 | if (GUILayout.Button("DeferHTTPRequest(m_RequestHandle)")) { 93 | bool ret = SteamHTTP.DeferHTTPRequest(m_RequestHandle); 94 | print("SteamHTTP.DeferHTTPRequest(" + m_RequestHandle + ") : " + ret); 95 | } 96 | 97 | if (GUILayout.Button("PrioritizeHTTPRequest(m_RequestHandle)")) { 98 | bool ret = SteamHTTP.PrioritizeHTTPRequest(m_RequestHandle); 99 | print("SteamHTTP.PrioritizeHTTPRequest(" + m_RequestHandle + ") : " + ret); 100 | } 101 | 102 | if (GUILayout.Button("GetHTTPResponseHeaderSize(m_RequestHandle, \"User-Agent\", out ResponseHeaderSize)")) { 103 | uint ResponseHeaderSize; 104 | bool ret = SteamHTTP.GetHTTPResponseHeaderSize(m_RequestHandle, "User-Agent", out ResponseHeaderSize); 105 | print("SteamHTTP.GetHTTPResponseHeaderSize(" + m_RequestHandle + ", " + "\"User-Agent\"" + ", " + "out ResponseHeaderSize" + ") : " + ret + " -- " + ResponseHeaderSize); 106 | } 107 | 108 | if (GUILayout.Button("GetHTTPResponseHeaderValue(m_RequestHandle, \"User-Agent\", HeaderValueBuffer, ResponseHeaderSize)")) { 109 | uint ResponseHeaderSize; 110 | SteamHTTP.GetHTTPResponseHeaderSize(m_RequestHandle, "User-Agent", out ResponseHeaderSize); 111 | 112 | byte[] HeaderValueBuffer = new byte[ResponseHeaderSize]; 113 | bool ret = SteamHTTP.GetHTTPResponseHeaderValue(m_RequestHandle, "User-Agent", HeaderValueBuffer, ResponseHeaderSize); 114 | print("SteamHTTP.GetHTTPResponseHeaderValue(" + m_RequestHandle + ", " + "\"User-Agent\"" + ", " + HeaderValueBuffer + ", " + ResponseHeaderSize + ") : " + ret); 115 | print("HeaderValueBuffer:\n" + System.Text.Encoding.UTF8.GetString(HeaderValueBuffer)); 116 | } 117 | 118 | if (GUILayout.Button("GetHTTPResponseBodySize(m_RequestHandle, out BodySize)")) { 119 | uint BodySize; 120 | bool ret = SteamHTTP.GetHTTPResponseBodySize(m_RequestHandle, out BodySize); 121 | print("SteamHTTP.GetHTTPResponseBodySize(" + m_RequestHandle + ", " + "out BodySize" + ") : " + ret + " -- " + BodySize); 122 | } 123 | 124 | if (GUILayout.Button("GetHTTPResponseBodyData(m_RequestHandle, BodyDataBuffer, BodySize)")) { 125 | uint BodySize; 126 | SteamHTTP.GetHTTPResponseBodySize(m_RequestHandle, out BodySize); 127 | 128 | byte[] BodyDataBuffer = new byte[BodySize]; 129 | bool ret = SteamHTTP.GetHTTPResponseBodyData(m_RequestHandle, BodyDataBuffer, BodySize); 130 | print("SteamHTTP.GetHTTPResponseBodyData(" + m_RequestHandle + ", " + BodyDataBuffer + ", " + BodySize + ") : " + ret); 131 | print("BodyDataBuffer:\n" + System.Text.Encoding.UTF8.GetString(BodyDataBuffer)); 132 | } 133 | 134 | if (GUILayout.Button("GetHTTPStreamingResponseBodyData(m_RequestHandle, m_Offset, BodyDataBuffer, m_BufferSize)")) { 135 | byte[] BodyDataBuffer = new byte[m_BufferSize]; 136 | bool ret = SteamHTTP.GetHTTPStreamingResponseBodyData(m_RequestHandle, m_Offset, BodyDataBuffer, m_BufferSize); 137 | print("SteamHTTP.GetHTTPStreamingResponseBodyData(" + m_RequestHandle + ", " + m_Offset + ", " + BodyDataBuffer + ", " + m_BufferSize + ") : " + ret); 138 | print("BodyDataBuffer:\n" + System.Text.Encoding.UTF8.GetString(BodyDataBuffer)); 139 | } 140 | 141 | if (GUILayout.Button("ReleaseHTTPRequest(m_RequestHandle)")) { 142 | bool ret = SteamHTTP.ReleaseHTTPRequest(m_RequestHandle); 143 | print("SteamHTTP.ReleaseHTTPRequest(" + m_RequestHandle + ") : " + ret); 144 | } 145 | 146 | { 147 | float PercentOut; 148 | bool ret = SteamHTTP.GetHTTPDownloadProgressPct(m_RequestHandle, out PercentOut); 149 | GUILayout.Label("GetHTTPDownloadProgressPct(m_RequestHandle, out PercentOut) : " + ret + " -- " + PercentOut); 150 | } 151 | 152 | if (GUILayout.Button("SetHTTPRequestRawPostBody(m_RequestHandle, \"application/x-www-form-urlencoded\", buffer, (uint)buffer.Length)")) { 153 | string Body = "parameter=value&also=another"; 154 | byte[] buffer = new byte[System.Text.Encoding.UTF8.GetByteCount(Body) + 1]; 155 | System.Text.Encoding.UTF8.GetBytes(Body, 0, Body.Length, buffer, 0); 156 | bool ret = SteamHTTP.SetHTTPRequestRawPostBody(m_RequestHandle, "application/x-www-form-urlencoded", buffer, (uint)buffer.Length); 157 | print("SteamHTTP.SetHTTPRequestRawPostBody(" + m_RequestHandle + ", " + "\"application/x-www-form-urlencoded\"" + ", " + buffer + ", " + (uint)buffer.Length + ") : " + ret); 158 | } 159 | 160 | if (GUILayout.Button("CreateCookieContainer(true)")) { 161 | m_CookieContainer = SteamHTTP.CreateCookieContainer(true); 162 | print("SteamHTTP.CreateCookieContainer(" + true + ") : " + m_CookieContainer); 163 | } 164 | 165 | if (GUILayout.Button("ReleaseCookieContainer(m_CookieContainer)")) { 166 | ReleaseCookieContainer(); 167 | } 168 | 169 | if (GUILayout.Button("SetCookie(m_CookieContainer, \"http://httpbin.org\", \"http://httpbin.org/cookies\", \"TestCookie=Testing\")")) { 170 | bool ret = SteamHTTP.SetCookie(m_CookieContainer, "http://httpbin.org", "http://httpbin.org/cookies", "TestCookie=Testing"); 171 | print("SteamHTTP.SetCookie(" + m_CookieContainer + ", " + "\"http://httpbin.org\"" + ", " + "\"http://httpbin.org/cookies\"" + ", " + "\"TestCookie=Testing\"" + ") : " + ret); 172 | } 173 | 174 | if (GUILayout.Button("SetHTTPRequestCookieContainer(m_RequestHandle, m_CookieContainer)")) { 175 | bool ret = SteamHTTP.SetHTTPRequestCookieContainer(m_RequestHandle, m_CookieContainer); 176 | print("SteamHTTP.SetHTTPRequestCookieContainer(" + m_RequestHandle + ", " + m_CookieContainer + ") : " + ret); 177 | } 178 | 179 | if (GUILayout.Button("SetHTTPRequestUserAgentInfo(m_RequestHandle, \"TestUserAgentInfo\")")) { 180 | bool ret = SteamHTTP.SetHTTPRequestUserAgentInfo(m_RequestHandle, "TestUserAgentInfo"); 181 | print("SteamHTTP.SetHTTPRequestUserAgentInfo(" + m_RequestHandle + ", " + "\"TestUserAgentInfo\"" + ") : " + ret); 182 | } 183 | 184 | if (GUILayout.Button("SetHTTPRequestRequiresVerifiedCertificate(m_RequestHandle, false)")) { 185 | bool ret = SteamHTTP.SetHTTPRequestRequiresVerifiedCertificate(m_RequestHandle, false); 186 | print("SteamHTTP.SetHTTPRequestRequiresVerifiedCertificate(" + m_RequestHandle + ", " + false + ") : " + ret); 187 | } 188 | 189 | if (GUILayout.Button("SetHTTPRequestAbsoluteTimeoutMS(m_RequestHandle, 20000)")) { 190 | bool ret = SteamHTTP.SetHTTPRequestAbsoluteTimeoutMS(m_RequestHandle, 20000); 191 | print("SteamHTTP.SetHTTPRequestAbsoluteTimeoutMS(" + m_RequestHandle + ", " + 20000 + ") : " + ret); 192 | } 193 | 194 | { 195 | bool WasTimedOut; 196 | bool ret = SteamHTTP.GetHTTPRequestWasTimedOut(m_RequestHandle, out WasTimedOut); 197 | GUILayout.Label("GetHTTPRequestWasTimedOut(m_RequestHandle, out WasTimedOut) : " + ret + " -- " + WasTimedOut); 198 | } 199 | 200 | GUILayout.EndScrollView(); 201 | GUILayout.EndVertical(); 202 | } 203 | 204 | void OnHTTPRequestCompleted(HTTPRequestCompleted_t pCallback, bool bIOFailure) { 205 | Debug.Log("[" + HTTPRequestCompleted_t.k_iCallback + " - HTTPRequestCompleted] - " + pCallback.m_hRequest + " -- " + pCallback.m_ulContextValue + " -- " + pCallback.m_bRequestSuccessful + " -- " + pCallback.m_eStatusCode + " -- " + pCallback.m_unBodySize); 206 | 207 | m_ContextValue = pCallback.m_ulContextValue; 208 | } 209 | 210 | void OnHTTPRequestHeadersReceived(HTTPRequestHeadersReceived_t pCallback) { 211 | Debug.Log("[" + HTTPRequestHeadersReceived_t.k_iCallback + " - HTTPRequestHeadersReceived] - " + pCallback.m_hRequest + " -- " + pCallback.m_ulContextValue); 212 | } 213 | 214 | void OnHTTPRequestDataReceived(HTTPRequestDataReceived_t pCallback) { 215 | Debug.Log("[" + HTTPRequestDataReceived_t.k_iCallback + " - HTTPRequestDataReceived] - " + pCallback.m_hRequest + " -- " + pCallback.m_ulContextValue + " -- " + pCallback.m_cOffset + " -- " + pCallback.m_cBytesReceived); 216 | 217 | m_Offset = pCallback.m_cOffset; 218 | m_BufferSize = pCallback.m_cBytesReceived; 219 | } 220 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamHTTPTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed31b55d6c25b424cb6627d6b588dd73 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamInputTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a673cd3193fbfe048a9e63f51f4ce416 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamInventoryTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamInventoryTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private SteamInventoryResult_t m_SteamInventoryResult; 8 | private SteamItemDetails_t[] m_SteamItemDetails; 9 | private SteamItemDef_t[] m_SteamItemDef; 10 | private byte[] m_SerializedBuffer; 11 | 12 | protected Callback m_SteamInventoryResultReady; 13 | protected Callback m_SteamInventoryFullUpdate; 14 | protected Callback m_SteamInventoryDefinitionUpdate; 15 | protected Callback m_SteamInventoryRequestPricesResult; 16 | 17 | private CallResult OnSteamInventoryEligiblePromoItemDefIDsCallResult; 18 | private CallResult OnSteamInventoryStartPurchaseResultCallResult; 19 | 20 | public void OnEnable() { 21 | m_SteamInventoryResult = SteamInventoryResult_t.Invalid; 22 | m_SteamItemDetails = null; 23 | m_SteamItemDef = null; 24 | m_SerializedBuffer = null; 25 | 26 | m_SteamInventoryResultReady = Callback.Create(OnSteamInventoryResultReady); 27 | m_SteamInventoryFullUpdate = Callback.Create(OnSteamInventoryFullUpdate); 28 | m_SteamInventoryDefinitionUpdate = Callback.Create(OnSteamInventoryDefinitionUpdate); 29 | m_SteamInventoryRequestPricesResult = Callback.Create(OnSteamInventoryRequestPricesResult); 30 | 31 | OnSteamInventoryEligiblePromoItemDefIDsCallResult = CallResult.Create(OnSteamInventoryEligiblePromoItemDefIDs); 32 | OnSteamInventoryStartPurchaseResultCallResult = CallResult.Create(OnSteamInventoryStartPurchaseResult); 33 | } 34 | 35 | public void OnDisable() { 36 | DestroyResult(); 37 | } 38 | 39 | void DestroyResult() { 40 | if (m_SteamInventoryResult != SteamInventoryResult_t.Invalid) { 41 | SteamInventory.DestroyResult(m_SteamInventoryResult); 42 | print("SteamInventory.DestroyResult(" + m_SteamInventoryResult + ")"); 43 | m_SteamInventoryResult = SteamInventoryResult_t.Invalid; 44 | } 45 | } 46 | 47 | // These are hardcoded in the game and match the item definition IDs which were uploaded to Steam. 48 | public static class ESpaceWarItemDefIDs { 49 | public static readonly SteamItemDef_t k_SpaceWarItem_TimedDropList = (SteamItemDef_t)10; 50 | public static readonly SteamItemDef_t k_SpaceWarItem_ShipDecoration1 = (SteamItemDef_t)100; 51 | public static readonly SteamItemDef_t k_SpaceWarItem_ShipDecoration2 = (SteamItemDef_t)101; 52 | public static readonly SteamItemDef_t k_SpaceWarItem_ShipDecoration3 = (SteamItemDef_t)102; 53 | public static readonly SteamItemDef_t k_SpaceWarItem_ShipDecoration4 = (SteamItemDef_t)103; 54 | public static readonly SteamItemDef_t k_SpaceWarItem_ShipWeapon1 = (SteamItemDef_t)110; 55 | public static readonly SteamItemDef_t k_SpaceWarItem_ShipWeapon2 = (SteamItemDef_t)111; 56 | public static readonly SteamItemDef_t k_SpaceWarItem_ShipSpecial1 = (SteamItemDef_t)120; 57 | public static readonly SteamItemDef_t k_SpaceWarItem_ShipSpecial2 = (SteamItemDef_t)121; 58 | }; 59 | 60 | public void RenderOnGUI() { 61 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 62 | GUILayout.Label("Variables:"); 63 | GUILayout.Label("m_SteamInventoryResult: " + m_SteamInventoryResult); 64 | GUILayout.Label("m_SteamItemDetails: " + m_SteamItemDetails); 65 | GUILayout.Label("m_SteamItemDef: " + m_SteamItemDef); 66 | GUILayout.Label("m_SerializedBuffer: " + m_SerializedBuffer); 67 | GUILayout.EndArea(); 68 | 69 | GUILayout.BeginVertical("box"); 70 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 71 | 72 | // INVENTORY ASYNC RESULT MANAGEMENT 73 | 74 | GUILayout.Label("GetResultStatus(m_SteamInventoryResult) : " + SteamInventory.GetResultStatus(m_SteamInventoryResult)); 75 | 76 | if (GUILayout.Button("GetResultItems(m_SteamInventoryResult, m_SteamItemDetails, ref OutItemsArraySize)")) { 77 | uint OutItemsArraySize = 0; 78 | bool ret = SteamInventory.GetResultItems(m_SteamInventoryResult, null, ref OutItemsArraySize); 79 | if (ret && OutItemsArraySize > 0) { 80 | m_SteamItemDetails = new SteamItemDetails_t[OutItemsArraySize]; 81 | ret = SteamInventory.GetResultItems(m_SteamInventoryResult, m_SteamItemDetails, ref OutItemsArraySize); 82 | print("SteamInventory.GetResultItems(" + m_SteamInventoryResult + ", m_SteamItemDetails, out OutItemsArraySize) - " + ret + " -- " + OutItemsArraySize); 83 | 84 | System.Text.StringBuilder test = new System.Text.StringBuilder(); 85 | for (int i = 0; i < OutItemsArraySize; ++i) { 86 | test.AppendFormat("{0} - {1} - {2} - {3} - {4}\n", i, m_SteamItemDetails[i].m_itemId, m_SteamItemDetails[i].m_iDefinition, m_SteamItemDetails[i].m_unQuantity, m_SteamItemDetails[i].m_unFlags); 87 | } 88 | print(test); 89 | } 90 | else { 91 | print("SteamInventory.GetResultItems(" + m_SteamInventoryResult + ", null, out OutItemsArraySize) - " + ret + " -- " + OutItemsArraySize); 92 | } 93 | } 94 | 95 | if (GUILayout.Button("GetResultItemProperty(m_SteamInventoryResult, 0, null, out ValueBuffer, ref ValueBufferSize)")) { 96 | string ValueBuffer; 97 | uint ValueBufferSize = 0; 98 | bool ret = SteamInventory.GetResultItemProperty(m_SteamInventoryResult, 0, null, out ValueBuffer, ref ValueBufferSize); 99 | if(ret) { 100 | ret = SteamInventory.GetResultItemProperty(m_SteamInventoryResult, 0, null, out ValueBuffer, ref ValueBufferSize); 101 | } 102 | print("SteamInventory.GetResultItemProperty(" + m_SteamInventoryResult + ", " + 0 + ", " + null + ", " + "out ValueBuffer" + ", " + "ref ValueBufferSize" + ") : " + ret + " -- " + ValueBuffer + " -- " + ValueBufferSize); 103 | } 104 | 105 | if (GUILayout.Button("GetResultTimestamp(m_SteamInventoryResult)")) { 106 | uint ret = SteamInventory.GetResultTimestamp(m_SteamInventoryResult); 107 | print("SteamInventory.GetResultTimestamp(" + m_SteamInventoryResult + ") : " + ret); 108 | } 109 | 110 | if (GUILayout.Button("CheckResultSteamID(m_SteamInventoryResult, SteamUser.GetSteamID())")) { 111 | bool ret = SteamInventory.CheckResultSteamID(m_SteamInventoryResult, SteamUser.GetSteamID()); 112 | print("SteamInventory.CheckResultSteamID(" + m_SteamInventoryResult + ", " + SteamUser.GetSteamID() + ") : " + ret); 113 | } 114 | 115 | if (GUILayout.Button("DestroyResult(m_SteamInventoryResult)")) { 116 | DestroyResult(); 117 | } 118 | 119 | // INVENTORY ASYNC QUERY 120 | 121 | if (GUILayout.Button("GetAllItems(out m_SteamInventoryResult)")) { 122 | bool ret = SteamInventory.GetAllItems(out m_SteamInventoryResult); 123 | print("SteamInventory.GetAllItems(" + "out m_SteamInventoryResult" + ") : " + ret + " -- " + m_SteamInventoryResult); 124 | } 125 | 126 | if (GUILayout.Button("GetItemsByID(out m_SteamInventoryResult, InstanceIDs, (uint)InstanceIDs.Length)")) { 127 | SteamItemInstanceID_t[] InstanceIDs = { (SteamItemInstanceID_t)0, (SteamItemInstanceID_t)1, }; 128 | bool ret = SteamInventory.GetItemsByID(out m_SteamInventoryResult, InstanceIDs, (uint)InstanceIDs.Length); 129 | print("SteamInventory.GetItemsByID(" + "out m_SteamInventoryResult" + ", " + InstanceIDs + ", " + (uint)InstanceIDs.Length + ") : " + ret + " -- " + m_SteamInventoryResult); 130 | } 131 | 132 | // RESULT SERIALIZATION AND AUTHENTICATION 133 | 134 | if (GUILayout.Button("SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize)")) { 135 | uint OutBufferSize; 136 | bool ret = SteamInventory.SerializeResult(m_SteamInventoryResult, null, out OutBufferSize); 137 | if(ret) { 138 | m_SerializedBuffer = new byte[OutBufferSize]; 139 | ret = SteamInventory.SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize); 140 | print("SteamInventory.SerializeResult(m_SteamInventoryResult, m_SerializedBuffer, out OutBufferSize) - " + ret + " -- " + OutBufferSize + " -- " + System.Text.Encoding.UTF8.GetString(m_SerializedBuffer, 0, m_SerializedBuffer.Length)); 141 | } 142 | else { 143 | print("SteamInventory.SerializeResult(m_SteamInventoryResult, null, out OutBufferSize) - " + ret + " -- " + OutBufferSize); 144 | } 145 | } 146 | 147 | if (GUILayout.Button("DeserializeResult(out m_SteamInventoryResult, m_SerializedBuffer, (uint)m_SerializedBuffer.Length)")) { 148 | bool ret = SteamInventory.DeserializeResult(out m_SteamInventoryResult, m_SerializedBuffer, (uint)m_SerializedBuffer.Length); 149 | print("SteamInventory.DeserializeResult(" + "out m_SteamInventoryResult" + ", " + m_SerializedBuffer + ", " + (uint)m_SerializedBuffer.Length + ") : " + ret + " -- " + m_SteamInventoryResult); 150 | } 151 | 152 | // INVENTORY ASYNC MODIFICATION 153 | 154 | if (GUILayout.Button("GenerateItems(out m_SteamInventoryResult, ArrayItemDefs, null, (uint)ArrayItemDefs.Length)")) { 155 | SteamItemDef_t[] ArrayItemDefs = { ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration2 }; 156 | bool ret = SteamInventory.GenerateItems(out m_SteamInventoryResult, ArrayItemDefs, null, (uint)ArrayItemDefs.Length); 157 | print("SteamInventory.GenerateItems(" + "out m_SteamInventoryResult" + ", " + ArrayItemDefs + ", " + null + ", " + (uint)ArrayItemDefs.Length + ") : " + ret + " -- " + m_SteamInventoryResult); 158 | } 159 | 160 | if (GUILayout.Button("GrantPromoItems(out m_SteamInventoryResult)")) { 161 | bool ret = SteamInventory.GrantPromoItems(out m_SteamInventoryResult); 162 | print("SteamInventory.GrantPromoItems(" + "out m_SteamInventoryResult" + ") : " + ret + " -- " + m_SteamInventoryResult); 163 | } 164 | 165 | if (GUILayout.Button("AddPromoItem(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1)")) { 166 | bool ret = SteamInventory.AddPromoItem(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1); 167 | print("SteamInventory.AddPromoItem(" + "out m_SteamInventoryResult" + ", " + ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1 + ") : " + ret + " -- " + m_SteamInventoryResult); 168 | } 169 | 170 | if (GUILayout.Button("AddPromoItems(out m_SteamInventoryResult, ArrayItemDefs, (uint)ArrayItemDefs.Length)")) { 171 | SteamItemDef_t[] ArrayItemDefs = { ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon1, ESpaceWarItemDefIDs.k_SpaceWarItem_ShipWeapon2 }; 172 | bool ret = SteamInventory.AddPromoItems(out m_SteamInventoryResult, ArrayItemDefs, (uint)ArrayItemDefs.Length); 173 | print("SteamInventory.AddPromoItems(" + "out m_SteamInventoryResult" + ", " + ArrayItemDefs + ", " + (uint)ArrayItemDefs.Length + ") : " + ret + " -- " + m_SteamInventoryResult); 174 | } 175 | 176 | if (GUILayout.Button("ConsumeItem(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1)")) { 177 | if (m_SteamItemDetails != null) { 178 | bool ret = SteamInventory.ConsumeItem(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1); 179 | print("SteamInventory.ConsumeItem(out m_SteamInventoryResult, " + m_SteamItemDetails[0].m_itemId + ", 1) - " + ret + " -- " + m_SteamInventoryResult); 180 | } 181 | } 182 | 183 | if (GUILayout.Button("ExchangeItems(TODO)")) { 184 | if (m_SteamItemDetails != null) { 185 | bool ret = SteamInventory.ExchangeItems(out m_SteamInventoryResult, null, null, 0, null, null, 0); // TODO 186 | print("SteamInventory.ExchangeItems(TODO) - " + ret + " -- " + m_SteamInventoryResult); 187 | } 188 | } 189 | 190 | if (GUILayout.Button("TransferItemQuantity(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1, SteamItemInstanceID_t.Invalid)")) { 191 | if (m_SteamItemDetails != null) { 192 | bool ret = SteamInventory.TransferItemQuantity(out m_SteamInventoryResult, m_SteamItemDetails[0].m_itemId, 1, SteamItemInstanceID_t.Invalid); 193 | print("SteamInventory.TransferItemQuantity(out m_SteamInventoryResult, " + m_SteamItemDetails[0].m_itemId + ", 1, SteamItemInstanceID_t.Invalid) - " + ret + " -- " + m_SteamInventoryResult); 194 | } 195 | } 196 | 197 | // TIMED DROPS AND PLAYTIME CREDIT 198 | 199 | if (GUILayout.Button("SendItemDropHeartbeat()")) { 200 | SteamInventory.SendItemDropHeartbeat(); 201 | print("SteamInventory.SendItemDropHeartbeat()"); 202 | } 203 | 204 | if (GUILayout.Button("TriggerItemDrop(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_TimedDropList)")) { 205 | bool ret = SteamInventory.TriggerItemDrop(out m_SteamInventoryResult, ESpaceWarItemDefIDs.k_SpaceWarItem_TimedDropList); 206 | print("SteamInventory.TriggerItemDrop(" + "out m_SteamInventoryResult" + ", " + ESpaceWarItemDefIDs.k_SpaceWarItem_TimedDropList + ") : " + ret + " -- " + m_SteamInventoryResult); 207 | } 208 | 209 | // IN-GAME TRADING 210 | 211 | if (GUILayout.Button("TradeItems(TODO)")) { 212 | if (m_SteamItemDetails != null) { 213 | bool ret = SteamInventory.TradeItems(out m_SteamInventoryResult, SteamUser.GetSteamID(), null, null, 0, null, null, 0); // TODO... Difficult 214 | print("SteamInventory.TradeItems(TODO) - " + ret + " -- " + m_SteamInventoryResult); 215 | } 216 | } 217 | 218 | // ITEM DEFINITIONS 219 | 220 | if (GUILayout.Button("LoadItemDefinitions()")) { 221 | bool ret = SteamInventory.LoadItemDefinitions(); 222 | print("SteamInventory.LoadItemDefinitions() : " + ret); 223 | } 224 | 225 | if (GUILayout.Button("GetItemDefinitionIDs(ItemDefIDs, ref length)")) { 226 | uint length = 0; 227 | bool ret = SteamInventory.GetItemDefinitionIDs(null, ref length); 228 | if (ret) { 229 | m_SteamItemDef = new SteamItemDef_t[length]; 230 | ret = SteamInventory.GetItemDefinitionIDs(m_SteamItemDef, ref length); 231 | print("SteamInventory.GetItemDefinitionIDs(m_SteamItemDef, ref length) - " + ret + " -- " + length); 232 | } 233 | else { 234 | print("SteamInventory.GetItemDefinitionIDs(null, ref length) - " + ret + " -- " + length); 235 | } 236 | } 237 | 238 | if (GUILayout.Button("GetItemDefinitionProperty(ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1, null, out ValueBuffer, ref length)")) { 239 | uint length = 2048; 240 | string ValueBuffer; 241 | bool ret = SteamInventory.GetItemDefinitionProperty(ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1, null, out ValueBuffer, ref length); 242 | print("SteamInventory.GetItemDefinitionProperty(" + ESpaceWarItemDefIDs.k_SpaceWarItem_ShipDecoration1 + ", " + null + ", " + "out ValueBuffer" + ", " + "ref length" + ") : " + ret + " -- " + ValueBuffer + " -- " + length); 243 | } 244 | 245 | if (GUILayout.Button("RequestEligiblePromoItemDefinitionsIDs(SteamUser.GetSteamID())")) { 246 | SteamAPICall_t handle = SteamInventory.RequestEligiblePromoItemDefinitionsIDs(SteamUser.GetSteamID()); 247 | OnSteamInventoryEligiblePromoItemDefIDsCallResult.Set(handle); 248 | print("SteamInventory.RequestEligiblePromoItemDefinitionsIDs(" + SteamUser.GetSteamID() + ") : " + handle); 249 | } 250 | 251 | //SteamInventory.GetEligiblePromoItemDefinitionIDs() // Should be handled within the SteamInventoryEligiblePromoItemDefIDs_t CallResult! 252 | 253 | //SteamInventory.StartPurchase() // TODO 254 | 255 | //SteamInventory.RequestPrices() // TODO 256 | 257 | //SteamInventory.GetNumItemsWithPrices() // TODO 258 | 259 | //SteamInventory.GetItemsWithPrices() // TODO 260 | 261 | //SteamInventory.GetItemPrice() // TODO 262 | 263 | //SteamInventory.StartUpdateProperties() // TODO 264 | 265 | //SteamInventory.RemoveProperty() // TODO 266 | 267 | //SteamInventory.SetProperty() // TODO 268 | 269 | //SteamInventory.SetProperty() // TODO 270 | 271 | //SteamInventory.SetProperty() // TODO 272 | 273 | //SteamInventory.SetProperty() // TODO 274 | 275 | //SteamInventory.SubmitUpdateProperties() // TODO 276 | 277 | //SteamInventory.InspectItem() // TODO 278 | 279 | GUILayout.EndScrollView(); 280 | GUILayout.EndVertical(); 281 | } 282 | 283 | void OnSteamInventoryResultReady(SteamInventoryResultReady_t pCallback) { 284 | Debug.Log("[" + SteamInventoryResultReady_t.k_iCallback + " - SteamInventoryResultReady] - " + pCallback.m_handle + " -- " + pCallback.m_result); 285 | 286 | m_SteamInventoryResult = pCallback.m_handle; 287 | } 288 | 289 | void OnSteamInventoryFullUpdate(SteamInventoryFullUpdate_t pCallback) { 290 | Debug.Log("[" + SteamInventoryFullUpdate_t.k_iCallback + " - SteamInventoryFullUpdate] - " + pCallback.m_handle); 291 | 292 | m_SteamInventoryResult = pCallback.m_handle; 293 | } 294 | 295 | void OnSteamInventoryDefinitionUpdate(SteamInventoryDefinitionUpdate_t pCallback) { 296 | Debug.Log("[" + SteamInventoryDefinitionUpdate_t.k_iCallback + " - SteamInventoryDefinitionUpdate]"); 297 | } 298 | 299 | void OnSteamInventoryEligiblePromoItemDefIDs(SteamInventoryEligiblePromoItemDefIDs_t pCallback, bool bIOFailure) { 300 | Debug.Log("[" + SteamInventoryEligiblePromoItemDefIDs_t.k_iCallback + " - SteamInventoryEligiblePromoItemDefIDs] - " + pCallback.m_result + " -- " + pCallback.m_steamID + " -- " + pCallback.m_numEligiblePromoItemDefs + " -- " + pCallback.m_bCachedData); 301 | 302 | uint ItemDefIDsArraySize = (uint)pCallback.m_numEligiblePromoItemDefs; 303 | SteamItemDef_t[] ItemDefIDs = new SteamItemDef_t[ItemDefIDsArraySize]; 304 | bool ret = SteamInventory.GetEligiblePromoItemDefinitionIDs(pCallback.m_steamID, ItemDefIDs, ref ItemDefIDsArraySize); 305 | print("SteamInventory.GetEligiblePromoItemDefinitionIDs(pCallback.m_steamID, ItemDefIDs, ref ItemDefIDsArraySize) - " + ret + " -- " + ItemDefIDsArraySize); 306 | } 307 | 308 | void OnSteamInventoryStartPurchaseResult(SteamInventoryStartPurchaseResult_t pCallback, bool bIOFailure) { 309 | Debug.Log("[" + SteamInventoryStartPurchaseResult_t.k_iCallback + " - SteamInventoryStartPurchaseResult] - " + pCallback.m_result + " -- " + pCallback.m_ulOrderID + " -- " + pCallback.m_ulTransID); 310 | } 311 | 312 | void OnSteamInventoryRequestPricesResult(SteamInventoryRequestPricesResult_t pCallback) { 313 | Debug.Log("[" + SteamInventoryRequestPricesResult_t.k_iCallback + " - SteamInventoryRequestPricesResult] - " + pCallback.m_result + " -- " + pCallback.m_rgchCurrency); 314 | } 315 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamInventoryTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 611d0fa1a6ea9b047b4cc9c18708ae29 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamMatchmakingServersTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamMatchmakingServersTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private HServerListRequest m_ServerListRequest; 8 | private HServerQuery m_ServerQuery; 9 | private ISteamMatchmakingServerListResponse m_ServerListResponse; 10 | private ISteamMatchmakingPingResponse m_PingResponse; 11 | private ISteamMatchmakingPlayersResponse m_PlayersResponse; 12 | private ISteamMatchmakingRulesResponse m_RulesResponse; 13 | 14 | public void OnEnable() { 15 | m_ServerListRequest = HServerListRequest.Invalid; 16 | m_ServerQuery = HServerQuery.Invalid; 17 | 18 | m_ServerListResponse = new ISteamMatchmakingServerListResponse(OnServerResponded, OnServerFailedToRespond, OnRefreshComplete); 19 | m_PingResponse = new ISteamMatchmakingPingResponse(OnServerResponded, OnServerFailedToRespond); 20 | m_PlayersResponse = new ISteamMatchmakingPlayersResponse(OnAddPlayerToList, OnPlayersFailedToRespond, OnPlayersRefreshComplete); 21 | m_RulesResponse = new ISteamMatchmakingRulesResponse(OnRulesResponded, OnRulesFailedToRespond, OnRulesRefreshComplete); 22 | 23 | } 24 | 25 | private void OnDisable() { 26 | ReleaseRequest(); 27 | CancelServerQuery(); 28 | } 29 | 30 | private void ReleaseRequest() { 31 | if (m_ServerListRequest != HServerListRequest.Invalid) { 32 | SteamMatchmakingServers.ReleaseRequest(m_ServerListRequest); 33 | m_ServerListRequest = HServerListRequest.Invalid; 34 | print("SteamMatchmakingServers.ReleaseRequest(m_ServerListRequest)"); 35 | } 36 | } 37 | 38 | private void CancelServerQuery() { 39 | if (m_ServerQuery != HServerQuery.Invalid) { 40 | SteamMatchmakingServers.CancelServerQuery(m_ServerQuery); 41 | m_ServerQuery = HServerQuery.Invalid; 42 | print("SteamMatchmakingServers.CancelServerQuery(m_ServerQuery)"); 43 | } 44 | } 45 | 46 | private string GameServerItemFormattedString(gameserveritem_t gsi) { 47 | return "m_NetAdr: " + gsi.m_NetAdr.GetConnectionAddressString() + "\n" + 48 | "m_nPing: " + gsi.m_nPing + "\n" + 49 | "m_bHadSuccessfulResponse: " + gsi.m_bHadSuccessfulResponse + "\n" + 50 | "m_bDoNotRefresh: " + gsi.m_bDoNotRefresh + "\n" + 51 | "m_szGameDir: " + gsi.GetGameDir() + "\n" + 52 | "m_szMap: " + gsi.GetMap() + "\n" + 53 | "m_szGameDescription: " + gsi.GetGameDescription() + "\n" + 54 | "m_nAppID: " + gsi.m_nAppID + "\n" + 55 | "m_nPlayers: " + gsi.m_nPlayers + "\n" + 56 | "m_nMaxPlayers: " + gsi.m_nMaxPlayers + "\n" + 57 | "m_nBotPlayers: " + gsi.m_nBotPlayers + "\n" + 58 | "m_bPassword: " + gsi.m_bPassword + "\n" + 59 | "m_bSecure: " + gsi.m_bSecure + "\n" + 60 | "m_ulTimeLastPlayed: " + gsi.m_ulTimeLastPlayed + "\n" + 61 | "m_nServerVersion: " + gsi.m_nServerVersion + "\n" + 62 | "m_szServerName: " + gsi.GetServerName() + "\n" + 63 | "m_szGameTags: " + gsi.GetGameTags() + "\n" + 64 | "m_steamID: " + gsi.m_steamID + "\n"; 65 | } 66 | 67 | // ISteamMatchmakingServerListResponse 68 | private void OnServerResponded(HServerListRequest hRequest, int iServer) { 69 | Debug.Log("OnServerResponded: " + hRequest + " - " + iServer); 70 | } 71 | 72 | private void OnServerFailedToRespond(HServerListRequest hRequest, int iServer) { 73 | Debug.Log("OnServerFailedToRespond: " + hRequest + " - " + iServer); 74 | } 75 | 76 | private void OnRefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response) { 77 | Debug.Log("OnRefreshComplete: " + hRequest + " - " + response); 78 | } 79 | 80 | // ISteamMatchmakingPingResponse 81 | private void OnServerResponded(gameserveritem_t gsi) { 82 | Debug.Log("OnServerResponded: " + gsi + "\n" + GameServerItemFormattedString(gsi)); 83 | } 84 | 85 | private void OnServerFailedToRespond() { 86 | Debug.Log("OnServerFailedToRespond"); 87 | } 88 | 89 | // ISteamMatchmakingPlayersResponse 90 | private void OnAddPlayerToList(string pchName, int nScore, float flTimePlayed) { 91 | Debug.Log("OnAddPlayerToList: " + pchName + " - " + nScore + " - " + flTimePlayed); 92 | } 93 | 94 | private void OnPlayersFailedToRespond() { 95 | Debug.Log("OnPlayersFailedToRespond"); 96 | } 97 | 98 | private void OnPlayersRefreshComplete() { 99 | Debug.Log("OnPlayersRefreshComplete"); 100 | } 101 | 102 | // ISteamMatchmakingRulesResponse 103 | private void OnRulesResponded(string pchRule, string pchValue) { 104 | Debug.Log("OnRulesResponded: " + pchRule + " - " + pchValue); 105 | } 106 | 107 | private void OnRulesFailedToRespond() { 108 | Debug.Log("OnRulesFailedToRespond"); 109 | } 110 | 111 | private void OnRulesRefreshComplete() { 112 | Debug.Log("OnRulesRefreshComplete"); 113 | } 114 | 115 | public void RenderOnGUI() { 116 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 117 | GUILayout.Label("Variables:"); 118 | GUILayout.Label("m_ServerListRequest: " + m_ServerListRequest); 119 | GUILayout.Label("m_ServerQuery: " + m_ServerQuery); 120 | GUILayout.Label("m_ServerListResponse: " + m_ServerListResponse); 121 | GUILayout.Label("m_PingResponse: " + m_PingResponse); 122 | GUILayout.Label("m_PlayersResponse: " + m_PlayersResponse); 123 | GUILayout.Label("m_RulesResponse: " + m_RulesResponse); 124 | GUILayout.EndArea(); 125 | 126 | GUILayout.BeginVertical("box"); 127 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 128 | 129 | if (GUILayout.Button("RequestInternetServerList(TestConstants.Instance.k_AppId_TeamFortress2, filters, (uint)filters.Length, m_ServerListResponse)")) { 130 | ReleaseRequest(); 131 | 132 | MatchMakingKeyValuePair_t[] filters = { 133 | new MatchMakingKeyValuePair_t { m_szKey = "appid", m_szValue = TestConstants.Instance.k_AppId_TeamFortress2.ToString() }, 134 | new MatchMakingKeyValuePair_t { m_szKey = "gamedir", m_szValue = "tf" }, 135 | new MatchMakingKeyValuePair_t { m_szKey = "gametagsand", m_szValue = "beta" }, 136 | }; 137 | m_ServerListRequest = SteamMatchmakingServers.RequestInternetServerList(TestConstants.Instance.k_AppId_TeamFortress2, filters, (uint)filters.Length, m_ServerListResponse); 138 | print("SteamMatchmakingServers.RequestInternetServerList(" + TestConstants.Instance.k_AppId_TeamFortress2 + ", " + filters + ", " + (uint)filters.Length + ", " + m_ServerListResponse + ") : " + m_ServerListRequest); 139 | } 140 | 141 | if (GUILayout.Button("RequestLANServerList(new AppId_t(440), m_ServerListResponse)")) { 142 | ReleaseRequest(); 143 | m_ServerListRequest = SteamMatchmakingServers.RequestLANServerList(new AppId_t(440), m_ServerListResponse); 144 | print("SteamMatchmakingServers.RequestLANServerList(" + new AppId_t(440) + ", " + m_ServerListResponse + ") : " + m_ServerListRequest); 145 | } 146 | 147 | if (GUILayout.Button("RequestFriendsServerList(new AppId_t(440), null, 0, m_ServerListResponse)")) { 148 | ReleaseRequest(); 149 | m_ServerListRequest = SteamMatchmakingServers.RequestFriendsServerList(new AppId_t(440), null, 0, m_ServerListResponse); 150 | print("SteamMatchmakingServers.RequestFriendsServerList(" + new AppId_t(440) + ", " + null + ", " + 0 + ", " + m_ServerListResponse + ") : " + m_ServerListRequest); 151 | } 152 | 153 | if (GUILayout.Button("RequestFavoritesServerList(new AppId_t(440), null, 0, m_ServerListResponse)")) { 154 | ReleaseRequest(); 155 | m_ServerListRequest = SteamMatchmakingServers.RequestFavoritesServerList(new AppId_t(440), null, 0, m_ServerListResponse); 156 | print("SteamMatchmakingServers.RequestFavoritesServerList(" + new AppId_t(440) + ", " + null + ", " + 0 + ", " + m_ServerListResponse + ") : " + m_ServerListRequest); 157 | } 158 | 159 | if (GUILayout.Button("RequestHistoryServerList(new AppId_t(440), null, 0, m_ServerListResponse)")) { 160 | ReleaseRequest(); 161 | m_ServerListRequest = SteamMatchmakingServers.RequestHistoryServerList(new AppId_t(440), null, 0, m_ServerListResponse); 162 | print("SteamMatchmakingServers.RequestHistoryServerList(" + new AppId_t(440) + ", " + null + ", " + 0 + ", " + m_ServerListResponse + ") : " + m_ServerListRequest); 163 | } 164 | 165 | if (GUILayout.Button("RequestSpectatorServerList(new AppId_t(440), null, 0, m_ServerListResponse)")) { 166 | ReleaseRequest(); 167 | m_ServerListRequest = SteamMatchmakingServers.RequestSpectatorServerList(new AppId_t(440), null, 0, m_ServerListResponse); 168 | print("SteamMatchmakingServers.RequestSpectatorServerList(" + new AppId_t(440) + ", " + null + ", " + 0 + ", " + m_ServerListResponse + ") : " + m_ServerListRequest); 169 | } 170 | 171 | if (GUILayout.Button("ReleaseRequest(m_ServerListRequest)")) { 172 | ReleaseRequest(); // We do this instead, because we want to make sure that m_ServerListRequested gets set to Invalid after releasing. 173 | } 174 | 175 | if (GUILayout.Button("GetServerDetails(m_ServerListRequest, 0)")) { 176 | gameserveritem_t ret = SteamMatchmakingServers.GetServerDetails(m_ServerListRequest, 0); 177 | print("SteamMatchmakingServers.GetServerDetails(" + m_ServerListRequest + ", " + 0 + ") : " + ret); 178 | print(GameServerItemFormattedString(ret)); 179 | } 180 | 181 | if (GUILayout.Button("CancelQuery(m_ServerListRequest)")) { 182 | SteamMatchmakingServers.CancelQuery(m_ServerListRequest); 183 | print("SteamMatchmakingServers.CancelQuery(" + m_ServerListRequest + ")"); 184 | } 185 | 186 | if (GUILayout.Button("RefreshQuery(m_ServerListRequest)")) { 187 | SteamMatchmakingServers.RefreshQuery(m_ServerListRequest); 188 | print("SteamMatchmakingServers.RefreshQuery(" + m_ServerListRequest + ")"); 189 | } 190 | 191 | GUILayout.Label("IsRefreshing(m_ServerListRequest) : " + SteamMatchmakingServers.IsRefreshing(m_ServerListRequest)); 192 | 193 | GUILayout.Label("GetServerCount(m_ServerListRequest) : " + SteamMatchmakingServers.GetServerCount(m_ServerListRequest)); 194 | 195 | if (GUILayout.Button("RefreshServer(m_ServerListRequest, 0)")) { 196 | SteamMatchmakingServers.RefreshServer(m_ServerListRequest, 0); 197 | print("SteamMatchmakingServers.RefreshServer(" + m_ServerListRequest + ", " + 0 + ")"); 198 | } 199 | 200 | if (GUILayout.Button("PingServer(TestConstants.k_IpAddress208_78_165_233_uint, TestConstants.k_Port27015, m_PingResponse)")) { 201 | CancelServerQuery(); 202 | m_ServerQuery = SteamMatchmakingServers.PingServer(TestConstants.k_IpAddress208_78_165_233_uint, TestConstants.k_Port27015, m_PingResponse); 203 | print("SteamMatchmakingServers.PingServer(" + TestConstants.k_IpAddress208_78_165_233_uint + ", " + TestConstants.k_Port27015 + ", " + m_PingResponse + ") : " + m_ServerQuery); 204 | } 205 | 206 | if (GUILayout.Button("PlayerDetails(TestConstants.k_IpAddress208_78_165_233_uint, TestConstants.k_Port27015, m_PlayersResponse)")) { 207 | CancelServerQuery(); 208 | m_ServerQuery = SteamMatchmakingServers.PlayerDetails(TestConstants.k_IpAddress208_78_165_233_uint, TestConstants.k_Port27015, m_PlayersResponse); 209 | print("SteamMatchmakingServers.PlayerDetails(" + TestConstants.k_IpAddress208_78_165_233_uint + ", " + TestConstants.k_Port27015 + ", " + m_PlayersResponse + ") : " + m_ServerQuery); 210 | } 211 | 212 | if (GUILayout.Button("ServerRules(TestConstants.k_IpAddress208_78_165_233_uint, TestConstants.k_Port27015, m_RulesResponse)")) { 213 | CancelServerQuery(); 214 | m_ServerQuery = SteamMatchmakingServers.ServerRules(TestConstants.k_IpAddress208_78_165_233_uint, TestConstants.k_Port27015, m_RulesResponse); 215 | print("SteamMatchmakingServers.ServerRules(" + TestConstants.k_IpAddress208_78_165_233_uint + ", " + TestConstants.k_Port27015 + ", " + m_RulesResponse + ") : " + m_ServerQuery); 216 | } 217 | 218 | if (GUILayout.Button("CancelServerQuery(m_ServerQuery)")) { 219 | CancelServerQuery(); // We do this instead, because we want to make sure that m_ServerListRequested gets set to Invalid after releasing, and we call it from a number of places. 220 | } 221 | 222 | GUILayout.EndScrollView(); 223 | GUILayout.EndVertical(); 224 | } 225 | 226 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamMatchmakingServersTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39f12868d8abffb46973eeadbeb23194 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamMatchmakingTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 709bc964a6019f243a59670c5039654e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamMusicRemoteTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamMusicRemoteTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | 8 | protected Callback m_MusicPlayerRemoteWillActivate; 9 | protected Callback m_MusicPlayerRemoteWillDeactivate; 10 | protected Callback m_MusicPlayerRemoteToFront; 11 | protected Callback m_MusicPlayerWillQuit; 12 | protected Callback m_MusicPlayerWantsPlay; 13 | protected Callback m_MusicPlayerWantsPause; 14 | protected Callback m_MusicPlayerWantsPlayPrevious; 15 | protected Callback m_MusicPlayerWantsPlayNext; 16 | protected Callback m_MusicPlayerWantsShuffled; 17 | protected Callback m_MusicPlayerWantsLooped; 18 | protected Callback m_MusicPlayerWantsVolume; 19 | protected Callback m_MusicPlayerSelectsQueueEntry; 20 | protected Callback m_MusicPlayerSelectsPlaylistEntry; 21 | protected Callback m_MusicPlayerWantsPlayingRepeatStatus; 22 | 23 | public void OnEnable() { 24 | m_MusicPlayerRemoteWillActivate = Callback.Create(OnMusicPlayerRemoteWillActivate); 25 | m_MusicPlayerRemoteWillDeactivate = Callback.Create(OnMusicPlayerRemoteWillDeactivate); 26 | m_MusicPlayerRemoteToFront = Callback.Create(OnMusicPlayerRemoteToFront); 27 | m_MusicPlayerWillQuit = Callback.Create(OnMusicPlayerWillQuit); 28 | m_MusicPlayerWantsPlay = Callback.Create(OnMusicPlayerWantsPlay); 29 | m_MusicPlayerWantsPause = Callback.Create(OnMusicPlayerWantsPause); 30 | m_MusicPlayerWantsPlayPrevious = Callback.Create(OnMusicPlayerWantsPlayPrevious); 31 | m_MusicPlayerWantsPlayNext = Callback.Create(OnMusicPlayerWantsPlayNext); 32 | m_MusicPlayerWantsShuffled = Callback.Create(OnMusicPlayerWantsShuffled); 33 | m_MusicPlayerWantsLooped = Callback.Create(OnMusicPlayerWantsLooped); 34 | m_MusicPlayerWantsVolume = Callback.Create(OnMusicPlayerWantsVolume); 35 | m_MusicPlayerSelectsQueueEntry = Callback.Create(OnMusicPlayerSelectsQueueEntry); 36 | m_MusicPlayerSelectsPlaylistEntry = Callback.Create(OnMusicPlayerSelectsPlaylistEntry); 37 | m_MusicPlayerWantsPlayingRepeatStatus = Callback.Create(OnMusicPlayerWantsPlayingRepeatStatus); 38 | } 39 | 40 | public void RenderOnGUI() { 41 | GUILayout.BeginVertical("box"); 42 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 43 | 44 | // Service Definition 45 | if (GUILayout.Button("RegisterSteamMusicRemote(\"Steamworks.NET Test Remote\")")) { 46 | bool ret = SteamMusicRemote.RegisterSteamMusicRemote("Steamworks.NET Test Remote"); 47 | print("SteamMusicRemote.RegisterSteamMusicRemote(" + "\"Steamworks.NET Test Remote\"" + ") : " + ret); 48 | } 49 | 50 | if (GUILayout.Button("DeregisterSteamMusicRemote()")) { 51 | bool ret = SteamMusicRemote.DeregisterSteamMusicRemote(); 52 | print("SteamMusicRemote.DeregisterSteamMusicRemote() : " + ret); 53 | } 54 | 55 | GUILayout.Label("BIsCurrentMusicRemote() : " + SteamMusicRemote.BIsCurrentMusicRemote()); 56 | 57 | GUILayout.Label("BActivationSuccess(true) : " + SteamMusicRemote.BActivationSuccess(true)); 58 | 59 | if (GUILayout.Button("SetDisplayName(\"Some Display Name\")")) { 60 | bool ret = SteamMusicRemote.SetDisplayName("Some Display Name"); 61 | print("SteamMusicRemote.SetDisplayName(" + "\"Some Display Name\"" + ") : " + ret); 62 | } 63 | 64 | if (GUILayout.Button("SetPNGIcon_64x64(null, 0)")) { 65 | // TODO 66 | bool ret = SteamMusicRemote.SetPNGIcon_64x64(null, 0); 67 | print("SteamMusicRemote.SetPNGIcon_64x64(" + null + ", " + 0 + ") : " + ret); 68 | } 69 | 70 | // Abilities for the user interface 71 | if (GUILayout.Button("EnablePlayPrevious(true)")) { 72 | bool ret = SteamMusicRemote.EnablePlayPrevious(true); 73 | print("SteamMusicRemote.EnablePlayPrevious(" + true + ") : " + ret); 74 | } 75 | 76 | if (GUILayout.Button("EnablePlayNext(true)")) { 77 | bool ret = SteamMusicRemote.EnablePlayNext(true); 78 | print("SteamMusicRemote.EnablePlayNext(" + true + ") : " + ret); 79 | } 80 | 81 | if (GUILayout.Button("EnableShuffled(true)")) { 82 | bool ret = SteamMusicRemote.EnableShuffled(true); 83 | print("SteamMusicRemote.EnableShuffled(" + true + ") : " + ret); 84 | } 85 | 86 | if (GUILayout.Button("EnableLooped(true)")) { 87 | bool ret = SteamMusicRemote.EnableLooped(true); 88 | print("SteamMusicRemote.EnableLooped(" + true + ") : " + ret); 89 | } 90 | 91 | if (GUILayout.Button("EnableQueue(true)")) { 92 | bool ret = SteamMusicRemote.EnableQueue(true); 93 | print("SteamMusicRemote.EnableQueue(" + true + ") : " + ret); 94 | } 95 | 96 | if (GUILayout.Button("EnablePlaylists(true)")) { 97 | bool ret = SteamMusicRemote.EnablePlaylists(true); 98 | print("SteamMusicRemote.EnablePlaylists(" + true + ") : " + ret); 99 | } 100 | 101 | // Status 102 | if (GUILayout.Button("UpdatePlaybackStatus(AudioPlayback_Status.AudioPlayback_Paused)")) { 103 | bool ret = SteamMusicRemote.UpdatePlaybackStatus(AudioPlayback_Status.AudioPlayback_Paused); 104 | print("SteamMusicRemote.UpdatePlaybackStatus(" + AudioPlayback_Status.AudioPlayback_Paused + ") : " + ret); 105 | } 106 | 107 | if (GUILayout.Button("UpdateShuffled(true)")) { 108 | bool ret = SteamMusicRemote.UpdateShuffled(true); 109 | print("SteamMusicRemote.UpdateShuffled(" + true + ") : " + ret); 110 | } 111 | 112 | if (GUILayout.Button("UpdateLooped(true)")) { 113 | bool ret = SteamMusicRemote.UpdateLooped(true); 114 | print("SteamMusicRemote.UpdateLooped(" + true + ") : " + ret); 115 | } 116 | 117 | if (GUILayout.Button("UpdateVolume(0.5f)")) { 118 | bool ret = SteamMusicRemote.UpdateVolume(0.5f); 119 | print("SteamMusicRemote.UpdateVolume(" + 0.5f + ") : " + ret); 120 | } 121 | 122 | // Current Entry 123 | if (GUILayout.Button("CurrentEntryWillChange()")) { 124 | bool ret = SteamMusicRemote.CurrentEntryWillChange(); 125 | print("SteamMusicRemote.CurrentEntryWillChange() : " + ret); 126 | } 127 | 128 | if (GUILayout.Button("CurrentEntryIsAvailable(true)")) { 129 | bool ret = SteamMusicRemote.CurrentEntryIsAvailable(true); 130 | print("SteamMusicRemote.CurrentEntryIsAvailable(" + true + ") : " + ret); 131 | } 132 | 133 | if (GUILayout.Button("UpdateCurrentEntryText(\"Current Entry Text\")")) { 134 | bool ret = SteamMusicRemote.UpdateCurrentEntryText("Current Entry Text"); 135 | print("SteamMusicRemote.UpdateCurrentEntryText(" + "\"Current Entry Text\"" + ") : " + ret); 136 | } 137 | 138 | if (GUILayout.Button("UpdateCurrentEntryElapsedSeconds(10)")) { 139 | bool ret = SteamMusicRemote.UpdateCurrentEntryElapsedSeconds(10); 140 | print("SteamMusicRemote.UpdateCurrentEntryElapsedSeconds(" + 10 + ") : " + ret); 141 | } 142 | 143 | if (GUILayout.Button("UpdateCurrentEntryCoverArt(null, 0)")) { 144 | // TODO 145 | bool ret = SteamMusicRemote.UpdateCurrentEntryCoverArt(null, 0); 146 | print("SteamMusicRemote.UpdateCurrentEntryCoverArt(" + null + ", " + 0 + ") : " + ret); 147 | } 148 | 149 | if (GUILayout.Button("CurrentEntryDidChange()")) { 150 | bool ret = SteamMusicRemote.CurrentEntryDidChange(); 151 | print("SteamMusicRemote.CurrentEntryDidChange() : " + ret); 152 | } 153 | 154 | // Queue 155 | if (GUILayout.Button("QueueWillChange()")) { 156 | bool ret = SteamMusicRemote.QueueWillChange(); 157 | print("SteamMusicRemote.QueueWillChange() : " + ret); 158 | } 159 | 160 | if (GUILayout.Button("ResetQueueEntries()")) { 161 | bool ret = SteamMusicRemote.ResetQueueEntries(); 162 | print("SteamMusicRemote.ResetQueueEntries() : " + ret); 163 | } 164 | 165 | if (GUILayout.Button("SetQueueEntry(0, 0, \"I don't know what I'm doing\")")) { 166 | bool ret = SteamMusicRemote.SetQueueEntry(0, 0, "I don't know what I'm doing"); 167 | print("SteamMusicRemote.SetQueueEntry(" + 0 + ", " + 0 + ", " + "\"I don't know what I'm doing\"" + ") : " + ret); 168 | } 169 | 170 | if (GUILayout.Button("SetCurrentQueueEntry(0)")) { 171 | bool ret = SteamMusicRemote.SetCurrentQueueEntry(0); 172 | print("SteamMusicRemote.SetCurrentQueueEntry(" + 0 + ") : " + ret); 173 | } 174 | 175 | if (GUILayout.Button("QueueDidChange()")) { 176 | bool ret = SteamMusicRemote.QueueDidChange(); 177 | print("SteamMusicRemote.QueueDidChange() : " + ret); 178 | } 179 | 180 | // Playlist 181 | if (GUILayout.Button("PlaylistWillChange()")) { 182 | bool ret = SteamMusicRemote.PlaylistWillChange(); 183 | print("SteamMusicRemote.PlaylistWillChange() : " + ret); 184 | } 185 | 186 | if (GUILayout.Button("ResetPlaylistEntries()")) { 187 | bool ret = SteamMusicRemote.ResetPlaylistEntries(); 188 | print("SteamMusicRemote.ResetPlaylistEntries() : " + ret); 189 | } 190 | 191 | if (GUILayout.Button("SetPlaylistEntry(0, 0, \"I don't know what I'm doing\")")) { 192 | bool ret = SteamMusicRemote.SetPlaylistEntry(0, 0, "I don't know what I'm doing"); 193 | print("SteamMusicRemote.SetPlaylistEntry(" + 0 + ", " + 0 + ", " + "\"I don't know what I'm doing\"" + ") : " + ret); 194 | } 195 | 196 | if (GUILayout.Button("SetCurrentPlaylistEntry(0)")) { 197 | bool ret = SteamMusicRemote.SetCurrentPlaylistEntry(0); 198 | print("SteamMusicRemote.SetCurrentPlaylistEntry(" + 0 + ") : " + ret); 199 | } 200 | 201 | if (GUILayout.Button("PlaylistDidChange()")) { 202 | bool ret = SteamMusicRemote.PlaylistDidChange(); 203 | print("SteamMusicRemote.PlaylistDidChange() : " + ret); 204 | } 205 | 206 | GUILayout.EndScrollView(); 207 | GUILayout.EndVertical(); 208 | } 209 | 210 | void OnMusicPlayerRemoteWillActivate(MusicPlayerRemoteWillActivate_t pCallback) { 211 | Debug.Log("[" + MusicPlayerRemoteWillActivate_t.k_iCallback + " - MusicPlayerRemoteWillActivate]"); 212 | } 213 | 214 | void OnMusicPlayerRemoteWillDeactivate(MusicPlayerRemoteWillDeactivate_t pCallback) { 215 | Debug.Log("[" + MusicPlayerRemoteWillDeactivate_t.k_iCallback + " - MusicPlayerRemoteWillDeactivate]"); 216 | } 217 | 218 | void OnMusicPlayerRemoteToFront(MusicPlayerRemoteToFront_t pCallback) { 219 | Debug.Log("[" + MusicPlayerRemoteToFront_t.k_iCallback + " - MusicPlayerRemoteToFront]"); 220 | } 221 | 222 | void OnMusicPlayerWillQuit(MusicPlayerWillQuit_t pCallback) { 223 | Debug.Log("[" + MusicPlayerWillQuit_t.k_iCallback + " - MusicPlayerWillQuit]"); 224 | } 225 | 226 | void OnMusicPlayerWantsPlay(MusicPlayerWantsPlay_t pCallback) { 227 | Debug.Log("[" + MusicPlayerWantsPlay_t.k_iCallback + " - MusicPlayerWantsPlay]"); 228 | } 229 | 230 | void OnMusicPlayerWantsPause(MusicPlayerWantsPause_t pCallback) { 231 | Debug.Log("[" + MusicPlayerWantsPause_t.k_iCallback + " - MusicPlayerWantsPause]"); 232 | } 233 | 234 | void OnMusicPlayerWantsPlayPrevious(MusicPlayerWantsPlayPrevious_t pCallback) { 235 | Debug.Log("[" + MusicPlayerWantsPlayPrevious_t.k_iCallback + " - MusicPlayerWantsPlayPrevious]"); 236 | } 237 | 238 | void OnMusicPlayerWantsPlayNext(MusicPlayerWantsPlayNext_t pCallback) { 239 | Debug.Log("[" + MusicPlayerWantsPlayNext_t.k_iCallback + " - MusicPlayerWantsPlayNext]"); 240 | } 241 | 242 | void OnMusicPlayerWantsShuffled(MusicPlayerWantsShuffled_t pCallback) { 243 | Debug.Log("[" + MusicPlayerWantsShuffled_t.k_iCallback + " - MusicPlayerWantsShuffled] - " + pCallback.m_bShuffled); 244 | } 245 | 246 | void OnMusicPlayerWantsLooped(MusicPlayerWantsLooped_t pCallback) { 247 | Debug.Log("[" + MusicPlayerWantsLooped_t.k_iCallback + " - MusicPlayerWantsLooped] - " + pCallback.m_bLooped); 248 | } 249 | 250 | void OnMusicPlayerWantsVolume(MusicPlayerWantsVolume_t pCallback) { 251 | Debug.Log("[" + MusicPlayerWantsVolume_t.k_iCallback + " - MusicPlayerWantsVolume] - " + pCallback.m_flNewVolume); 252 | } 253 | 254 | void OnMusicPlayerSelectsQueueEntry(MusicPlayerSelectsQueueEntry_t pCallback) { 255 | Debug.Log("[" + MusicPlayerSelectsQueueEntry_t.k_iCallback + " - MusicPlayerSelectsQueueEntry] - " + pCallback.nID); 256 | } 257 | 258 | void OnMusicPlayerSelectsPlaylistEntry(MusicPlayerSelectsPlaylistEntry_t pCallback) { 259 | Debug.Log("[" + MusicPlayerSelectsPlaylistEntry_t.k_iCallback + " - MusicPlayerSelectsPlaylistEntry] - " + pCallback.nID); 260 | } 261 | 262 | void OnMusicPlayerWantsPlayingRepeatStatus(MusicPlayerWantsPlayingRepeatStatus_t pCallback) { 263 | Debug.Log("[" + MusicPlayerWantsPlayingRepeatStatus_t.k_iCallback + " - MusicPlayerWantsPlayingRepeatStatus] - " + pCallback.m_nPlayingRepeatStatus); 264 | } 265 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamMusicRemoteTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48c607509606f754d9856aa728c63a4f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamMusicTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamMusicTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | 8 | protected Callback m_PlaybackStatusHasChanged; 9 | protected Callback m_VolumeHasChanged; 10 | 11 | public void OnEnable() { 12 | m_PlaybackStatusHasChanged = Callback.Create(OnPlaybackStatusHasChanged); 13 | m_VolumeHasChanged = Callback.Create(OnVolumeHasChanged); 14 | } 15 | 16 | public void RenderOnGUI() { 17 | GUILayout.BeginVertical("box"); 18 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 19 | 20 | GUILayout.Label("BIsEnabled() : " + SteamMusic.BIsEnabled()); 21 | 22 | GUILayout.Label("BIsPlaying() : " + SteamMusic.BIsPlaying()); 23 | 24 | GUILayout.Label("GetPlaybackStatus() : " + SteamMusic.GetPlaybackStatus()); 25 | 26 | if (GUILayout.Button("Play()")) { 27 | SteamMusic.Play(); 28 | print("SteamMusic.Play()"); 29 | } 30 | 31 | if (GUILayout.Button("Pause()")) { 32 | SteamMusic.Pause(); 33 | print("SteamMusic.Pause()"); 34 | } 35 | 36 | if (GUILayout.Button("PlayPrevious()")) { 37 | SteamMusic.PlayPrevious(); 38 | print("SteamMusic.PlayPrevious()"); 39 | } 40 | 41 | if (GUILayout.Button("PlayNext()")) { 42 | SteamMusic.PlayNext(); 43 | print("SteamMusic.PlayNext()"); 44 | } 45 | 46 | if (GUILayout.Button("SetVolume(1.0f)")) { 47 | SteamMusic.SetVolume(1.0f); 48 | print("SteamMusic.SetVolume(" + 1.0f + ")"); 49 | } 50 | 51 | GUILayout.Label("GetVolume() : " + SteamMusic.GetVolume()); 52 | 53 | GUILayout.EndScrollView(); 54 | GUILayout.EndVertical(); 55 | } 56 | 57 | void OnPlaybackStatusHasChanged(PlaybackStatusHasChanged_t pCallback) { 58 | Debug.Log("[" + PlaybackStatusHasChanged_t.k_iCallback + " - PlaybackStatusHasChanged]"); 59 | } 60 | 61 | void OnVolumeHasChanged(VolumeHasChanged_t pCallback) { 62 | Debug.Log("[" + VolumeHasChanged_t.k_iCallback + " - VolumeHasChanged] - " + pCallback.m_flNewVolume); 63 | } 64 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamMusicTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2d12cd73e133464d9570610a6e1efe0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamNetworkingTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamNetworkingTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private CSteamID m_RemoteSteamId; 8 | 9 | protected Callback m_P2PSessionRequest; 10 | protected Callback m_P2PSessionConnectFail; 11 | protected Callback m_SocketStatusCallback; 12 | 13 | public void OnEnable() { 14 | // You'd typically get this from a Lobby. Hardcoding it so that we don't need to integrate the whole lobby system with the networking. 15 | m_RemoteSteamId = new CSteamID(0); 16 | 17 | m_P2PSessionRequest = Callback.Create(OnP2PSessionRequest); 18 | m_P2PSessionConnectFail = Callback.Create(OnP2PSessionConnectFail); 19 | m_SocketStatusCallback = Callback.Create(OnSocketStatusCallback); 20 | } 21 | 22 | void OnDisable() { 23 | // Just incase we have it open when we close/assemblies get reloaded. 24 | if (!m_RemoteSteamId.IsValid()) { 25 | SteamNetworking.CloseP2PSessionWithUser(m_RemoteSteamId); 26 | } 27 | } 28 | 29 | enum MsgType : uint { 30 | Ping, 31 | Ack, 32 | } 33 | 34 | public void RenderOnGUI() { 35 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 36 | GUILayout.Label("Variables:"); 37 | GUILayout.Label("m_RemoteSteamId: " + m_RemoteSteamId); 38 | GUILayout.EndArea(); 39 | 40 | GUILayout.BeginVertical("box"); 41 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 42 | 43 | if (!m_RemoteSteamId.IsValid()) { 44 | GUILayout.Label("Please fill m_RemoteSteamId with a valid 64bit SteamId to use SteamNetworkingTest."); 45 | GUILayout.Label("Alternatively it will be filled automatically when a session request is recieved."); 46 | GUILayout.EndScrollView(); 47 | GUILayout.EndVertical(); 48 | return; 49 | } 50 | 51 | // Session-less connection functions 52 | if (GUILayout.Button("SendP2PPacket(m_RemoteSteamId, bytes, (uint)bytes.Length, EP2PSend.k_EP2PSendReliable)")) { 53 | byte[] bytes = new byte[4]; 54 | using (System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes)) 55 | using (System.IO.BinaryWriter b = new System.IO.BinaryWriter(ms)) { 56 | b.Write((uint)MsgType.Ping); 57 | } 58 | bool ret = SteamNetworking.SendP2PPacket(m_RemoteSteamId, bytes, (uint)bytes.Length, EP2PSend.k_EP2PSendReliable); 59 | print("SteamNetworking.SendP2PPacket(" + m_RemoteSteamId + ", " + bytes + ", " + (uint)bytes.Length + ", " + EP2PSend.k_EP2PSendReliable + ") : " + ret); 60 | } 61 | 62 | { 63 | uint MsgSize; 64 | bool ret = SteamNetworking.IsP2PPacketAvailable(out MsgSize); 65 | GUILayout.Label("IsP2PPacketAvailable(out MsgSize) : " + ret + " -- " + MsgSize); 66 | 67 | GUI.enabled = ret; 68 | 69 | if (GUILayout.Button("ReadP2PPacket(bytes, MsgSize, out newMsgSize, out SteamIdRemote)")) { 70 | byte[] bytes = new byte[MsgSize]; 71 | uint newMsgSize; 72 | CSteamID SteamIdRemote; 73 | ret = SteamNetworking.ReadP2PPacket(bytes, MsgSize, out newMsgSize, out SteamIdRemote); 74 | 75 | using (System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes)) 76 | using (System.IO.BinaryReader b = new System.IO.BinaryReader(ms)) { 77 | MsgType msgtype = (MsgType)b.ReadUInt32(); 78 | // switch statement here depending on the msgtype 79 | print("SteamNetworking.ReadP2PPacket(bytes, " + MsgSize + ", out newMsgSize, out SteamIdRemote) - " + ret + " -- " + newMsgSize + " -- " + SteamIdRemote + " -- " + msgtype); 80 | } 81 | 82 | } 83 | 84 | GUI.enabled = true; 85 | } 86 | 87 | //SteamNetworking.AcceptP2PSessionWithUser() // Only called from within P2PSessionRequest Callback! 88 | 89 | if (GUILayout.Button("CloseP2PSessionWithUser(m_RemoteSteamId)")) { 90 | bool ret = SteamNetworking.CloseP2PSessionWithUser(m_RemoteSteamId); 91 | print("SteamNetworking.CloseP2PSessionWithUser(" + m_RemoteSteamId + ") : " + ret); 92 | } 93 | 94 | if (GUILayout.Button("CloseP2PChannelWithUser(m_RemoteSteamId, 0)")) { 95 | bool ret = SteamNetworking.CloseP2PChannelWithUser(m_RemoteSteamId, 0); 96 | print("SteamNetworking.CloseP2PChannelWithUser(" + m_RemoteSteamId + ", " + 0 + ") : " + ret); 97 | } 98 | 99 | { 100 | P2PSessionState_t ConnectionState; 101 | bool ret = SteamNetworking.GetP2PSessionState(m_RemoteSteamId, out ConnectionState); 102 | GUILayout.Label("GetP2PSessionState(m_RemoteSteamId, out ConnectionState) : " + ret + " -- " + ConnectionState); 103 | } 104 | 105 | if (GUILayout.Button("AllowP2PPacketRelay(true)")) { 106 | bool ret = SteamNetworking.AllowP2PPacketRelay(true); 107 | print("SteamNetworking.AllowP2PPacketRelay(" + true + ") : " + ret); 108 | } 109 | 110 | // LISTEN / CONNECT style interface functions 111 | //SteamNetworking.CreateListenSocket() // TODO 112 | 113 | //SteamNetworking.CreateP2PConnectionSocket() // TODO 114 | 115 | //SteamNetworking.CreateConnectionSocket() // TODO 116 | 117 | //SteamNetworking.DestroySocket() // TODO 118 | 119 | //SteamNetworking.DestroyListenSocket() // TODO 120 | 121 | //SteamNetworking.SendDataOnSocket() // TODO 122 | 123 | //SteamNetworking.IsDataAvailableOnSocket() // TODO 124 | 125 | //SteamNetworking.RetrieveDataFromSocket() // TODO 126 | 127 | //SteamNetworking.IsDataAvailable() // TODO 128 | 129 | //SteamNetworking.RetrieveData() // TODO 130 | 131 | //SteamNetworking.GetSocketInfo() // TODO 132 | 133 | //SteamNetworking.GetListenSocketInfo() // TODO 134 | 135 | //SteamNetworking.GetSocketConnectionType() // TODO 136 | 137 | //SteamNetworking.GetMaxPacketSize() // TODO 138 | 139 | GUILayout.EndScrollView(); 140 | GUILayout.EndVertical(); 141 | } 142 | 143 | void OnP2PSessionRequest(P2PSessionRequest_t pCallback) { 144 | Debug.Log("[" + P2PSessionRequest_t.k_iCallback + " - P2PSessionRequest] - " + pCallback.m_steamIDRemote); 145 | 146 | bool ret = SteamNetworking.AcceptP2PSessionWithUser(pCallback.m_steamIDRemote); 147 | print("SteamNetworking.AcceptP2PSessionWithUser(" + pCallback.m_steamIDRemote + ") - " + ret); 148 | 149 | m_RemoteSteamId = pCallback.m_steamIDRemote; 150 | } 151 | 152 | void OnP2PSessionConnectFail(P2PSessionConnectFail_t pCallback) { 153 | Debug.Log("[" + P2PSessionConnectFail_t.k_iCallback + " - P2PSessionConnectFail] - " + pCallback.m_steamIDRemote + " -- " + pCallback.m_eP2PSessionError); 154 | } 155 | 156 | void OnSocketStatusCallback(SocketStatusCallback_t pCallback) { 157 | Debug.Log("[" + SocketStatusCallback_t.k_iCallback + " - SocketStatusCallback] - " + pCallback.m_hSocket + " -- " + pCallback.m_hListenSocket + " -- " + pCallback.m_steamIDRemote + " -- " + pCallback.m_eSNetSocketState); 158 | } 159 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamNetworkingTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b40423541ae2ae04b93a49361b4517d3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamParentalSettingsTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamParentalSettingsTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | 8 | protected Callback m_SteamParentalSettingsChanged; 9 | 10 | public void OnEnable() { 11 | m_SteamParentalSettingsChanged = Callback.Create(OnSteamParentalSettingsChanged); 12 | } 13 | 14 | public void RenderOnGUI() { 15 | GUILayout.BeginVertical("box"); 16 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 17 | 18 | GUILayout.Label("BIsParentalLockEnabled() : " + SteamParentalSettings.BIsParentalLockEnabled()); 19 | 20 | GUILayout.Label("BIsParentalLockLocked() : " + SteamParentalSettings.BIsParentalLockLocked()); 21 | 22 | GUILayout.Label("BIsAppBlocked(SteamUtils.GetAppID()) : " + SteamParentalSettings.BIsAppBlocked(SteamUtils.GetAppID())); 23 | 24 | GUILayout.Label("BIsAppInBlockList(SteamUtils.GetAppID()) : " + SteamParentalSettings.BIsAppInBlockList(SteamUtils.GetAppID())); 25 | 26 | GUILayout.Label("BIsFeatureBlocked(EParentalFeature.k_EFeatureTest) : " + SteamParentalSettings.BIsFeatureBlocked(EParentalFeature.k_EFeatureTest)); 27 | 28 | GUILayout.Label("BIsFeatureInBlockList(EParentalFeature.k_EFeatureTest) : " + SteamParentalSettings.BIsFeatureInBlockList(EParentalFeature.k_EFeatureTest)); 29 | 30 | GUILayout.EndScrollView(); 31 | GUILayout.EndVertical(); 32 | } 33 | 34 | void OnSteamParentalSettingsChanged(SteamParentalSettingsChanged_t pCallback) { 35 | Debug.Log("[" + SteamParentalSettingsChanged_t.k_iCallback + " - SteamParentalSettingsChanged]"); 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamParentalSettingsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a89ee9b7d2431e44fb8400192d026155 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamPartiesTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamPartiesTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private uint m_BeaconIndex; 8 | private PartyBeaconID_t m_PartyBeaconID; 9 | private uint m_NumLocations; 10 | private SteamPartyBeaconLocation_t[] m_BeaconLocationList; 11 | private CSteamID m_OtherUsersSteamID; 12 | 13 | protected Callback m_ReservationNotificationCallback; 14 | protected Callback m_AvailableBeaconLocationsUpdated; 15 | protected Callback m_ActiveBeaconsUpdated; 16 | 17 | private CallResult OnJoinPartyCallbackCallResult; 18 | private CallResult OnCreateBeaconCallbackCallResult; 19 | private CallResult OnChangeNumOpenSlotsCallbackCallResult; 20 | 21 | public void OnEnable() { 22 | m_BeaconIndex = 0; 23 | m_NumLocations = 0; 24 | m_PartyBeaconID = PartyBeaconID_t.Invalid; 25 | m_OtherUsersSteamID = CSteamID.Nil; 26 | 27 | m_ReservationNotificationCallback = Callback.Create(OnReservationNotificationCallback); 28 | m_AvailableBeaconLocationsUpdated = Callback.Create(OnAvailableBeaconLocationsUpdated); 29 | m_ActiveBeaconsUpdated = Callback.Create(OnActiveBeaconsUpdated); 30 | 31 | OnJoinPartyCallbackCallResult = CallResult.Create(OnJoinPartyCallback); 32 | OnCreateBeaconCallbackCallResult = CallResult.Create(OnCreateBeaconCallback); 33 | OnChangeNumOpenSlotsCallbackCallResult = CallResult.Create(OnChangeNumOpenSlotsCallback); 34 | } 35 | 36 | public void RenderOnGUI() { 37 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 38 | GUILayout.Label("Variables:"); 39 | GUILayout.Label("m_BeaconIndex: " + m_BeaconIndex); 40 | GUILayout.Label("m_PartyBeaconID: " + m_PartyBeaconID); 41 | GUILayout.Label("m_NumLocations: " + m_NumLocations); 42 | GUILayout.Label("m_BeaconLocationList: " + m_BeaconLocationList); 43 | GUILayout.Label("m_OtherUsersSteamID: " + m_OtherUsersSteamID); 44 | GUILayout.EndArea(); 45 | 46 | GUILayout.BeginVertical("box"); 47 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 48 | 49 | GUILayout.Label("GetNumActiveBeacons() : " + SteamParties.GetNumActiveBeacons()); 50 | 51 | if (GUILayout.Button("GetBeaconByIndex(m_BeaconIndex)")) { 52 | m_PartyBeaconID = SteamParties.GetBeaconByIndex(m_BeaconIndex); 53 | print("SteamParties.GetBeaconByIndex(" + m_BeaconIndex + ") : " + m_PartyBeaconID); 54 | } 55 | 56 | if (GUILayout.Button("GetBeaconDetails(m_PartyBeaconID, out m_OtherUsersSteamID, out m_BeaconLocationList[0], out Metadata, 1024)")) { 57 | m_BeaconLocationList = new SteamPartyBeaconLocation_t[1]; 58 | string Metadata; 59 | bool ret = SteamParties.GetBeaconDetails(m_PartyBeaconID, out m_OtherUsersSteamID, out m_BeaconLocationList[0], out Metadata, 1024); 60 | print("SteamParties.GetBeaconDetails(" + m_PartyBeaconID + ", " + "out m_OtherUsersSteamID" + ", " + "out m_BeaconLocationList[0]" + ", " + "out Metadata" + ", " + 1024 + ") : " + ret + " -- " + m_OtherUsersSteamID + " -- " + m_BeaconLocationList[0] + " -- " + Metadata); 61 | } 62 | 63 | if (GUILayout.Button("JoinParty(m_PartyBeaconID)")) { 64 | SteamAPICall_t handle = SteamParties.JoinParty(m_PartyBeaconID); 65 | OnJoinPartyCallbackCallResult.Set(handle); 66 | print("SteamParties.JoinParty(" + m_PartyBeaconID + ") : " + handle); 67 | } 68 | 69 | if (GUILayout.Button("GetNumAvailableBeaconLocations(out m_NumLocations)")) { 70 | bool ret = SteamParties.GetNumAvailableBeaconLocations(out m_NumLocations); 71 | print("SteamParties.GetNumAvailableBeaconLocations(" + "out m_NumLocations" + ") : " + ret + " -- " + m_NumLocations); 72 | } 73 | 74 | if (GUILayout.Button("GetAvailableBeaconLocations(m_BeaconLocationList, m_NumLocations)")) { 75 | m_BeaconLocationList = new SteamPartyBeaconLocation_t[m_NumLocations]; 76 | bool ret = SteamParties.GetAvailableBeaconLocations(m_BeaconLocationList, m_NumLocations); 77 | print("SteamParties.GetAvailableBeaconLocations(" + m_BeaconLocationList + ", " + m_NumLocations + ") : " + ret); 78 | } 79 | 80 | if (GUILayout.Button("CreateBeacon(1, ref m_BeaconLocationList[0], \"TestConnectString\", \"TestMetadata\")")) { 81 | SteamAPICall_t handle = SteamParties.CreateBeacon(1, ref m_BeaconLocationList[0], "TestConnectString", "TestMetadata"); 82 | OnCreateBeaconCallbackCallResult.Set(handle); 83 | print("SteamParties.CreateBeacon(" + 1 + ", " + "ref m_BeaconLocationList[0]" + ", " + "\"TestConnectString\"" + ", " + "\"TestMetadata\"" + ") : " + handle + " -- " + m_BeaconLocationList[0]); 84 | } 85 | 86 | if (GUILayout.Button("OnReservationCompleted(m_PartyBeaconID, m_OtherUsersSteamID)")) { 87 | SteamParties.OnReservationCompleted(m_PartyBeaconID, m_OtherUsersSteamID); 88 | print("SteamParties.OnReservationCompleted(" + m_PartyBeaconID + ", " + m_OtherUsersSteamID + ")"); 89 | } 90 | 91 | if (GUILayout.Button("CancelReservation(m_PartyBeaconID, m_OtherUsersSteamID)")) { 92 | SteamParties.CancelReservation(m_PartyBeaconID, m_OtherUsersSteamID); 93 | print("SteamParties.CancelReservation(" + m_PartyBeaconID + ", " + m_OtherUsersSteamID + ")"); 94 | } 95 | 96 | if (GUILayout.Button("ChangeNumOpenSlots(m_PartyBeaconID, 2)")) { 97 | SteamAPICall_t handle = SteamParties.ChangeNumOpenSlots(m_PartyBeaconID, 2); 98 | OnChangeNumOpenSlotsCallbackCallResult.Set(handle); 99 | print("SteamParties.ChangeNumOpenSlots(" + m_PartyBeaconID + ", " + 2 + ") : " + handle); 100 | } 101 | 102 | if (GUILayout.Button("DestroyBeacon(m_PartyBeaconID)")) { 103 | bool ret = SteamParties.DestroyBeacon(m_PartyBeaconID); 104 | m_PartyBeaconID = PartyBeaconID_t.Invalid; 105 | print("SteamParties.DestroyBeacon(" + m_PartyBeaconID + ") : " + ret); 106 | } 107 | 108 | if (GUILayout.Button("GetBeaconLocationData(m_BeaconLocationList[0], ESteamPartyBeaconLocationData.k_ESteamPartyBeaconLocationDataName, out DataString, 1024)")) { 109 | string DataString; 110 | bool ret = SteamParties.GetBeaconLocationData(m_BeaconLocationList[0], ESteamPartyBeaconLocationData.k_ESteamPartyBeaconLocationDataName, out DataString, 1024); 111 | print("SteamParties.GetBeaconLocationData(" + m_BeaconLocationList[0] + ", " + ESteamPartyBeaconLocationData.k_ESteamPartyBeaconLocationDataName + ", " + "out DataString" + ", " + 1024 + ") : " + ret + " -- " + DataString); 112 | } 113 | 114 | GUILayout.EndScrollView(); 115 | GUILayout.EndVertical(); 116 | } 117 | 118 | void OnJoinPartyCallback(JoinPartyCallback_t pCallback, bool bIOFailure) { 119 | Debug.Log("[" + JoinPartyCallback_t.k_iCallback + " - JoinPartyCallback] - " + pCallback.m_eResult + " -- " + pCallback.m_ulBeaconID + " -- " + pCallback.m_SteamIDBeaconOwner + " -- " + pCallback.m_rgchConnectString); 120 | 121 | if (pCallback.m_eResult == EResult.k_EResultOK) { 122 | m_PartyBeaconID = pCallback.m_ulBeaconID; 123 | m_OtherUsersSteamID = pCallback.m_SteamIDBeaconOwner; 124 | } 125 | } 126 | 127 | void OnCreateBeaconCallback(CreateBeaconCallback_t pCallback, bool bIOFailure) { 128 | Debug.Log("[" + CreateBeaconCallback_t.k_iCallback + " - CreateBeaconCallback] - " + pCallback.m_eResult + " -- " + pCallback.m_ulBeaconID); 129 | 130 | if (pCallback.m_eResult == EResult.k_EResultOK) { 131 | m_PartyBeaconID = pCallback.m_ulBeaconID; 132 | } 133 | } 134 | 135 | void OnReservationNotificationCallback(ReservationNotificationCallback_t pCallback) { 136 | Debug.Log("[" + ReservationNotificationCallback_t.k_iCallback + " - ReservationNotificationCallback] - " + pCallback.m_ulBeaconID + " -- " + pCallback.m_steamIDJoiner); 137 | 138 | m_PartyBeaconID = pCallback.m_ulBeaconID; 139 | m_OtherUsersSteamID = pCallback.m_steamIDJoiner; 140 | } 141 | 142 | void OnChangeNumOpenSlotsCallback(ChangeNumOpenSlotsCallback_t pCallback, bool bIOFailure) { 143 | Debug.Log("[" + ChangeNumOpenSlotsCallback_t.k_iCallback + " - ChangeNumOpenSlotsCallback] - " + pCallback.m_eResult); 144 | } 145 | 146 | void OnAvailableBeaconLocationsUpdated(AvailableBeaconLocationsUpdated_t pCallback) { 147 | Debug.Log("[" + AvailableBeaconLocationsUpdated_t.k_iCallback + " - AvailableBeaconLocationsUpdated]"); 148 | 149 | bool ret = SteamParties.GetNumAvailableBeaconLocations(out m_NumLocations); 150 | print("SteamParties.GetNumAvailableBeaconLocations(" + "out m_NumLocations" + ") : " + ret + " -- " + m_NumLocations); 151 | m_BeaconLocationList = new SteamPartyBeaconLocation_t[m_NumLocations]; 152 | bool ret2 = SteamParties.GetAvailableBeaconLocations(m_BeaconLocationList, m_NumLocations); 153 | print("SteamParties.GetAvailableBeaconLocations(" + m_BeaconLocationList + ", " + m_NumLocations + ") : " + ret); 154 | } 155 | 156 | void OnActiveBeaconsUpdated(ActiveBeaconsUpdated_t pCallback) { 157 | Debug.Log("[" + ActiveBeaconsUpdated_t.k_iCallback + " - ActiveBeaconsUpdated]"); 158 | } 159 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamPartiesTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10bc492f70e0efd4183b0f9d772a016f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamRemoteStorageTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3ff473e20de284428f7ac8e421d6625 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamScreenshotsTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamScreenshotsTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private ScreenshotHandle m_ScreenshotHandle; 8 | private bool m_Hooked; 9 | 10 | protected Callback m_ScreenshotReady; 11 | protected Callback m_ScreenshotRequested; 12 | 13 | public void OnEnable() { 14 | m_ScreenshotReady = Callback.Create(OnScreenshotReady); 15 | m_ScreenshotRequested = Callback.Create(OnScreenshotRequested); 16 | } 17 | 18 | IEnumerator WriteScreenshot() { 19 | yield return new WaitForEndOfFrame(); 20 | 21 | Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false); 22 | texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0, false); 23 | texture.Apply(false); 24 | 25 | Color[] color = texture.GetPixels(); 26 | byte[] RGB = new byte[color.Length * 3]; 27 | 28 | for(int i = 0, c = 0; i < RGB.Length; i += 3, ++c) { 29 | RGB[i] = (byte)(color[c].r * 255.0f); 30 | RGB[i + 1] = (byte)(color[c].g * 255.0f); 31 | RGB[i + 2] = (byte)(color[c].b * 255.0f); 32 | } 33 | 34 | Destroy(texture); 35 | 36 | // TODO: The image is upside down! "@ares_p: in Unity all texture data starts from "bottom" (OpenGL convention)" 37 | m_ScreenshotHandle = SteamScreenshots.WriteScreenshot(RGB, (uint)RGB.Length, Screen.width, Screen.height); 38 | print("SteamScreenshots.WriteScreenshot(" + RGB + ", " + (uint)RGB.Length + ", " + Screen.width + ", " + Screen.height + ") : " + m_ScreenshotHandle); 39 | } 40 | 41 | IEnumerator AddScreenshotToLibrary() { 42 | while (true) { 43 | if (System.IO.File.Exists(Application.dataPath + "/screenshot.png")) { 44 | m_ScreenshotHandle = SteamScreenshots.AddScreenshotToLibrary(Application.dataPath + "/screenshot.png", "", Screen.width, Screen.height); 45 | print("SteamScreenshots.AddScreenshotToLibrary(\"screenshot.png\", \"\", " + Screen.width + ", " + Screen.height + ") : " + m_ScreenshotHandle); 46 | yield break; 47 | } 48 | 49 | yield return null; 50 | } 51 | } 52 | 53 | public void RenderOnGUI() { 54 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 55 | GUILayout.Label("Variables:"); 56 | GUILayout.Label("m_ScreenshotHandle: " + m_ScreenshotHandle); 57 | GUILayout.Label("m_Hooked: " + m_Hooked); 58 | GUILayout.EndArea(); 59 | 60 | GUILayout.BeginVertical("box"); 61 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 62 | 63 | if (GUILayout.Button("WriteScreenshot(RGB, (uint)RGB.Length, Screen.width, Screen.height)")) { 64 | // We start a Coroutine with the actual implementation of this test because Texture2D.ReadPixels() has to be called at the end of the frame. 65 | StartCoroutine(WriteScreenshot()); 66 | } 67 | 68 | if (GUILayout.Button("AddScreenshotToLibrary(ScreenCapture.dataPath + \"/screenshot.png\", \"\", Screen.width, Screen.height)")) { 69 | ScreenCapture.CaptureScreenshot("screenshot.png"); 70 | // ScreenCapture.CaptureScreenshot is asyncronous, therefore we have to wait until the screenshot is created. 71 | StartCoroutine(AddScreenshotToLibrary()); 72 | } 73 | 74 | if (GUILayout.Button("TriggerScreenshot()")) { 75 | SteamScreenshots.TriggerScreenshot(); 76 | print("SteamScreenshots.TriggerScreenshot()"); 77 | } 78 | 79 | if (GUILayout.Button("HookScreenshots(!m_Hooked)")) { 80 | SteamScreenshots.HookScreenshots(!m_Hooked); 81 | print("SteamScreenshots.HookScreenshots(" + !m_Hooked + ")"); 82 | m_Hooked = !m_Hooked; 83 | } 84 | 85 | if (GUILayout.Button("SetLocation(m_ScreenshotHandle, \"LocationTest\")")) { 86 | bool ret = SteamScreenshots.SetLocation(m_ScreenshotHandle, "LocationTest"); 87 | print("SteamScreenshots.SetLocation(" + m_ScreenshotHandle + ", " + "\"LocationTest\"" + ") : " + ret); 88 | } 89 | 90 | if (GUILayout.Button("TagUser(m_ScreenshotHandle, TestConstants.Instance.k_SteamId_rlabrecque)")) { 91 | bool ret = SteamScreenshots.TagUser(m_ScreenshotHandle, TestConstants.Instance.k_SteamId_rlabrecque); 92 | print("SteamScreenshots.TagUser(" + m_ScreenshotHandle + ", " + TestConstants.Instance.k_SteamId_rlabrecque + ") : " + ret); 93 | } 94 | 95 | if (GUILayout.Button("TagPublishedFile(m_ScreenshotHandle, PublishedFileId_t.Invalid)")) { 96 | bool ret = SteamScreenshots.TagPublishedFile(m_ScreenshotHandle, PublishedFileId_t.Invalid); 97 | print("SteamScreenshots.TagPublishedFile(" + m_ScreenshotHandle + ", " + PublishedFileId_t.Invalid + ") : " + ret); 98 | } 99 | 100 | GUILayout.Label("IsScreenshotsHooked() : " + SteamScreenshots.IsScreenshotsHooked()); 101 | 102 | if (GUILayout.Button("AddVRScreenshotToLibrary(EVRScreenshotType.k_EVRScreenshotType_None, null, null)")) { 103 | ScreenshotHandle ret = SteamScreenshots.AddVRScreenshotToLibrary(EVRScreenshotType.k_EVRScreenshotType_None, null, null); 104 | print("SteamScreenshots.AddVRScreenshotToLibrary(" + EVRScreenshotType.k_EVRScreenshotType_None + ", " + null + ", " + null + ") : " + ret); 105 | } 106 | 107 | GUILayout.EndScrollView(); 108 | GUILayout.EndVertical(); 109 | } 110 | 111 | void OnScreenshotReady(ScreenshotReady_t pCallback) { 112 | Debug.Log("[" + ScreenshotReady_t.k_iCallback + " - ScreenshotReady] - " + pCallback.m_hLocal + " -- " + pCallback.m_eResult); 113 | } 114 | 115 | void OnScreenshotRequested(ScreenshotRequested_t pCallback) { 116 | Debug.Log("[" + ScreenshotRequested_t.k_iCallback + " - ScreenshotRequested]"); 117 | } 118 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamScreenshotsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edc2b9dc1e82b1b46bb3affce330a0b7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | internal class MonoPInvokeCallbackAttribute : System.Attribute 6 | { 7 | public MonoPInvokeCallbackAttribute() { } 8 | } 9 | 10 | public class SteamTest : MonoBehaviour { 11 | public enum EGUIState { 12 | SteamApps, 13 | SteamClient, 14 | SteamFriends, 15 | SteamHTMLSurface, 16 | SteamHTTP, 17 | SteamInput, 18 | SteamInventory, 19 | SteamMatchmaking, 20 | SteamMatchmakingServers, 21 | SteamMusic, 22 | SteamMusicRemote, 23 | SteamNetworking, 24 | SteamParentalSettings, 25 | SteamParties, 26 | SteamRemoteStorage, 27 | SteamScreenshots, 28 | SteamTimeline, 29 | SteamUGC, 30 | SteamUser, 31 | SteamUserStatsTest, 32 | SteamUtils, 33 | SteamVideo, 34 | 35 | MAX_STATES 36 | } 37 | 38 | public EGUIState m_State { get; private set; } 39 | 40 | private bool m_bInitialized = false; 41 | 42 | private static SteamTest m_SteamTest = null; 43 | 44 | private SteamAppsTest AppsTest; 45 | private SteamClientTest ClientTest; 46 | private SteamFriendsTest FriendsTest; 47 | private SteamHTMLSurfaceTest HTMLSurfaceTest; 48 | private SteamHTTPTest HTTPTest; 49 | private SteamInputTest InputTest; 50 | private SteamInventoryTest InventoryTest; 51 | private SteamMatchmakingServersTest MatchmakingServersTest; 52 | private SteamMatchmakingTest MatchmakingTest; 53 | private SteamMusicRemoteTest MusicRemoteTest; 54 | private SteamMusicTest MusicTest; 55 | private SteamNetworkingTest NetworkingTest; 56 | private SteamParentalSettingsTest ParentalSettingsTest; 57 | private SteamPartiesTest PartiesTest; 58 | private SteamRemoteStorageTest RemoteStorageTest; 59 | private SteamScreenshotsTest ScreenshotsTest; 60 | private SteamTimelineTest TimelineTest; 61 | private SteamUGCTest UGCTest; 62 | private SteamUserStatsTest UserStatsTest; 63 | private SteamUserTest UserTest; 64 | private SteamUtilsTest UtilsTest; 65 | private SteamVideoTest VideoTest; 66 | 67 | SteamAPIWarningMessageHook_t SteamAPIWarningMessageHook; 68 | 69 | [MonoPInvokeCallback] 70 | static void SteamAPIDebugTextHook(int nSeverity, System.Text.StringBuilder pchDebugText) { 71 | Debug.LogWarning(pchDebugText); 72 | } 73 | 74 | void Awake() { 75 | // Only one instance of Steamworks at a time! 76 | if (m_SteamTest != null) { 77 | Destroy(gameObject); 78 | return; 79 | } 80 | m_SteamTest = this; 81 | 82 | // We want our Steam Instance to persist across scenes. 83 | DontDestroyOnLoad(gameObject); 84 | 85 | if (!Packsize.Test()) { 86 | throw new System.Exception("Packsize is wrong! You are likely using a Linux/OSX build on Windows or vice versa."); 87 | } 88 | 89 | if (!DllCheck.Test()) { 90 | throw new System.Exception("DllCheck returned false."); 91 | } 92 | 93 | try { 94 | m_bInitialized = SteamAPI.Init(); 95 | } 96 | catch (System.DllNotFoundException e) { // We catch this exception here, as it will be the first occurrence of it. 97 | Debug.LogError("[Steamworks] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + e, this); 98 | 99 | Application.Quit(); 100 | return; 101 | } 102 | 103 | if (!m_bInitialized) { 104 | Debug.LogError("SteamAPI_Init() failed", this); 105 | return; 106 | } 107 | 108 | // Set up our callback to recieve warning messages from Steam. 109 | // You must launch with "-debug_steamapi" in the launch args to recieve warnings. 110 | SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook); 111 | SteamClient.SetWarningMessageHook(SteamAPIWarningMessageHook); 112 | 113 | // Register our Steam Callbacks 114 | AppsTest = gameObject.AddComponent(); 115 | ClientTest = gameObject.AddComponent(); 116 | FriendsTest = gameObject.AddComponent(); 117 | HTMLSurfaceTest = gameObject.AddComponent(); 118 | HTTPTest = gameObject.AddComponent(); 119 | InputTest = gameObject.AddComponent(); 120 | InventoryTest = gameObject.AddComponent(); 121 | MatchmakingServersTest = gameObject.AddComponent(); 122 | MatchmakingTest = gameObject.AddComponent(); 123 | MusicRemoteTest = gameObject.AddComponent(); 124 | MusicTest = gameObject.AddComponent(); 125 | NetworkingTest = gameObject.AddComponent(); 126 | ParentalSettingsTest = gameObject.AddComponent(); 127 | PartiesTest = gameObject.AddComponent(); 128 | TimelineTest = gameObject.AddComponent(); 129 | RemoteStorageTest = gameObject.AddComponent(); 130 | UGCTest = gameObject.AddComponent(); 131 | UserStatsTest = gameObject.AddComponent(); 132 | UserTest = gameObject.AddComponent(); 133 | UtilsTest = gameObject.AddComponent(); 134 | VideoTest = gameObject.AddComponent(); 135 | ScreenshotsTest = gameObject.AddComponent(); 136 | 137 | } 138 | 139 | void OnEnable() { 140 | // This should only get called after an Assembly reload, You should never disable the Steamworks Manager yourself. 141 | if (m_SteamTest == null) { 142 | m_SteamTest = this; 143 | } 144 | 145 | if (!m_bInitialized) { 146 | return; 147 | } 148 | 149 | if (SteamAPIWarningMessageHook == null) { 150 | SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook); 151 | SteamClient.SetWarningMessageHook(SteamAPIWarningMessageHook); 152 | } 153 | } 154 | 155 | void OnDestroy() { 156 | if (!m_bInitialized) { 157 | return; 158 | } 159 | 160 | SteamAPI.Shutdown(); 161 | } 162 | 163 | void Update() { 164 | if (!m_bInitialized) { 165 | return; 166 | } 167 | 168 | SteamAPI.RunCallbacks(); 169 | 170 | if (Input.GetKeyDown(KeyCode.Escape)) { 171 | Application.Quit(); 172 | } 173 | else if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.RightArrow)) { 174 | ++m_State; 175 | 176 | if (m_State == EGUIState.MAX_STATES) { 177 | m_State = (EGUIState)0; 178 | } 179 | } 180 | else if (Input.GetKeyDown(KeyCode.LeftArrow)) { 181 | --m_State; 182 | 183 | if (m_State == (EGUIState)(-1)) { 184 | m_State = EGUIState.MAX_STATES - 1; 185 | } 186 | } 187 | } 188 | 189 | void OnGUI() { 190 | if (!m_bInitialized) { 191 | GUILayout.Label("Steamworks is not Initialized"); 192 | return; 193 | } 194 | 195 | GUILayout.Label("[" + ((int)m_State + 1) + " / " + (int)EGUIState.MAX_STATES + "] " + m_State.ToString()); 196 | 197 | switch (m_State) { 198 | case EGUIState.SteamApps: 199 | AppsTest.RenderOnGUI(); 200 | break; 201 | case EGUIState.SteamClient: 202 | ClientTest.RenderOnGUI(); 203 | break; 204 | case EGUIState.SteamFriends: 205 | FriendsTest.RenderOnGUI(); 206 | break; 207 | case EGUIState.SteamHTMLSurface: 208 | HTMLSurfaceTest.RenderOnGUI(); 209 | break; 210 | case EGUIState.SteamHTTP: 211 | HTTPTest.RenderOnGUI(); 212 | break; 213 | case EGUIState.SteamInput: 214 | InputTest.RenderOnGUI(); 215 | break; 216 | case EGUIState.SteamInventory: 217 | InventoryTest.RenderOnGUI(); 218 | break; 219 | case EGUIState.SteamMatchmaking: 220 | MatchmakingTest.RenderOnGUI(); 221 | break; 222 | case EGUIState.SteamMatchmakingServers: 223 | MatchmakingServersTest.RenderOnGUI(); 224 | break; 225 | case EGUIState.SteamMusic: 226 | MusicTest.RenderOnGUI(); 227 | break; 228 | case EGUIState.SteamMusicRemote: 229 | MusicRemoteTest.RenderOnGUI(); 230 | break; 231 | case EGUIState.SteamNetworking: 232 | NetworkingTest.RenderOnGUI(); 233 | break; 234 | case EGUIState.SteamParentalSettings: 235 | ParentalSettingsTest.RenderOnGUI(); 236 | break; 237 | case EGUIState.SteamParties: 238 | PartiesTest.RenderOnGUI(); 239 | break; 240 | case EGUIState.SteamRemoteStorage: 241 | RemoteStorageTest.RenderOnGUI(); 242 | break; 243 | case EGUIState.SteamScreenshots: 244 | ScreenshotsTest.RenderOnGUI(); 245 | break; 246 | case EGUIState.SteamTimeline: 247 | TimelineTest.RenderOnGUI(); 248 | break; 249 | case EGUIState.SteamUGC: 250 | UGCTest.RenderOnGUI(); 251 | break; 252 | case EGUIState.SteamUser: 253 | UserTest.RenderOnGUI(); 254 | break; 255 | case EGUIState.SteamUserStatsTest: 256 | UserStatsTest.RenderOnGUI(); 257 | break; 258 | case EGUIState.SteamUtils: 259 | UtilsTest.RenderOnGUI(); 260 | break; 261 | case EGUIState.SteamVideo: 262 | VideoTest.RenderOnGUI(); 263 | break; 264 | } 265 | } 266 | 267 | public static void PrintArray(string name, IList arr) { 268 | System.Text.StringBuilder strBuilder = new System.Text.StringBuilder(name + '\n'); 269 | 270 | for (int i = 0; i < arr.Count; ++i) { 271 | strBuilder.AppendLine(arr[i].ToString()); 272 | } 273 | 274 | print(strBuilder); 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9abdaac55413bc14a99f1423017a29df 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamTimelineTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamTimelineTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | 8 | public void OnEnable() { 9 | } 10 | 11 | public void RenderOnGUI() { 12 | GUILayout.BeginVertical("box"); 13 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 14 | 15 | if (GUILayout.Button("SetTimelineStateDescription(\"Description\", 0.0f)")) { 16 | SteamTimeline.SetTimelineStateDescription("Description", 0.0f); 17 | print("SteamTimeline.SetTimelineStateDescription(" + "\"Description\"" + ", " + 0.0f + ")"); 18 | } 19 | 20 | if (GUILayout.Button("ClearTimelineStateDescription(0.0f)")) { 21 | SteamTimeline.ClearTimelineStateDescription(0.0f); 22 | print("SteamTimeline.ClearTimelineStateDescription(" + 0.0f + ")"); 23 | } 24 | 25 | if (GUILayout.Button("AddTimelineEvent(\"steam_marker\", \"Test Event\", \"Test Description\", 0, -5.0f, 5.0f, ETimelineEventClipPriority.k_ETimelineEventClipPriority_Standard)")) { 26 | SteamTimeline.AddTimelineEvent("steam_marker", "Test Event", "Test Description", 0, -5.0f, 5.0f, ETimelineEventClipPriority.k_ETimelineEventClipPriority_Standard); 27 | print("SteamTimeline.AddTimelineEvent(" + "\"steam_marker\"" + ", " + "\"Test Event\"" + ", " + "\"Test Description\"" + ", " + 0 + ", " + -5.0f + ", " + 5.0f + ", " + ETimelineEventClipPriority.k_ETimelineEventClipPriority_Standard + ")"); 28 | } 29 | 30 | if (GUILayout.Button("SetTimelineGameMode(ETimelineGameMode.k_ETimelineGameMode_Playing)")) { 31 | SteamTimeline.SetTimelineGameMode(ETimelineGameMode.k_ETimelineGameMode_Playing); 32 | print("SteamTimeline.SetTimelineGameMode(" + ETimelineGameMode.k_ETimelineGameMode_Playing + ")"); 33 | } 34 | 35 | GUILayout.EndScrollView(); 36 | GUILayout.EndVertical(); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamTimelineTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b2dda0777281dd4cb4238df76930997 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamUGCTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4041a7398c30dd149ba8f3aa0ecac40c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamUserStatsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd765638539614a418cee6b9558985d2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamUserTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamUserTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private byte[] m_Ticket; 8 | private uint m_pcbTicket; 9 | private HAuthTicket m_HAuthTicket; 10 | private GameObject m_VoiceLoopback; 11 | 12 | protected Callback m_SteamServersConnected; 13 | protected Callback m_SteamServerConnectFailure; 14 | protected Callback m_SteamServersDisconnected; 15 | protected Callback m_ClientGameServerDeny; 16 | protected Callback m_IPCFailure; 17 | protected Callback m_LicensesUpdated; 18 | protected Callback m_ValidateAuthTicketResponse; 19 | protected Callback m_MicroTxnAuthorizationResponse; 20 | protected Callback m_GetAuthSessionTicketResponse; 21 | protected Callback m_GameWebCallback; 22 | protected Callback m_GetTicketForWebApiResponse; 23 | 24 | private CallResult OnEncryptedAppTicketResponseCallResult; 25 | private CallResult OnStoreAuthURLResponseCallResult; 26 | private CallResult OnMarketEligibilityResponseCallResult; 27 | private CallResult OnDurationControlCallResult; 28 | 29 | public void OnEnable() { 30 | m_SteamServersConnected = Callback.Create(OnSteamServersConnected); 31 | m_SteamServerConnectFailure = Callback.Create(OnSteamServerConnectFailure); 32 | m_SteamServersDisconnected = Callback.Create(OnSteamServersDisconnected); 33 | m_ClientGameServerDeny = Callback.Create(OnClientGameServerDeny); 34 | m_IPCFailure = Callback.Create(OnIPCFailure); 35 | m_LicensesUpdated = Callback.Create(OnLicensesUpdated); 36 | m_ValidateAuthTicketResponse = Callback.Create(OnValidateAuthTicketResponse); 37 | m_MicroTxnAuthorizationResponse = Callback.Create(OnMicroTxnAuthorizationResponse); 38 | m_GetAuthSessionTicketResponse = Callback.Create(OnGetAuthSessionTicketResponse); 39 | m_GameWebCallback = Callback.Create(OnGameWebCallback); 40 | m_GetTicketForWebApiResponse = Callback.Create(OnGetTicketForWebApiResponse); 41 | 42 | OnEncryptedAppTicketResponseCallResult = CallResult.Create(OnEncryptedAppTicketResponse); 43 | OnStoreAuthURLResponseCallResult = CallResult.Create(OnStoreAuthURLResponse); 44 | OnMarketEligibilityResponseCallResult = CallResult.Create(OnMarketEligibilityResponse); 45 | OnDurationControlCallResult = CallResult.Create(OnDurationControl); 46 | } 47 | 48 | public void RenderOnGUI() { 49 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 50 | GUILayout.Label("Variables:"); 51 | GUILayout.Label("m_Ticket: " + m_Ticket); 52 | GUILayout.Label("m_pcbTicket: " + m_pcbTicket); 53 | GUILayout.Label("m_HAuthTicket: " + m_HAuthTicket); 54 | GUILayout.Label("m_VoiceLoopback: " + m_VoiceLoopback); 55 | GUILayout.EndArea(); 56 | 57 | GUILayout.BeginVertical("box"); 58 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 59 | 60 | GUILayout.Label("GetHSteamUser() : " + SteamUser.GetHSteamUser()); 61 | 62 | GUILayout.Label("BLoggedOn() : " + SteamUser.BLoggedOn()); 63 | 64 | GUILayout.Label("GetSteamID() : " + SteamUser.GetSteamID()); 65 | 66 | //SteamUser.InitiateGameConnection_DEPRECATED() // N/A - DEPRECATED 67 | 68 | //SteamUser.TerminateGameConnection_DEPRECATED() // N/A - DEPRECATED 69 | 70 | //SteamUser.TrackAppUsageEvent() // Legacy function with no documentation 71 | 72 | { 73 | string Buffer; 74 | bool ret = SteamUser.GetUserDataFolder(out Buffer, 260); 75 | GUILayout.Label("GetUserDataFolder(out Buffer, 260) : " + ret + " -- " + Buffer); 76 | } 77 | 78 | if (GUILayout.Button("StartVoiceRecording()")) { 79 | SteamUser.StartVoiceRecording(); 80 | print("SteamUser.StartVoiceRecording()"); 81 | } 82 | 83 | if (GUILayout.Button("StopVoiceRecording()")) { 84 | SteamUser.StopVoiceRecording(); 85 | print("SteamUser.StopVoiceRecording()"); 86 | } 87 | 88 | { 89 | uint Compressed; 90 | EVoiceResult ret = SteamUser.GetAvailableVoice(out Compressed); 91 | GUILayout.Label("GetAvailableVoice(out Compressed) : " + ret + " -- " + Compressed); 92 | 93 | if (ret == EVoiceResult.k_EVoiceResultOK && Compressed > 0) { 94 | byte[] DestBuffer = new byte[1024]; 95 | uint BytesWritten; 96 | ret = SteamUser.GetVoice(true, DestBuffer, 1024, out BytesWritten); 97 | //print("SteamUser.GetVoice(true, DestBuffer, 1024, out BytesWritten) : " + ret + " -- " + BytesWritten); 98 | 99 | if (ret == EVoiceResult.k_EVoiceResultOK && BytesWritten > 0) { 100 | byte[] DestBuffer2 = new byte[11025 * 2]; 101 | uint BytesWritten2; 102 | ret = SteamUser.DecompressVoice(DestBuffer, BytesWritten, DestBuffer2, (uint)DestBuffer2.Length, out BytesWritten2, 11025); 103 | //print("SteamUser.DecompressVoice(DestBuffer, BytesWritten, DestBuffer2, (uint)DestBuffer2.Length, out BytesWritten2, 11025) - " + ret + " -- " + BytesWritten2); 104 | 105 | if (ret == EVoiceResult.k_EVoiceResultOK && BytesWritten2 > 0) { 106 | AudioSource source; 107 | if (!m_VoiceLoopback) { 108 | m_VoiceLoopback = new GameObject("Voice Loopback"); 109 | source = m_VoiceLoopback.AddComponent(); 110 | source.clip = AudioClip.Create("Testing!", 11025, 1, 11025, false); 111 | } 112 | else { 113 | source = m_VoiceLoopback.GetComponent(); 114 | } 115 | 116 | float[] test = new float[11025]; 117 | for (int i = 0; i < test.Length; ++i) { 118 | test[i] = (short)(DestBuffer2[i * 2] | DestBuffer2[i * 2 + 1] << 8) / 32768.0f; 119 | } 120 | source.clip.SetData(test, 0); 121 | source.Play(); 122 | } 123 | } 124 | } 125 | } 126 | 127 | GUILayout.Label("GetVoiceOptimalSampleRate() : " + SteamUser.GetVoiceOptimalSampleRate()); 128 | 129 | if (GUILayout.Button("GetAuthSessionTicket(Ticket, 1024, out pcbTicket)")) { 130 | SteamNetworkingIdentity pSteamNetworkingIdentity = new SteamNetworkingIdentity(); 131 | m_Ticket = new byte[1024]; 132 | m_HAuthTicket = SteamUser.GetAuthSessionTicket(m_Ticket, 1024, out m_pcbTicket, ref pSteamNetworkingIdentity); 133 | print("SteamUser.GetAuthSessionTicket(Ticket, 1024, out pcbTicket, ref pSteamNetworkingIdentity) - " + m_HAuthTicket + " -- " + m_pcbTicket); 134 | } 135 | 136 | if (GUILayout.Button("GetAuthTicketForWebApi(null)")) { 137 | HAuthTicket ret = SteamUser.GetAuthTicketForWebApi(null); 138 | print("SteamUser.GetAuthTicketForWebApi(" + null + ") : " + ret); 139 | } 140 | 141 | if (GUILayout.Button("BeginAuthSession(m_Ticket, (int)m_pcbTicket, SteamUser.GetSteamID())")) { 142 | if (m_HAuthTicket != HAuthTicket.Invalid && m_pcbTicket != 0) { 143 | EBeginAuthSessionResult ret = SteamUser.BeginAuthSession(m_Ticket, (int)m_pcbTicket, SteamUser.GetSteamID()); 144 | print("SteamUser.BeginAuthSession(m_Ticket, " + (int)m_pcbTicket + ", " + SteamUser.GetSteamID() + ") - " + ret); 145 | } 146 | else { 147 | print("Call GetAuthSessionTicket first!"); 148 | } 149 | } 150 | 151 | if (GUILayout.Button("EndAuthSession(SteamUser.GetSteamID())")) { 152 | SteamUser.EndAuthSession(SteamUser.GetSteamID()); 153 | print("SteamUser.EndAuthSession(" + SteamUser.GetSteamID() + ")"); 154 | } 155 | 156 | if (GUILayout.Button("CancelAuthTicket(m_HAuthTicket)")) { 157 | SteamUser.CancelAuthTicket(m_HAuthTicket); 158 | print("SteamUser.CancelAuthTicket(" + m_HAuthTicket + ")"); 159 | } 160 | 161 | GUILayout.Label("UserHasLicenseForApp(SteamUser.GetSteamID(), SteamUtils.GetAppID()) : " + SteamUser.UserHasLicenseForApp(SteamUser.GetSteamID(), SteamUtils.GetAppID())); 162 | 163 | GUILayout.Label("BIsBehindNAT() : " + SteamUser.BIsBehindNAT()); 164 | 165 | if (GUILayout.Button("AdvertiseGame(CSteamID.NonSteamGS, TestConstants.k_IpAddress127_0_0_1_uint, TestConstants.k_Port27015)")) { 166 | SteamUser.AdvertiseGame(CSteamID.NonSteamGS, TestConstants.k_IpAddress127_0_0_1_uint, TestConstants.k_Port27015); 167 | print("SteamUser.AdvertiseGame(" + CSteamID.NonSteamGS + ", " + TestConstants.k_IpAddress127_0_0_1_uint + ", " + TestConstants.k_Port27015 + ")"); 168 | } 169 | 170 | if (GUILayout.Button("RequestEncryptedAppTicket(k_unSecretData, sizeof(uint))")) { 171 | byte[] k_unSecretData = System.BitConverter.GetBytes(0x5444); 172 | SteamAPICall_t handle = SteamUser.RequestEncryptedAppTicket(k_unSecretData, sizeof(uint)); 173 | OnEncryptedAppTicketResponseCallResult.Set(handle); 174 | print("SteamUser.RequestEncryptedAppTicket(" + k_unSecretData + ", " + sizeof(uint) + ") : " + handle); 175 | } 176 | 177 | if (GUILayout.Button("GetEncryptedAppTicket(rgubTicket, 1024, out cubTicket)")) { 178 | byte[] rgubTicket = new byte[1024]; 179 | uint cubTicket; 180 | bool ret = SteamUser.GetEncryptedAppTicket(rgubTicket, 1024, out cubTicket); 181 | print("SteamUser.GetEncryptedAppTicket(" + rgubTicket + ", " + 1024 + ", " + "out cubTicket" + ") : " + ret + " -- " + cubTicket); 182 | } 183 | 184 | // SpaceWar does not have trading cards, so this function will only ever return 0 and produce an annoying warning. 185 | if (GUILayout.Button("GetGameBadgeLevel(1, false)")) { 186 | int ret = SteamUser.GetGameBadgeLevel(1, false); 187 | print("SteamUser.GetGameBadgeLevel(" + 1 + ", " + false + ") : " + ret); 188 | } 189 | 190 | GUILayout.Label("GetPlayerSteamLevel() : " + SteamUser.GetPlayerSteamLevel()); 191 | 192 | if (GUILayout.Button("RequestStoreAuthURL(\"https://steampowered.com\")")) { 193 | SteamAPICall_t handle = SteamUser.RequestStoreAuthURL("https://steampowered.com"); 194 | OnStoreAuthURLResponseCallResult.Set(handle); 195 | print("SteamUser.RequestStoreAuthURL(" + "\"https://steampowered.com\"" + ") : " + handle); 196 | } 197 | 198 | GUILayout.Label("BIsPhoneVerified() : " + SteamUser.BIsPhoneVerified()); 199 | 200 | GUILayout.Label("BIsTwoFactorEnabled() : " + SteamUser.BIsTwoFactorEnabled()); 201 | 202 | GUILayout.Label("BIsPhoneIdentifying() : " + SteamUser.BIsPhoneIdentifying()); 203 | 204 | GUILayout.Label("BIsPhoneRequiringVerification() : " + SteamUser.BIsPhoneRequiringVerification()); 205 | 206 | if (GUILayout.Button("GetMarketEligibility()")) { 207 | SteamAPICall_t handle = SteamUser.GetMarketEligibility(); 208 | OnMarketEligibilityResponseCallResult.Set(handle); 209 | print("SteamUser.GetMarketEligibility() : " + handle); 210 | } 211 | 212 | if (GUILayout.Button("GetDurationControl()")) { 213 | SteamAPICall_t handle = SteamUser.GetDurationControl(); 214 | OnDurationControlCallResult.Set(handle); 215 | print("SteamUser.GetDurationControl() : " + handle); 216 | } 217 | 218 | if (GUILayout.Button("BSetDurationControlOnlineState(EDurationControlOnlineState.k_EDurationControlOnlineState_Offline)")) { 219 | bool ret = SteamUser.BSetDurationControlOnlineState(EDurationControlOnlineState.k_EDurationControlOnlineState_Offline); 220 | print("SteamUser.BSetDurationControlOnlineState(" + EDurationControlOnlineState.k_EDurationControlOnlineState_Offline + ") : " + ret); 221 | } 222 | 223 | GUILayout.EndScrollView(); 224 | GUILayout.EndVertical(); 225 | } 226 | 227 | void OnSteamServersConnected(SteamServersConnected_t pCallback) { 228 | Debug.Log("[" + SteamServersConnected_t.k_iCallback + " - SteamServersConnected]"); 229 | } 230 | 231 | void OnSteamServerConnectFailure(SteamServerConnectFailure_t pCallback) { 232 | Debug.Log("[" + SteamServerConnectFailure_t.k_iCallback + " - SteamServerConnectFailure] - " + pCallback.m_eResult + " -- " + pCallback.m_bStillRetrying); 233 | } 234 | 235 | void OnSteamServersDisconnected(SteamServersDisconnected_t pCallback) { 236 | Debug.Log("[" + SteamServersDisconnected_t.k_iCallback + " - SteamServersDisconnected] - " + pCallback.m_eResult); 237 | } 238 | 239 | void OnClientGameServerDeny(ClientGameServerDeny_t pCallback) { 240 | Debug.Log("[" + ClientGameServerDeny_t.k_iCallback + " - ClientGameServerDeny] - " + pCallback.m_uAppID + " -- " + pCallback.m_unGameServerIP + " -- " + pCallback.m_usGameServerPort + " -- " + pCallback.m_bSecure + " -- " + pCallback.m_uReason); 241 | } 242 | 243 | void OnIPCFailure(IPCFailure_t pCallback) { 244 | Debug.Log("[" + IPCFailure_t.k_iCallback + " - IPCFailure] - " + pCallback.m_eFailureType); 245 | } 246 | 247 | void OnLicensesUpdated(LicensesUpdated_t pCallback) { 248 | Debug.Log("[" + LicensesUpdated_t.k_iCallback + " - LicensesUpdated]"); 249 | } 250 | 251 | void OnValidateAuthTicketResponse(ValidateAuthTicketResponse_t pCallback) { 252 | Debug.Log("[" + ValidateAuthTicketResponse_t.k_iCallback + " - ValidateAuthTicketResponse] - " + pCallback.m_SteamID + " -- " + pCallback.m_eAuthSessionResponse + " -- " + pCallback.m_OwnerSteamID); 253 | } 254 | 255 | void OnMicroTxnAuthorizationResponse(MicroTxnAuthorizationResponse_t pCallback) { 256 | Debug.Log("[" + MicroTxnAuthorizationResponse_t.k_iCallback + " - MicroTxnAuthorizationResponse] - " + pCallback.m_unAppID + " -- " + pCallback.m_ulOrderID + " -- " + pCallback.m_bAuthorized); 257 | } 258 | 259 | void OnEncryptedAppTicketResponse(EncryptedAppTicketResponse_t pCallback, bool bIOFailure) { 260 | Debug.Log("[" + EncryptedAppTicketResponse_t.k_iCallback + " - EncryptedAppTicketResponse] - " + pCallback.m_eResult); 261 | 262 | // This code is taken directly from SteamworksExample/SpaceWar 263 | if (pCallback.m_eResult == EResult.k_EResultOK) { 264 | byte[] rgubTicket = new byte[1024]; 265 | uint cubTicket; 266 | SteamUser.GetEncryptedAppTicket(rgubTicket, 1024, out cubTicket); 267 | 268 | // normally at this point you transmit the encrypted ticket to the service that knows the decryption key 269 | // this code is just to demonstrate the ticket cracking library 270 | 271 | // included is the "secret" key for spacewar. normally this is secret 272 | byte[] rgubKey = new byte[32] { 0xed, 0x93, 0x86, 0x07, 0x36, 0x47, 0xce, 0xa5, 0x8b, 0x77, 0x21, 0x49, 0x0d, 0x59, 0xed, 0x44, 0x57, 0x23, 0xf0, 0xf6, 0x6e, 0x74, 0x14, 0xe1, 0x53, 0x3b, 0xa3, 0x3c, 0xd8, 0x03, 0xbd, 0xbd }; 273 | 274 | byte[] rgubDecrypted = new byte[1024]; 275 | uint cubDecrypted = 1024; 276 | if (!SteamEncryptedAppTicket.BDecryptTicket(rgubTicket, cubTicket, rgubDecrypted, ref cubDecrypted, rgubKey, rgubKey.Length)) { 277 | Debug.Log("Ticket failed to decrypt"); 278 | return; 279 | } 280 | 281 | if (!SteamEncryptedAppTicket.BIsTicketForApp(rgubDecrypted, cubDecrypted, SteamUtils.GetAppID())) { 282 | Debug.Log("Ticket for wrong app id"); 283 | } 284 | 285 | CSteamID steamIDFromTicket; 286 | SteamEncryptedAppTicket.GetTicketSteamID(rgubDecrypted, cubDecrypted, out steamIDFromTicket); 287 | if (steamIDFromTicket != SteamUser.GetSteamID()) { 288 | Debug.Log("Ticket for wrong user"); 289 | } 290 | 291 | uint cubData; 292 | byte[] punSecretData = SteamEncryptedAppTicket.GetUserVariableData(rgubDecrypted, cubDecrypted, out cubData); 293 | if(cubData != sizeof(uint)) { 294 | Debug.Log("Secret data size is wrong."); 295 | } 296 | Debug.Log(punSecretData.Length); 297 | Debug.Log(System.BitConverter.ToUInt32(punSecretData, 0)); 298 | if (System.BitConverter.ToUInt32(punSecretData, 0) != 0x5444) { 299 | Debug.Log("Failed to retrieve secret data"); 300 | return; 301 | } 302 | 303 | Debug.Log("Successfully retrieved Encrypted App Ticket"); 304 | } 305 | } 306 | 307 | void OnGetAuthSessionTicketResponse(GetAuthSessionTicketResponse_t pCallback) { 308 | Debug.Log("[" + GetAuthSessionTicketResponse_t.k_iCallback + " - GetAuthSessionTicketResponse] - " + pCallback.m_hAuthTicket + " -- " + pCallback.m_eResult); 309 | } 310 | 311 | void OnGameWebCallback(GameWebCallback_t pCallback) { 312 | Debug.Log("[" + GameWebCallback_t.k_iCallback + " - GameWebCallback] - " + pCallback.m_szURL); 313 | } 314 | 315 | void OnStoreAuthURLResponse(StoreAuthURLResponse_t pCallback, bool bIOFailure) { 316 | Debug.Log("[" + StoreAuthURLResponse_t.k_iCallback + " - StoreAuthURLResponse] - " + pCallback.m_szURL); 317 | } 318 | 319 | void OnMarketEligibilityResponse(MarketEligibilityResponse_t pCallback, bool bIOFailure) { 320 | Debug.Log("[" + MarketEligibilityResponse_t.k_iCallback + " - MarketEligibilityResponse] - " + pCallback.m_bAllowed + " -- " + pCallback.m_eNotAllowedReason + " -- " + pCallback.m_rtAllowedAtTime + " -- " + pCallback.m_cdaySteamGuardRequiredDays + " -- " + pCallback.m_cdayNewDeviceCooldown); 321 | } 322 | 323 | void OnDurationControl(DurationControl_t pCallback, bool bIOFailure) { 324 | Debug.Log("[" + DurationControl_t.k_iCallback + " - DurationControl] - " + pCallback.m_eResult + " -- " + pCallback.m_appid + " -- " + pCallback.m_bApplicable + " -- " + pCallback.m_csecsLast5h + " -- " + pCallback.m_progress + " -- " + pCallback.m_notification + " -- " + pCallback.m_csecsToday + " -- " + pCallback.m_csecsRemaining); 325 | } 326 | 327 | void OnGetTicketForWebApiResponse(GetTicketForWebApiResponse_t pCallback) { 328 | Debug.Log("[" + GetTicketForWebApiResponse_t.k_iCallback + " - GetTicketForWebApiResponse] - " + pCallback.m_hAuthTicket + " -- " + pCallback.m_eResult + " -- " + pCallback.m_cubTicket + " -- " + pCallback.m_rgubTicket); 329 | } 330 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamUserTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 809c5a14096672542800f01536584ca7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamUtilsTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamUtilsTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | private Texture2D m_Image; 8 | private string m_FilterTextInputMessage; 9 | private bool m_GameLauncherMode; 10 | 11 | protected Callback m_IPCountry; 12 | protected Callback m_LowBatteryPower; 13 | //protected Callback m_SteamAPICallCompleted; 14 | protected Callback m_SteamShutdown; 15 | protected Callback m_GamepadTextInputDismissed; 16 | protected Callback m_AppResumingFromSuspend; 17 | protected Callback m_FloatingGamepadTextInputDismissed; 18 | protected Callback m_FilterTextDictionaryChanged; 19 | 20 | private CallResult OnCheckFileSignatureCallResult; 21 | 22 | public void OnEnable() { 23 | m_FilterTextInputMessage = "test, fuck, sorry"; 24 | 25 | m_IPCountry = Callback.Create(OnIPCountry); 26 | m_LowBatteryPower = Callback.Create(OnLowBatteryPower); 27 | //m_SteamAPICallCompleted = Callback.Create(OnSteamAPICallCompleted); // N/A - Far too spammy to test like this! 28 | m_SteamShutdown = Callback.Create(OnSteamShutdown); 29 | m_GamepadTextInputDismissed = Callback.Create(OnGamepadTextInputDismissed); 30 | m_AppResumingFromSuspend = Callback.Create(OnAppResumingFromSuspend); 31 | m_FloatingGamepadTextInputDismissed = Callback.Create(OnFloatingGamepadTextInputDismissed); 32 | m_FilterTextDictionaryChanged = Callback.Create(OnFilterTextDictionaryChanged); 33 | 34 | OnCheckFileSignatureCallResult = CallResult.Create(OnCheckFileSignature); 35 | } 36 | 37 | public static Texture2D GetSteamImageAsTexture2D(int iImage) { 38 | Texture2D ret = null; 39 | uint ImageWidth; 40 | uint ImageHeight; 41 | bool bIsValid = SteamUtils.GetImageSize(iImage, out ImageWidth, out ImageHeight); 42 | 43 | if (bIsValid) { 44 | byte[] Image = new byte[ImageWidth * ImageHeight * 4]; 45 | 46 | bIsValid = SteamUtils.GetImageRGBA(iImage, Image, (int)(ImageWidth * ImageHeight * 4)); 47 | if (bIsValid) { 48 | ret = new Texture2D((int)ImageWidth, (int)ImageHeight, TextureFormat.RGBA32, false, true); 49 | ret.LoadRawTextureData(Image); 50 | ret.Apply(); 51 | } 52 | } 53 | 54 | return ret; 55 | } 56 | 57 | public void RenderOnGUI() { 58 | GUILayout.BeginArea(new Rect(Screen.width - 200, 0, 200, Screen.height)); 59 | GUILayout.Label("Variables:"); 60 | GUILayout.Label("m_Image:"); 61 | GUILayout.Label(m_Image); 62 | GUILayout.Label("m_FilterTextInputMessage:"); 63 | m_FilterTextInputMessage = GUILayout.TextField(m_FilterTextInputMessage, 40); 64 | GUILayout.Label("m_GameLauncherMode:"); 65 | m_GameLauncherMode = false; 66 | GUILayout.EndArea(); 67 | 68 | GUILayout.BeginVertical("box"); 69 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 70 | 71 | GUILayout.Label("GetSecondsSinceAppActive() : " + SteamUtils.GetSecondsSinceAppActive()); 72 | 73 | GUILayout.Label("GetSecondsSinceComputerActive() : " + SteamUtils.GetSecondsSinceComputerActive()); 74 | 75 | GUILayout.Label("GetConnectedUniverse() : " + SteamUtils.GetConnectedUniverse()); 76 | 77 | GUILayout.Label("GetServerRealTime() : " + SteamUtils.GetServerRealTime()); 78 | 79 | GUILayout.Label("GetIPCountry() : " + SteamUtils.GetIPCountry()); 80 | 81 | { 82 | uint ImageWidth = 0; 83 | uint ImageHeight = 0; 84 | bool ret = SteamUtils.GetImageSize(1, out ImageWidth, out ImageHeight); 85 | GUILayout.Label("SteamUtils.GetImageSize(1, out ImageWidth, out ImageHeight) : " + ret + " -- " + ImageWidth + " -- " + ImageHeight); 86 | 87 | if (GUILayout.Button("SteamUtils.GetImageRGBA(1, Image, (int)(ImageWidth * ImageHeight * 4)")) { 88 | if (ImageWidth > 0 && ImageHeight > 0) { 89 | byte[] Image = new byte[ImageWidth * ImageHeight * 4]; 90 | ret = SteamUtils.GetImageRGBA(1, Image, (int)(ImageWidth * ImageHeight * 4)); 91 | print("SteamUtils.GetImageRGBA(1, " + Image + ", " + (int)(ImageWidth * ImageHeight * 4) + ") - " + ret + " -- " + ImageWidth + " -- " + ImageHeight); 92 | if (ret) { 93 | m_Image = new Texture2D((int)ImageWidth, (int)ImageHeight, TextureFormat.RGBA32, false, true); 94 | m_Image.LoadRawTextureData(Image); 95 | m_Image.Apply(); 96 | } 97 | } 98 | } 99 | } 100 | 101 | GUILayout.Label("GetCurrentBatteryPower() : " + SteamUtils.GetCurrentBatteryPower()); 102 | 103 | GUILayout.Label("GetAppID() : " + SteamUtils.GetAppID()); 104 | 105 | if (GUILayout.Button("SetOverlayNotificationPosition(ENotificationPosition.k_EPositionTopRight)")) { 106 | SteamUtils.SetOverlayNotificationPosition(ENotificationPosition.k_EPositionTopRight); 107 | print("SteamUtils.SetOverlayNotificationPosition(" + ENotificationPosition.k_EPositionTopRight + ")"); 108 | } 109 | 110 | //GUILayout.Label("SteamUtils.IsAPICallCompleted() : " + SteamUtils.IsAPICallCompleted()); // N/A - These 3 functions are used to dispatch CallResults. 111 | 112 | //GUILayout.Label("SteamUtils.GetAPICallFailureReason() : " + SteamUtils.GetAPICallFailureReason()); // N/A 113 | 114 | //GUILayout.Label("SteamUtils.GetAPICallResult() : " + SteamUtils.GetAPICallResult()); // N/A 115 | 116 | GUILayout.Label("GetIPCCallCount() : " + SteamUtils.GetIPCCallCount()); 117 | 118 | //GUILayout.Label("SteamUtils.SetWarningMessageHook() : " + SteamUtils.SetWarningMessageHook()); // N/A - Check out SteamTest.cs for example usage. 119 | 120 | GUILayout.Label("IsOverlayEnabled() : " + SteamUtils.IsOverlayEnabled()); 121 | 122 | GUILayout.Label("BOverlayNeedsPresent() : " + SteamUtils.BOverlayNeedsPresent()); 123 | 124 | if (GUILayout.Button("CheckFileSignature(\"FileNotFound.txt\")")) { 125 | SteamAPICall_t handle = SteamUtils.CheckFileSignature("FileNotFound.txt"); 126 | OnCheckFileSignatureCallResult.Set(handle); 127 | print("SteamUtils.CheckFileSignature(" + "\"FileNotFound.txt\"" + ") : " + handle); 128 | } 129 | 130 | if (GUILayout.Button("ShowGamepadTextInput(EGamepadTextInputMode.k_EGamepadTextInputModeNormal, EGamepadTextInputLineMode.k_EGamepadTextInputLineModeSingleLine, \"Description Test!\", 32, \"test\")")) { 131 | bool ret = SteamUtils.ShowGamepadTextInput(EGamepadTextInputMode.k_EGamepadTextInputModeNormal, EGamepadTextInputLineMode.k_EGamepadTextInputLineModeSingleLine, "Description Test!", 32, "test"); 132 | print("SteamUtils.ShowGamepadTextInput(" + EGamepadTextInputMode.k_EGamepadTextInputModeNormal + ", " + EGamepadTextInputLineMode.k_EGamepadTextInputLineModeSingleLine + ", " + "\"Description Test!\"" + ", " + 32 + ", " + "\"test\"" + ") : " + ret); 133 | } 134 | 135 | // Only called from within GamepadTextInputDismissed_t Callback! 136 | /*GUILayout.Label("SteamUtils.GetEnteredGamepadTextLength() : " + SteamUtils.GetEnteredGamepadTextLength()); 137 | 138 | { 139 | string Text; 140 | bool ret = SteamUtils.GetEnteredGamepadTextInput(out Text, 32); 141 | GUILayout.Label("SteamUtils.GetEnteredGamepadTextInput(out Text, 32) - " + ret + " -- " + Text); 142 | }*/ 143 | 144 | GUILayout.Label("GetSteamUILanguage() : " + SteamUtils.GetSteamUILanguage()); 145 | 146 | GUILayout.Label("IsSteamRunningInVR() : " + SteamUtils.IsSteamRunningInVR()); 147 | 148 | if (GUILayout.Button("SetOverlayNotificationInset(400, 400)")) { 149 | SteamUtils.SetOverlayNotificationInset(400, 400); 150 | print("SteamUtils.SetOverlayNotificationInset(" + 400 + ", " + 400 + ")"); 151 | } 152 | 153 | GUILayout.Label("IsSteamInBigPictureMode() : " + SteamUtils.IsSteamInBigPictureMode()); 154 | 155 | if (GUILayout.Button("StartVRDashboard()")) { 156 | SteamUtils.StartVRDashboard(); 157 | print("SteamUtils.StartVRDashboard()"); 158 | } 159 | 160 | GUILayout.Label("IsVRHeadsetStreamingEnabled() : " + SteamUtils.IsVRHeadsetStreamingEnabled()); 161 | 162 | if (GUILayout.Button("SetVRHeadsetStreamingEnabled(!SteamUtils.IsVRHeadsetStreamingEnabled())")) { 163 | SteamUtils.SetVRHeadsetStreamingEnabled(!SteamUtils.IsVRHeadsetStreamingEnabled()); 164 | print("SteamUtils.SetVRHeadsetStreamingEnabled(" + !SteamUtils.IsVRHeadsetStreamingEnabled() + ")"); 165 | } 166 | 167 | GUILayout.Label("IsSteamChinaLauncher() : " + SteamUtils.IsSteamChinaLauncher()); 168 | 169 | if (GUILayout.Button("InitFilterText()")) { 170 | bool ret = SteamUtils.InitFilterText(); 171 | print("SteamUtils.InitFilterText() : " + ret); 172 | } 173 | 174 | //SteamUtils.FilterText() // Should be called inside a chat callback! 175 | 176 | if (GUILayout.Button("GetIPv6ConnectivityState(ESteamIPv6ConnectivityProtocol.k_ESteamIPv6ConnectivityProtocol_HTTP)")) { 177 | ESteamIPv6ConnectivityState ret = SteamUtils.GetIPv6ConnectivityState(ESteamIPv6ConnectivityProtocol.k_ESteamIPv6ConnectivityProtocol_HTTP); 178 | print("SteamUtils.GetIPv6ConnectivityState(" + ESteamIPv6ConnectivityProtocol.k_ESteamIPv6ConnectivityProtocol_HTTP + ") : " + ret); 179 | } 180 | 181 | GUILayout.Label("IsSteamRunningOnSteamDeck() : " + SteamUtils.IsSteamRunningOnSteamDeck()); 182 | 183 | if (GUILayout.Button("ShowFloatingGamepadTextInput(EFloatingGamepadTextInputMode.k_EFloatingGamepadTextInputModeModeSingleLine, 0, 0, 0, 0)")) { 184 | bool ret = SteamUtils.ShowFloatingGamepadTextInput(EFloatingGamepadTextInputMode.k_EFloatingGamepadTextInputModeModeSingleLine, 0, 0, 0, 0); 185 | print("SteamUtils.ShowFloatingGamepadTextInput(" + EFloatingGamepadTextInputMode.k_EFloatingGamepadTextInputModeModeSingleLine + ", " + 0 + ", " + 0 + ", " + 0 + ", " + 0 + ") : " + ret); 186 | } 187 | 188 | if (GUILayout.Button("SetGameLauncherMode(!m_GameLauncherMode)")) { 189 | SteamUtils.SetGameLauncherMode(!m_GameLauncherMode); 190 | print("SteamUtils.SetGameLauncherMode(" + !m_GameLauncherMode + ")"); 191 | m_GameLauncherMode = !m_GameLauncherMode; 192 | } 193 | 194 | if (GUILayout.Button("DismissFloatingGamepadTextInput()")) { 195 | bool ret = SteamUtils.DismissFloatingGamepadTextInput(); 196 | print("SteamUtils.DismissFloatingGamepadTextInput() : " + ret); 197 | } 198 | 199 | if (GUILayout.Button("DismissGamepadTextInput()")) { 200 | bool ret = SteamUtils.DismissGamepadTextInput(); 201 | print("SteamUtils.DismissGamepadTextInput() : " + ret); 202 | } 203 | 204 | GUILayout.EndScrollView(); 205 | GUILayout.EndVertical(); 206 | } 207 | 208 | void OnIPCountry(IPCountry_t pCallback) { 209 | Debug.Log("[" + IPCountry_t.k_iCallback + " - IPCountry]"); 210 | } 211 | 212 | void OnLowBatteryPower(LowBatteryPower_t pCallback) { 213 | Debug.Log("[" + LowBatteryPower_t.k_iCallback + " - LowBatteryPower] - " + pCallback.m_nMinutesBatteryLeft); 214 | } 215 | 216 | //void OnSteamAPICallCompleted(SteamAPICallCompleted_t pCallback) { 217 | // Debug.Log("[" + SteamAPICallCompleted_t.k_iCallback + " - SteamAPICallCompleted] - " + pCallback.m_hAsyncCall + " -- " + pCallback.m_iCallback + " -- " + pCallback.m_cubParam); 218 | //} 219 | 220 | void OnSteamShutdown(SteamShutdown_t pCallback) { 221 | Debug.Log("[" + SteamShutdown_t.k_iCallback + " - SteamShutdown]"); 222 | } 223 | 224 | void OnCheckFileSignature(CheckFileSignature_t pCallback, bool bIOFailure) { 225 | Debug.Log("[" + CheckFileSignature_t.k_iCallback + " - CheckFileSignature] - " + pCallback.m_eCheckFileSignature); 226 | } 227 | 228 | void OnGamepadTextInputDismissed(GamepadTextInputDismissed_t pCallback) { 229 | Debug.Log("[" + GamepadTextInputDismissed_t.k_iCallback + " - GamepadTextInputDismissed] - " + pCallback.m_bSubmitted + " -- " + pCallback.m_unSubmittedText + " -- " + pCallback.m_unAppID); 230 | 231 | if(pCallback.m_bSubmitted) { 232 | uint Length = SteamUtils.GetEnteredGamepadTextLength(); 233 | Debug.Log("SteamUtils.GetEnteredGamepadTextLength() - " + Length); 234 | 235 | string Text; 236 | bool ret = SteamUtils.GetEnteredGamepadTextInput(out Text, pCallback.m_unSubmittedText + 1); 237 | Debug.Log("SteamUtils.GetEnteredGamepadTextInput(out Text, pCallback.m_unSubmittedText + 1) - " + ret + " -- " + Text); 238 | } 239 | } 240 | 241 | void OnAppResumingFromSuspend(AppResumingFromSuspend_t pCallback) { 242 | Debug.Log("[" + AppResumingFromSuspend_t.k_iCallback + " - AppResumingFromSuspend]"); 243 | } 244 | 245 | void OnFloatingGamepadTextInputDismissed(FloatingGamepadTextInputDismissed_t pCallback) { 246 | Debug.Log("[" + FloatingGamepadTextInputDismissed_t.k_iCallback + " - FloatingGamepadTextInputDismissed]"); 247 | } 248 | 249 | void OnFilterTextDictionaryChanged(FilterTextDictionaryChanged_t pCallback) { 250 | Debug.Log("[" + FilterTextDictionaryChanged_t.k_iCallback + " - FilterTextDictionaryChanged] - " + pCallback.m_eLanguage); 251 | } 252 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamUtilsTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d8e17f0171590f4d8d4d684a632875c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/SteamVideoTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using Steamworks; 4 | 5 | public class SteamVideoTest : MonoBehaviour { 6 | private Vector2 m_ScrollPos; 7 | 8 | protected Callback m_GetVideoURLResult; 9 | protected Callback m_GetOPFSettingsResult; 10 | 11 | public void OnEnable() { 12 | m_GetVideoURLResult = Callback.Create(OnGetVideoURLResult); 13 | m_GetOPFSettingsResult = Callback.Create(OnGetOPFSettingsResult); 14 | } 15 | 16 | public void RenderOnGUI() { 17 | GUILayout.BeginVertical("box"); 18 | m_ScrollPos = GUILayout.BeginScrollView(m_ScrollPos, GUILayout.Width(Screen.width - 215), GUILayout.Height(Screen.height - 33)); 19 | 20 | if (GUILayout.Button("GetVideoURL(TestConstants.Instance.k_AppId_FreeToPlay)")) { 21 | SteamVideo.GetVideoURL(TestConstants.Instance.k_AppId_FreeToPlay); 22 | print("SteamVideo.GetVideoURL(" + TestConstants.Instance.k_AppId_FreeToPlay + ")"); 23 | } 24 | 25 | { 26 | int NumViewers; 27 | bool ret = SteamVideo.IsBroadcasting(out NumViewers); 28 | GUILayout.Label("IsBroadcasting(out NumViewers) : " + ret + " -- " + NumViewers); 29 | } 30 | 31 | if (GUILayout.Button("GetOPFSettings(TestConstants.Instance.k_AppId_FreeToPlay)")) { 32 | SteamVideo.GetOPFSettings(TestConstants.Instance.k_AppId_FreeToPlay); 33 | print("SteamVideo.GetOPFSettings(" + TestConstants.Instance.k_AppId_FreeToPlay + ")"); 34 | } 35 | 36 | if (GUILayout.Button("GetOPFStringForApp(TestConstants.Instance.k_AppId_FreeToPlay, out Buffer, ref ValueBufferSize)")) { 37 | string Buffer; 38 | int ValueBufferSize = 0; 39 | bool ret = SteamVideo.GetOPFStringForApp(TestConstants.Instance.k_AppId_FreeToPlay, out Buffer, ref ValueBufferSize); 40 | if(ret) { 41 | ret = SteamVideo.GetOPFStringForApp(TestConstants.Instance.k_AppId_FreeToPlay, out Buffer, ref ValueBufferSize); 42 | } 43 | print("SteamVideo.GetOPFStringForApp(" + TestConstants.Instance.k_AppId_FreeToPlay + ", " + "out Buffer" + ", " + "ref ValueBufferSize" + ") : " + ret + " -- " + Buffer + " -- " + ValueBufferSize); 44 | } 45 | 46 | GUILayout.EndScrollView(); 47 | GUILayout.EndVertical(); 48 | } 49 | 50 | void OnGetVideoURLResult(GetVideoURLResult_t pCallback) { 51 | Debug.Log("[" + GetVideoURLResult_t.k_iCallback + " - GetVideoURLResult] - " + pCallback.m_eResult + " -- " + pCallback.m_unVideoAppID + " -- " + pCallback.m_rgchURL); 52 | } 53 | 54 | void OnGetOPFSettingsResult(GetOPFSettingsResult_t pCallback) { 55 | Debug.Log("[" + GetOPFSettingsResult_t.k_iCallback + " - GetOPFSettingsResult] - " + pCallback.m_eResult + " -- " + pCallback.m_unVideoAppID); 56 | } 57 | } -------------------------------------------------------------------------------- /Assets/Scripts/SteamVideoTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f144cf7d7368c4a4b9e5a4c7b3e95ec4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/TestConstants.cs: -------------------------------------------------------------------------------- 1 | using Steamworks; 2 | 3 | public class TestConstants { 4 | public readonly CSteamID k_SteamId_Group_SteamUniverse = new CSteamID(103582791434672565); 5 | public readonly CSteamID k_SteamId_rlabrecque = new CSteamID(76561197991230424); 6 | public readonly AppId_t k_AppId_TeamFortress2 = new AppId_t(440); 7 | public readonly AppId_t k_AppId_PieterwTestDLC = new AppId_t(110902); 8 | public readonly AppId_t k_AppId_FreeToPlay = new AppId_t(343450); 9 | public readonly PublishedFileId_t k_PublishedFileId_Champions = new PublishedFileId_t(280762427); 10 | public readonly SteamIPAddress_t k_IpAddress127_0_0_1 = new SteamIPAddress_t(System.Net.IPAddress.Parse("127.0.0.1")); 11 | public const uint k_IpAddress127_0_0_1_uint = 2130706433; 12 | public readonly SteamIPAddress_t k_IpAddress208_78_165_233 = new SteamIPAddress_t(System.Net.IPAddress.Parse("208.78.165.233")); // Valve Matchmaking Server (Virginia iad-3/srcds150 #51) 13 | public const uint k_IpAddress208_78_165_233_uint = 3494815209; // Valve Matchmaking Server (Virginia iad-3/srcds150 #51) 14 | public const ushort k_Port27015 = 27015; 15 | 16 | private static TestConstants _instance; 17 | 18 | private TestConstants() { } 19 | 20 | public static TestConstants Instance { 21 | get { 22 | if (_instance == null) { 23 | _instance = new TestConstants(); 24 | } 25 | return _instance; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Scripts/TestConstants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b56a660cd1b9d841a61ae18e8236a25 3 | timeCreated: 1489983714 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | NOTE: THIS LICENSE APPLIES TO THE TEST CODE ONLY. 2 | Steamworks.NET itself has a seperate license. 3 | ================================================= 4 | 5 | This is free and unencumbered software released into the public domain. 6 | 7 | Anyone is free to copy, modify, publish, use, compile, sell, or 8 | distribute this software, either in source code form or as a compiled 9 | binary, for any purpose, commercial or non-commercial, and by any 10 | means. 11 | 12 | In jurisdictions that recognize copyright laws, the author or authors 13 | of this software dedicate any and all copyright interest in the 14 | software to the public domain. We make this dedication for the benefit 15 | of the public at large and to the detriment of our heirs and 16 | successors. We intend this dedication to be an overt act of 17 | relinquishment in perpetuity of all present and future rights to this 18 | software under copyright law. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 24 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 25 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | OTHER DEALINGS IN THE SOFTWARE. 27 | 28 | For more information, please refer to 29 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.rlabrecque.steamworks.net": "https://github.com/rlabrecque/Steamworks.NET.git?path=/com.rlabrecque.steamworks.net", 4 | "com.unity.ide.rider": "3.0.12", 5 | "com.unity.ide.visualstudio": "2.0.15", 6 | "com.unity.ide.vscode": "1.2.5", 7 | "com.unity.modules.ai": "1.0.0", 8 | "com.unity.modules.androidjni": "1.0.0", 9 | "com.unity.modules.animation": "1.0.0", 10 | "com.unity.modules.assetbundle": "1.0.0", 11 | "com.unity.modules.audio": "1.0.0", 12 | "com.unity.modules.cloth": "1.0.0", 13 | "com.unity.modules.director": "1.0.0", 14 | "com.unity.modules.imageconversion": "1.0.0", 15 | "com.unity.modules.imgui": "1.0.0", 16 | "com.unity.modules.jsonserialize": "1.0.0", 17 | "com.unity.modules.particlesystem": "1.0.0", 18 | "com.unity.modules.physics": "1.0.0", 19 | "com.unity.modules.physics2d": "1.0.0", 20 | "com.unity.modules.screencapture": "1.0.0", 21 | "com.unity.modules.terrain": "1.0.0", 22 | "com.unity.modules.terrainphysics": "1.0.0", 23 | "com.unity.modules.tilemap": "1.0.0", 24 | "com.unity.modules.ui": "1.0.0", 25 | "com.unity.modules.uielements": "1.0.0", 26 | "com.unity.modules.umbra": "1.0.0", 27 | "com.unity.modules.unityanalytics": "1.0.0", 28 | "com.unity.modules.unitywebrequest": "1.0.0", 29 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 30 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 31 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 32 | "com.unity.modules.unitywebrequestwww": "1.0.0", 33 | "com.unity.modules.vehicles": "1.0.0", 34 | "com.unity.modules.video": "1.0.0", 35 | "com.unity.modules.vr": "1.0.0", 36 | "com.unity.modules.wind": "1.0.0", 37 | "com.unity.modules.xr": "1.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.rlabrecque.steamworks.net": { 4 | "version": "https://github.com/rlabrecque/Steamworks.NET.git?path=/com.rlabrecque.steamworks.net", 5 | "depth": 0, 6 | "source": "git", 7 | "dependencies": {}, 8 | "hash": "4a54dc77a56fa37f195e5344422cff30a2805f3c" 9 | }, 10 | "com.unity.ext.nunit": { 11 | "version": "1.0.6", 12 | "depth": 1, 13 | "source": "registry", 14 | "dependencies": {}, 15 | "url": "https://packages.unity.com" 16 | }, 17 | "com.unity.ide.rider": { 18 | "version": "3.0.12", 19 | "depth": 0, 20 | "source": "registry", 21 | "dependencies": { 22 | "com.unity.ext.nunit": "1.0.6" 23 | }, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.ide.visualstudio": { 27 | "version": "2.0.15", 28 | "depth": 0, 29 | "source": "registry", 30 | "dependencies": { 31 | "com.unity.test-framework": "1.1.9" 32 | }, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.ide.vscode": { 36 | "version": "1.2.5", 37 | "depth": 0, 38 | "source": "registry", 39 | "dependencies": {}, 40 | "url": "https://packages.unity.com" 41 | }, 42 | "com.unity.test-framework": { 43 | "version": "1.1.31", 44 | "depth": 1, 45 | "source": "registry", 46 | "dependencies": { 47 | "com.unity.ext.nunit": "1.0.6", 48 | "com.unity.modules.imgui": "1.0.0", 49 | "com.unity.modules.jsonserialize": "1.0.0" 50 | }, 51 | "url": "https://packages.unity.com" 52 | }, 53 | "com.unity.modules.ai": { 54 | "version": "1.0.0", 55 | "depth": 0, 56 | "source": "builtin", 57 | "dependencies": {} 58 | }, 59 | "com.unity.modules.androidjni": { 60 | "version": "1.0.0", 61 | "depth": 0, 62 | "source": "builtin", 63 | "dependencies": {} 64 | }, 65 | "com.unity.modules.animation": { 66 | "version": "1.0.0", 67 | "depth": 0, 68 | "source": "builtin", 69 | "dependencies": {} 70 | }, 71 | "com.unity.modules.assetbundle": { 72 | "version": "1.0.0", 73 | "depth": 0, 74 | "source": "builtin", 75 | "dependencies": {} 76 | }, 77 | "com.unity.modules.audio": { 78 | "version": "1.0.0", 79 | "depth": 0, 80 | "source": "builtin", 81 | "dependencies": {} 82 | }, 83 | "com.unity.modules.cloth": { 84 | "version": "1.0.0", 85 | "depth": 0, 86 | "source": "builtin", 87 | "dependencies": { 88 | "com.unity.modules.physics": "1.0.0" 89 | } 90 | }, 91 | "com.unity.modules.director": { 92 | "version": "1.0.0", 93 | "depth": 0, 94 | "source": "builtin", 95 | "dependencies": { 96 | "com.unity.modules.audio": "1.0.0", 97 | "com.unity.modules.animation": "1.0.0" 98 | } 99 | }, 100 | "com.unity.modules.imageconversion": { 101 | "version": "1.0.0", 102 | "depth": 0, 103 | "source": "builtin", 104 | "dependencies": {} 105 | }, 106 | "com.unity.modules.imgui": { 107 | "version": "1.0.0", 108 | "depth": 0, 109 | "source": "builtin", 110 | "dependencies": {} 111 | }, 112 | "com.unity.modules.jsonserialize": { 113 | "version": "1.0.0", 114 | "depth": 0, 115 | "source": "builtin", 116 | "dependencies": {} 117 | }, 118 | "com.unity.modules.particlesystem": { 119 | "version": "1.0.0", 120 | "depth": 0, 121 | "source": "builtin", 122 | "dependencies": {} 123 | }, 124 | "com.unity.modules.physics": { 125 | "version": "1.0.0", 126 | "depth": 0, 127 | "source": "builtin", 128 | "dependencies": {} 129 | }, 130 | "com.unity.modules.physics2d": { 131 | "version": "1.0.0", 132 | "depth": 0, 133 | "source": "builtin", 134 | "dependencies": {} 135 | }, 136 | "com.unity.modules.screencapture": { 137 | "version": "1.0.0", 138 | "depth": 0, 139 | "source": "builtin", 140 | "dependencies": { 141 | "com.unity.modules.imageconversion": "1.0.0" 142 | } 143 | }, 144 | "com.unity.modules.subsystems": { 145 | "version": "1.0.0", 146 | "depth": 1, 147 | "source": "builtin", 148 | "dependencies": { 149 | "com.unity.modules.jsonserialize": "1.0.0" 150 | } 151 | }, 152 | "com.unity.modules.terrain": { 153 | "version": "1.0.0", 154 | "depth": 0, 155 | "source": "builtin", 156 | "dependencies": {} 157 | }, 158 | "com.unity.modules.terrainphysics": { 159 | "version": "1.0.0", 160 | "depth": 0, 161 | "source": "builtin", 162 | "dependencies": { 163 | "com.unity.modules.physics": "1.0.0", 164 | "com.unity.modules.terrain": "1.0.0" 165 | } 166 | }, 167 | "com.unity.modules.tilemap": { 168 | "version": "1.0.0", 169 | "depth": 0, 170 | "source": "builtin", 171 | "dependencies": { 172 | "com.unity.modules.physics2d": "1.0.0" 173 | } 174 | }, 175 | "com.unity.modules.ui": { 176 | "version": "1.0.0", 177 | "depth": 0, 178 | "source": "builtin", 179 | "dependencies": {} 180 | }, 181 | "com.unity.modules.uielements": { 182 | "version": "1.0.0", 183 | "depth": 0, 184 | "source": "builtin", 185 | "dependencies": { 186 | "com.unity.modules.imgui": "1.0.0", 187 | "com.unity.modules.jsonserialize": "1.0.0" 188 | } 189 | }, 190 | "com.unity.modules.umbra": { 191 | "version": "1.0.0", 192 | "depth": 0, 193 | "source": "builtin", 194 | "dependencies": {} 195 | }, 196 | "com.unity.modules.unityanalytics": { 197 | "version": "1.0.0", 198 | "depth": 0, 199 | "source": "builtin", 200 | "dependencies": { 201 | "com.unity.modules.unitywebrequest": "1.0.0", 202 | "com.unity.modules.jsonserialize": "1.0.0" 203 | } 204 | }, 205 | "com.unity.modules.unitywebrequest": { 206 | "version": "1.0.0", 207 | "depth": 0, 208 | "source": "builtin", 209 | "dependencies": {} 210 | }, 211 | "com.unity.modules.unitywebrequestassetbundle": { 212 | "version": "1.0.0", 213 | "depth": 0, 214 | "source": "builtin", 215 | "dependencies": { 216 | "com.unity.modules.assetbundle": "1.0.0", 217 | "com.unity.modules.unitywebrequest": "1.0.0" 218 | } 219 | }, 220 | "com.unity.modules.unitywebrequestaudio": { 221 | "version": "1.0.0", 222 | "depth": 0, 223 | "source": "builtin", 224 | "dependencies": { 225 | "com.unity.modules.unitywebrequest": "1.0.0", 226 | "com.unity.modules.audio": "1.0.0" 227 | } 228 | }, 229 | "com.unity.modules.unitywebrequesttexture": { 230 | "version": "1.0.0", 231 | "depth": 0, 232 | "source": "builtin", 233 | "dependencies": { 234 | "com.unity.modules.unitywebrequest": "1.0.0", 235 | "com.unity.modules.imageconversion": "1.0.0" 236 | } 237 | }, 238 | "com.unity.modules.unitywebrequestwww": { 239 | "version": "1.0.0", 240 | "depth": 0, 241 | "source": "builtin", 242 | "dependencies": { 243 | "com.unity.modules.unitywebrequest": "1.0.0", 244 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 245 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 246 | "com.unity.modules.audio": "1.0.0", 247 | "com.unity.modules.assetbundle": "1.0.0", 248 | "com.unity.modules.imageconversion": "1.0.0" 249 | } 250 | }, 251 | "com.unity.modules.vehicles": { 252 | "version": "1.0.0", 253 | "depth": 0, 254 | "source": "builtin", 255 | "dependencies": { 256 | "com.unity.modules.physics": "1.0.0" 257 | } 258 | }, 259 | "com.unity.modules.video": { 260 | "version": "1.0.0", 261 | "depth": 0, 262 | "source": "builtin", 263 | "dependencies": { 264 | "com.unity.modules.audio": "1.0.0", 265 | "com.unity.modules.ui": "1.0.0", 266 | "com.unity.modules.unitywebrequest": "1.0.0" 267 | } 268 | }, 269 | "com.unity.modules.vr": { 270 | "version": "1.0.0", 271 | "depth": 0, 272 | "source": "builtin", 273 | "dependencies": { 274 | "com.unity.modules.jsonserialize": "1.0.0", 275 | "com.unity.modules.physics": "1.0.0", 276 | "com.unity.modules.xr": "1.0.0" 277 | } 278 | }, 279 | "com.unity.modules.wind": { 280 | "version": "1.0.0", 281 | "depth": 0, 282 | "source": "builtin", 283 | "dependencies": {} 284 | }, 285 | "com.unity.modules.xr": { 286 | "version": "1.0.0", 287 | "depth": 0, 288 | "source": "builtin", 289 | "dependencies": { 290 | "com.unity.modules.physics": "1.0.0", 291 | "com.unity.modules.jsonserialize": "1.0.0", 292 | "com.unity.modules.subsystems": "1.0.0" 293 | } 294 | } 295 | } 296 | } 297 | -------------------------------------------------------------------------------- /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 | m_SpeedOfSound: 347 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_DSPBufferSize: 0 12 | m_DisableAudio: 0 13 | -------------------------------------------------------------------------------- /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 | m_Gravity: {x: 0, y: -9.81000042, z: 0} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_BounceThreshold: 2 9 | m_SleepVelocity: .150000006 10 | m_SleepAngularVelocity: .140000001 11 | m_MaxAngularVelocity: 7 12 | m_MinPenetrationForPenalty: .00999999978 13 | m_SolverIterationCount: 6 14 | m_RaycastsHitTriggers: 1 15 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 16 | -------------------------------------------------------------------------------- /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/Scenes/MainScene.unity 10 | - enabled: 1 11 | path: Assets/Scenes/Scene2.unity 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: 1 10 | m_DefaultBehaviorMode: 1 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 4 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | -------------------------------------------------------------------------------- /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: 10753, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | m_LogWhenShaderIsCompiled: 0 64 | -------------------------------------------------------------------------------- /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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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 cmd 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: .00100000005 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: .00100000005 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: .100000001 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: .100000001 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: .100000001 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: .189999998 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: .189999998 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshLayers: 5 | m_ObjectHideFlags: 0 6 | Built-in Layer 0: 7 | name: Default 8 | cost: 1 9 | editType: 2 10 | Built-in Layer 1: 11 | name: Not Walkable 12 | cost: 1 13 | editType: 0 14 | Built-in Layer 2: 15 | name: Jump 16 | cost: 2 17 | editType: 2 18 | User Layer 0: 19 | name: 20 | cost: 1 21 | editType: 3 22 | User Layer 1: 23 | name: 24 | cost: 1 25 | editType: 3 26 | User Layer 2: 27 | name: 28 | cost: 1 29 | editType: 3 30 | User Layer 3: 31 | name: 32 | cost: 1 33 | editType: 3 34 | User Layer 4: 35 | name: 36 | cost: 1 37 | editType: 3 38 | User Layer 5: 39 | name: 40 | cost: 1 41 | editType: 3 42 | User Layer 6: 43 | name: 44 | cost: 1 45 | editType: 3 46 | User Layer 7: 47 | name: 48 | cost: 1 49 | editType: 3 50 | User Layer 8: 51 | name: 52 | cost: 1 53 | editType: 3 54 | User Layer 9: 55 | name: 56 | cost: 1 57 | editType: 3 58 | User Layer 10: 59 | name: 60 | cost: 1 61 | editType: 3 62 | User Layer 11: 63 | name: 64 | cost: 1 65 | editType: 3 66 | User Layer 12: 67 | name: 68 | cost: 1 69 | editType: 3 70 | User Layer 13: 71 | name: 72 | cost: 1 73 | editType: 3 74 | User Layer 14: 75 | name: 76 | cost: 1 77 | editType: 3 78 | User Layer 15: 79 | name: 80 | cost: 1 81 | editType: 3 82 | User Layer 16: 83 | name: 84 | cost: 1 85 | editType: 3 86 | User Layer 17: 87 | name: 88 | cost: 1 89 | editType: 3 90 | User Layer 18: 91 | name: 92 | cost: 1 93 | editType: 3 94 | User Layer 19: 95 | name: 96 | cost: 1 97 | editType: 3 98 | User Layer 20: 99 | name: 100 | cost: 1 101 | editType: 3 102 | User Layer 21: 103 | name: 104 | cost: 1 105 | editType: 3 106 | User Layer 22: 107 | name: 108 | cost: 1 109 | editType: 3 110 | User Layer 23: 111 | name: 112 | cost: 1 113 | editType: 3 114 | User Layer 24: 115 | name: 116 | cost: 1 117 | editType: 3 118 | User Layer 25: 119 | name: 120 | cost: 1 121 | editType: 3 122 | User Layer 26: 123 | name: 124 | cost: 1 125 | editType: 3 126 | User Layer 27: 127 | name: 128 | cost: 1 129 | editType: 3 130 | User Layer 28: 131 | name: 132 | cost: 1 133 | editType: 3 134 | -------------------------------------------------------------------------------- /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/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 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: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /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 | m_Gravity: {x: 0, y: -9.81000042} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_VelocityIterations: 8 9 | m_PositionIterations: 3 10 | m_VelocityThreshold: 1 11 | m_MaxLinearCorrection: .200000003 12 | m_MaxAngularCorrection: 8 13 | m_MaxTranslationSpeed: 100 14 | m_MaxRotationSpeed: 360 15 | m_MinPenetrationForPenalty: .00999999978 16 | m_BaumgarteScale: .200000003 17 | m_BaumgarteTimeOfImpactScale: .75 18 | m_TimeToSleep: .5 19 | m_LinearSleepTolerance: .00999999978 20 | m_AngularSleepTolerance: 2 21 | m_RaycastsHitTriggers: 1 22 | m_RaycastsStartInColliders: 1 23 | m_ChangeStopsCallbacks: 0 24 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.40f1 2 | m_EditorVersionWithRevision: 2019.4.40f1 (ffc62b691db5) 3 | -------------------------------------------------------------------------------- /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: 0 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Default 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: 2 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | m_PerPlatformDefaultQuality: 38 | Android: 0 39 | Standalone: 0 40 | WebGL: 0 41 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | tags: 6 | - 7 | Builtin Layer 0: Default 8 | Builtin Layer 1: TransparentFX 9 | Builtin Layer 2: Ignore Raycast 10 | Builtin Layer 3: 11 | Builtin Layer 4: Water 12 | Builtin Layer 5: UI 13 | Builtin Layer 6: 14 | Builtin Layer 7: 15 | User Layer 8: 16 | User Layer 9: 17 | User Layer 10: 18 | User Layer 11: 19 | User Layer 12: 20 | User Layer 13: 21 | User Layer 14: 22 | User Layer 15: 23 | User Layer 16: 24 | User Layer 17: 25 | User Layer 18: 26 | User Layer 19: 27 | User Layer 20: 28 | User Layer 21: 29 | User Layer 22: 30 | User Layer 23: 31 | User Layer 24: 32 | User Layer 25: 33 | User Layer 26: 34 | User Layer 27: 35 | User Layer 28: 36 | User Layer 29: 37 | User Layer 30: 38 | User Layer 31: 39 | m_SortingLayers: 40 | - name: Default 41 | userID: 0 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: .0199999996 7 | Maximum Allowed Timestep: .333333343 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Steamworks.NET Test 2 | ======= 3 | 4 | This is a sample project for [Steamworks.NET](//github.com/rlabrecque/Steamworks.NET) it is intended to show functionality, act as documentation, and to test the functionality of Steamworks.NET. 5 | The idioms and usage patterns applied here may be flawed (such as the lack of proper error checking.) As such please learn from this project, but take care in implementing any aspects from it. 6 | Check out the [Steamworks.NET Example](//github.com/rlabrecque/Steamworks.NET-Example) project for a more realistic way of implementing Steamworks into your game. 7 | 8 | This sample is available in the public domain (where acceptable.) Please view [LICENSE.txt](LICENSE.txt) for more details. 9 | 10 | This project is usually built using the latest version of Unity. As such it is only expected to build and run out of the box on the version specified in [ProjectVersion.txt](ProjectSettings/ProjectVersion.txt) or newer. 11 | --------------------------------------------------------------------------------