├── ProjectSettings ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── NetworkManager.asset ├── XRSettings.asset ├── TimeManager.asset ├── VFXManager.asset ├── EditorBuildSettings.asset ├── AudioManager.asset ├── TagManager.asset ├── UnityConnectSettings.asset ├── DynamicsManager.asset ├── EditorSettings.asset ├── Physics2DSettings.asset ├── NavMeshAreas.asset ├── GraphicsSettings.asset ├── QualitySettings.asset └── InputManager.asset ├── Assets ├── ParsecUnity │ ├── Experiments │ │ ├── Textures │ │ │ ├── 01XJ7.png │ │ │ └── 01XJ7.png.meta │ │ ├── Announcer - Break the Targets (USA).wav │ │ ├── Largo - J.S. Bach - from Concerto No.mp3 │ │ ├── AudioTest.unity.meta │ │ ├── ParsecTest.unity.meta │ │ ├── InputSystemExp.unity.meta │ │ ├── Textures.meta │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── Blue.mat.meta │ │ │ ├── Red.mat.meta │ │ │ ├── Black.mat.meta │ │ │ ├── Green.mat.meta │ │ │ ├── Magenta.mat.meta │ │ │ ├── Wheel.mat.meta │ │ │ ├── White.mat.meta │ │ │ ├── Black.mat │ │ │ ├── Blue.mat │ │ │ ├── Green.mat │ │ │ ├── Red.mat │ │ │ ├── White.mat │ │ │ ├── Magenta.mat │ │ │ └── Wheel.mat │ │ ├── ParsecAudioSource.cs │ │ ├── ParsecTest.cs.meta │ │ ├── Rotate.cs.meta │ │ ├── AudioSampleTest.cs.meta │ │ ├── MovementDummy.cs.meta │ │ ├── InputListenerTest.cs.meta │ │ ├── InputSystemDummy.cs.meta │ │ ├── ParsecAudioSource.cs.meta │ │ ├── Rotate.cs │ │ ├── Announcer - Break the Targets (USA).wav.meta │ │ ├── Largo - J.S. Bach - from Concerto No.mp3.meta │ │ ├── MovementDummy.cs │ │ ├── InputListenerTest.cs │ │ ├── AudioSampleTest.cs │ │ ├── InputSystemDummy.cs │ │ ├── ParsecTest.cs │ │ ├── InputSystemExp.unity │ │ └── AudioTest.unity │ ├── Input.meta │ ├── Editor.meta │ ├── Parsec.meta │ ├── Experiments.meta │ ├── Parsec │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── ParsecGuestView.prefab.meta │ │ │ └── ParsecGuestView.prefab │ │ ├── Shaders.meta │ │ ├── Shaders │ │ │ ├── ParsecYUVtoRGB.shader.meta │ │ │ └── ParsecYUVtoRGB.shader │ │ ├── ParsecGuestView.cs.meta │ │ ├── ParsecHostInput.cs.meta │ │ ├── UnityNative.cs.meta │ │ ├── ParsecExtensions.cs.meta │ │ ├── ParsecFrameDecoder.cs.meta │ │ ├── ParsecGuestInput.cs.meta │ │ ├── ParsecInputSystemMapping.cs.meta │ │ ├── ParsecUnityController.cs.meta │ │ ├── UnityNative.cs │ │ ├── ParsecGuestView.cs │ │ ├── ParsecExtensions.cs │ │ ├── ParsecFrameDecoder.cs │ │ ├── ParsecGuestInput.cs │ │ ├── ParsecUnityController.cs │ │ ├── ParsecHostInput.cs │ │ └── ParsecInputSystemMapping.cs │ ├── Input │ │ ├── InputDeviceCollection.cs.meta │ │ ├── PlayerInputController.cs.meta │ │ ├── PlayerInputController.cs │ │ └── InputDeviceCollection.cs │ └── Editor │ │ ├── UnityProjectJunctionTool.cs.meta │ │ └── UnityProjectJunctionTool.cs ├── Demo │ ├── Main.unity.meta │ ├── Prefabs │ │ ├── Player.prefab.meta │ │ ├── Projectile.prefab.meta │ │ ├── Projectile.prefab │ │ └── Player.prefab │ ├── Input.meta │ ├── Prefabs.meta │ ├── Scripts.meta │ ├── Materials.meta │ ├── Materials │ │ ├── Beige.mat.meta │ │ ├── Metal.mat.meta │ │ ├── Beige.mat │ │ └── Metal.mat │ ├── Scripts │ │ ├── Game.cs.meta │ │ ├── Menu.cs.meta │ │ ├── Player.cs.meta │ │ ├── RGBPicker.cs.meta │ │ ├── RGBPicker.cs │ │ ├── Game.cs │ │ ├── Menu.cs │ │ └── Player.cs │ └── Input │ │ ├── InputActions.inputactions.meta │ │ └── InputActions.inputactions ├── Demo.meta ├── ParsecUnity.meta └── ParsecUnityLib.meta ├── .gitignore ├── Packages ├── manifest.json └── packages-lock.json └── README.md /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.10f1 2 | m_EditorVersionWithRevision: 2019.4.10f1 (5311b3af6f69) 3 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Textures/01XJ7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronWarrior/ParsecUnity/HEAD/Assets/ParsecUnity/Experiments/Textures/01XJ7.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Announcer - Break the Targets (USA).wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronWarrior/ParsecUnity/HEAD/Assets/ParsecUnity/Experiments/Announcer - Break the Targets (USA).wav -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Largo - J.S. Bach - from Concerto No.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IronWarrior/ParsecUnity/HEAD/Assets/ParsecUnity/Experiments/Largo - J.S. Bach - from Concerto No.mp3 -------------------------------------------------------------------------------- /Assets/Demo/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5f280e4e6724094db94fc5fc3cdb69a 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Assets/Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7676ce7444745f54780f293fe912f5bb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/Player.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbb3b3fc22718e544a92793f7d50e734 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Demo/Input.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ad165398f7e53b478a891846ff643e5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d1d95d3efba88946b6f8deade292572 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/Projectile.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e53408690ee6f5408542efcbec476bb 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bc11e0921125684f9dc96c90dac58c0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc7f2ce2e79e53e4990d7eac3c54100f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 06c7876ce26a1044b8e655eba8db4036 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Input.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efe118dbf186444408ed620730c02afc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnityLib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 095faaf504903d5428cc391117cdc375 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfd165d8c5cf71b48bdcc6987d2ec8f6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/AudioTest.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de511b37a3e1f2d4d875414cdee51d1a 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/ParsecTest.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a9d1ab5f958de84bb020a75ee14063c 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95096cd8746652341a4b55026fc7d504 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 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 | } -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de3666b1e79496742a8505d37b287bb7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/InputSystemExp.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d483e0af1abc7ac45ab91a45d08dd6c8 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64a526dabdecee245a52aecf71bd0d54 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/Prefabs/ParsecGuestView.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7676e802d450ac14a95ef3b10c3dc6e2 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ef176d35757b064989e7039fe9a901d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5262685dd2580c54485ecf823a802e00 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Materials/Beige.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6b06b03fbd34744a9951c50b925514d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Demo/Materials/Metal.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9dadb7a322188404a9903e439d04d762 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c183882e7ff8524d8265d59f980d4c9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Blue.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 115b9ed3806f91545bcd49f46faee1ef 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec2f473c51a70764d8fc998a9dddec51 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Black.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 487a67a9740307a4d976ad7305939f73 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Green.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 651a4461f62810443bf08b90c2f57923 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Magenta.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ae7e79e1340f9a42bfdf15ad179f0aa 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Wheel.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59264ff3089fcf6478541872b3e0ed4b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/White.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 818e9a30e5b370e49a47e4e374627619 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/ParsecAudioSource.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class ParsecAudioSource : MonoBehaviour 4 | { 5 | private void OnAudioFilterRead(float[] data, int channels) 6 | { 7 | ParsecTest.SubmitAudio(data); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/Shaders/ParsecYUVtoRGB.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a29114862c4233a46b7ccdf6fa6438fc 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/Game.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 707bf479ca44bb64f9d3f4ffc93c53e7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/Menu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0b41ae2829857547a37327cfc2fdd30 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/Player.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43a678bebeda15a4e9b9ee7b729b5f1f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/RGBPicker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8089e0bb8ca2ac40a8a6aaf0d01dc37 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/ParsecTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80f76923bb42c4d44a015c80b9a489e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Rotate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba81a877d4c5518468a020c8a3463fdd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecGuestView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 882f8f1ef4bc80e4599cfab684d869c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecHostInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2643237edc68ad34f8bcae64bc10fcc7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/UnityNative.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d5029037f2ad6f4e92a01410c3a480b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/AudioSampleTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2671a9b73a34824d9f4e98a2ac660a4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/MovementDummy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3b2924ae5a318a4fbcf81e790076df8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Input/InputDeviceCollection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddaa542d348f98c4fb045b2fd6ef62df 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Input/PlayerInputController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca791a9420448524cbb982bb6d1e63e9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f63d4b384feda1946b306dac4625f963 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecFrameDecoder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2605357697f9734d9ab8875a759e650 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecGuestInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6b07f40b43df4b469a213b1be304468 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Editor/UnityProjectJunctionTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b997f4dc87ec344186d404510d4bdf5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/InputListenerTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8ef6db92021cc34fb203962720f05b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/InputSystemDummy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d5be48d7d211a84aafdfee1f5a52789 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/ParsecAudioSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f12fe4283e34014b932e87ee570c306 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecInputSystemMapping.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd94625d1e2be1641b3aeb647d0043c4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecUnityController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5491c7573e2c9e1459f815bc4a3b6e5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /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_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/UnityNative.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | public class UnityNative 5 | { 6 | [DllImport("parsec")] 7 | public static extern IntPtr UnityGetRenderEventFunction(); 8 | 9 | [DllImport("parsec", CallingConvention = CallingConvention.Cdecl)] 10 | public static extern void UnitySubmitFrame(IntPtr parsec, IntPtr source); 11 | } 12 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Rotate.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class Rotate : MonoBehaviour 4 | { 5 | public float speed; 6 | 7 | private Vector3 rotation; 8 | 9 | private void Awake() 10 | { 11 | rotation = Random.insideUnitCircle * speed; 12 | } 13 | 14 | private void Update() 15 | { 16 | transform.rotation *= Quaternion.Euler(rotation * Time.deltaTime); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /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/Demo/Main.unity 10 | guid: e5f280e4e6724094db94fc5fc3cdb69a 11 | m_configObjects: 12 | com.unity.input.settings: {fileID: 11400000, guid: cb51f91bb41c81646ab2a5c734491979, 13 | type: 2} 14 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /Assets/Demo/Input/InputActions.inputactions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70fa9a7ec7e50df4d89c87e172309dfa 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} 11 | generateWrapperCode: 0 12 | wrapperCodePath: 13 | wrapperClassName: 14 | wrapperCodeNamespace: 15 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - GuestView 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Announcer - Break the Targets (USA).wav.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 241f9de2886d6194cad93b55a52e0089 3 | AudioImporter: 4 | externalObjects: {} 5 | serializedVersion: 6 6 | defaultSettings: 7 | loadType: 0 8 | sampleRateSetting: 0 9 | sampleRateOverride: 44100 10 | compressionFormat: 1 11 | quality: 1 12 | conversionMode: 0 13 | platformSettingOverrides: {} 14 | forceToMono: 0 15 | normalize: 1 16 | preloadAudioData: 1 17 | loadInBackground: 0 18 | ambisonic: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Largo - J.S. Bach - from Concerto No.mp3.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc10d90437d0e9e46bc50291227d0735 3 | AudioImporter: 4 | externalObjects: {} 5 | serializedVersion: 6 6 | defaultSettings: 7 | loadType: 0 8 | sampleRateSetting: 2 9 | sampleRateOverride: 48000 10 | compressionFormat: 0 11 | quality: 1 12 | conversionMode: 0 13 | platformSettingOverrides: {} 14 | forceToMono: 0 15 | normalize: 1 16 | preloadAudioData: 1 17 | loadInBackground: 0 18 | ambisonic: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/MovementDummy.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class MovementDummy : MonoBehaviour 4 | { 5 | public float speed = 5; 6 | 7 | private void Update() 8 | { 9 | Vector2 moveDirection = Vector2.zero; 10 | 11 | if (Input.GetKey(KeyCode.W)) 12 | moveDirection.y = 1; 13 | 14 | if (Input.GetKey(KeyCode.S)) 15 | moveDirection.y = -1; 16 | 17 | if (Input.GetKey(KeyCode.A)) 18 | moveDirection.x = -1; 19 | 20 | if (Input.GetKey(KeyCode.D)) 21 | moveDirection.x = 1; 22 | 23 | transform.position += (Vector3)moveDirection * speed * Time.deltaTime; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/InputListenerTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.InputSystem.Users; 3 | 4 | public class InputListenerTest : MonoBehaviour 5 | { 6 | private void Start() 7 | { 8 | InputUser.onUnpairedDeviceUsed += InputUser_onUnpairedDeviceUsed; 9 | ++InputUser.listenForUnpairedDeviceActivity; 10 | } 11 | 12 | private void InputUser_onUnpairedDeviceUsed(UnityEngine.InputSystem.InputControl control, UnityEngine.InputSystem.LowLevel.InputEventPtr arg2) 13 | { 14 | Debug.Log($"using device {control.device.name}"); 15 | } 16 | 17 | private void OnDestroy() 18 | { 19 | InputUser.onUnpairedDeviceUsed -= InputUser_onUnpairedDeviceUsed; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecGuestView.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class ParsecGuestView : MonoBehaviour 4 | { 5 | [SerializeField] 6 | Renderer frame; 7 | 8 | private Material material; 9 | 10 | private void Awake() 11 | { 12 | material = new Material(Shader.Find("Parsec/YUV to RGB")); 13 | frame.material = material; 14 | } 15 | 16 | public void Populate(Texture Y, Texture U, Texture V, Vector2 padding, float aspectRatio) 17 | { 18 | material.SetTexture("_Y", Y); 19 | material.SetTexture("_U", U); 20 | material.SetTexture("_V", V); 21 | material.SetVector("_Padding", padding); 22 | 23 | frame.transform.localScale = new Vector3(aspectRatio, 1, 1); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/RGBPicker.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | public class RGBPicker : MonoBehaviour 5 | { 6 | [SerializeField] 7 | Slider r, g, b; 8 | 9 | [SerializeField] 10 | Image preview; 11 | 12 | public Color Color => new Color(r.value, g.value, b.value, 1); 13 | 14 | private void Awake() 15 | { 16 | r.value = Random.value; 17 | g.value = Random.value; 18 | b.value = Random.value; 19 | 20 | r.onValueChanged.AddListener((v) => Set()); 21 | g.onValueChanged.AddListener((v) => Set()); 22 | b.onValueChanged.AddListener((v) => Set()); 23 | 24 | Set(); 25 | } 26 | 27 | private void Set() 28 | { 29 | preview.color = Color; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecExtensions.cs: -------------------------------------------------------------------------------- 1 | using ParsecGaming; 2 | using System; 3 | using System.Runtime.InteropServices; 4 | 5 | public static class ParsecExtensions 6 | { 7 | // Parsec encodes submitted user data from strings into null-terminated UTF-8 bytes. 8 | public static string HostGetUserDataString(this Parsec parsec, uint key) 9 | { 10 | IntPtr ptr = parsec.GetBuffer(key); 11 | 12 | int length = 0; 13 | 14 | while (Marshal.ReadByte(ptr, length) != 0) 15 | ++length; 16 | 17 | byte[] buffer = new byte[length]; 18 | Marshal.Copy(ptr, buffer, 0, buffer.Length); 19 | 20 | string str = System.Text.Encoding.UTF8.GetString(buffer); 21 | 22 | Parsec.Free(ptr); 23 | 24 | return str; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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: 0 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 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/AudioSampleTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class AudioSampleTest : MonoBehaviour 4 | { 5 | public int sampleCount = 960; 6 | public int samplerate = 44100; 7 | public float frequency = 440; 8 | public int position = 0; 9 | 10 | private void Awake() 11 | { 12 | AudioClip clip = AudioClip.Create("MySinusoid", sampleCount, 1, samplerate, true, OnAudioRead, OnAudioSetPosition); 13 | AudioSource source = GetComponent(); 14 | source.clip = clip; 15 | source.loop = true; 16 | source.Play(); 17 | } 18 | 19 | void OnAudioRead(float[] data) 20 | { 21 | Debug.Log(data.Length); 22 | 23 | int count = 0; 24 | while (count < data.Length) 25 | { 26 | data[count] = Mathf.Sin(2 * Mathf.PI * frequency * position / samplerate); 27 | position++; 28 | count++; 29 | } 30 | } 31 | 32 | void OnAudioSetPosition(int newPosition) 33 | { 34 | position = newPosition; 35 | } 36 | 37 | private void OnAudioFilterRead(float[] data, int channels) 38 | { 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /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: 9 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 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;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Input/PlayerInputController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.InputSystem; 3 | 4 | [RequireComponent(typeof(PlayerInput))] 5 | public class PlayerInputController : MonoBehaviour 6 | { 7 | private InputDeviceCollection deviceCollection; 8 | 9 | public void Initialize(InputDeviceCollection deviceCollection) 10 | { 11 | deviceCollection.OnUseUnpairedDevice += DeviceCollection_OnUseUnpairedDevice; 12 | 13 | this.deviceCollection = deviceCollection; 14 | } 15 | 16 | private void DeviceCollection_OnUseUnpairedDevice() 17 | { 18 | var devices = deviceCollection.Devices; 19 | 20 | var playerInput = GetComponent(); 21 | 22 | if (InputControlScheme.FindControlSchemeForDevices(devices, playerInput.actions.controlSchemes, 23 | out _, out var matchResult, mustIncludeDevice: devices[0])) 24 | { 25 | try 26 | { 27 | var array = matchResult.devices.ToArray(); 28 | 29 | Debug.Log($"Switching to devices {string.Join(",", array)}"); 30 | playerInput.SwitchCurrentControlScheme(array); 31 | } 32 | finally 33 | { 34 | matchResult.Dispose(); 35 | } 36 | } 37 | } 38 | 39 | private void OnDestroy() 40 | { 41 | deviceCollection.OnUseUnpairedDevice -= DeviceCollection_OnUseUnpairedDevice; 42 | } 43 | } 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 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Asset meta data should only be ignored when the corresponding asset is also ignored 18 | !/[Aa]ssets/**/*.meta 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.unitypackage 61 | 62 | # Crashlytics generated file 63 | crashlytics-build.properties 64 | 65 | # Packed Addressables 66 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 67 | 68 | # Temporary auto-generated Android Assets 69 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 70 | /[Aa]ssets/[Ss]treamingAssets/aa/* 71 | 72 | # Parsec libraries 73 | *parsec.dll* 74 | *parsec.bundle* 75 | *parsec32.dll* 76 | *ParsecUnity46.dll* 77 | # I keep the libraries in the following directory. 78 | *ParsecUnityLib/ 79 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/Game.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | public class Game : MonoBehaviour 5 | { 6 | [SerializeField] 7 | GameObject playerPrefab; 8 | 9 | private Dictionary playersById; 10 | 11 | private void Awake() 12 | { 13 | playersById = new Dictionary(); 14 | } 15 | 16 | public void Initialize(ParsecUnityController parsecUnityController) 17 | { 18 | gameObject.SetActive(true); 19 | 20 | // Normally you'd likely want a module between Parsec and your Game management code to inject 21 | // players without knowing where they came from, but we'll be lazy here. 22 | parsecUnityController.OnGuestConnected += ParsecUnityController_OnGuestConnected; 23 | parsecUnityController.OnGuestDisconnected += ParsecUnityController_OnGuestDisconnected; 24 | parsecUnityController.OnReceiveUserData += ParsecUnityController_OnReceiveUserData; 25 | } 26 | 27 | public void AddPlayer(int id, InputDeviceCollection deviceCollection) 28 | { 29 | GameObject player = Instantiate(playerPrefab, new Vector3(Random.Range(-3f, 3f), 0, Random.Range(-3f, 3f)), Quaternion.identity); 30 | player.GetComponent().Initialize(deviceCollection); 31 | 32 | playersById[id] = player; 33 | } 34 | 35 | public void SetPlayerColor(int id, Color color) 36 | { 37 | playersById[id].GetComponent().SetColor(color); 38 | } 39 | 40 | private void ParsecUnityController_OnGuestConnected(ParsecGaming.Parsec.ParsecGuest guest, InputDeviceCollection deviceCollection) 41 | { 42 | AddPlayer((int)guest.id, deviceCollection); 43 | } 44 | 45 | private void ParsecUnityController_OnGuestDisconnected(ParsecGaming.Parsec.ParsecGuest guest) 46 | { 47 | Destroy(playersById[(int)guest.id]); 48 | } 49 | 50 | private void ParsecUnityController_OnReceiveUserData(ParsecGaming.Parsec.ParsecGuest guest, string jsonColor) 51 | { 52 | Color color = JsonUtility.FromJson(jsonColor); 53 | SetPlayerColor((int)guest.id, color); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.2d.tilemap": "1.0.0", 5 | "com.unity.ads": "3.4.9", 6 | "com.unity.analytics": "3.3.5", 7 | "com.unity.collab-proxy": "1.2.16", 8 | "com.unity.ide.rider": "1.1.4", 9 | "com.unity.ide.vscode": "1.2.1", 10 | "com.unity.inputsystem": "1.0.0", 11 | "com.unity.multiplayer-hlapi": "1.0.6", 12 | "com.unity.purchasing": "2.1.0", 13 | "com.unity.test-framework": "1.1.16", 14 | "com.unity.textmeshpro": "2.0.1", 15 | "com.unity.timeline": "1.2.6", 16 | "com.unity.ugui": "1.0.0", 17 | "com.unity.xr.legacyinputhelpers": "2.1.4", 18 | "com.unity.modules.ai": "1.0.0", 19 | "com.unity.modules.androidjni": "1.0.0", 20 | "com.unity.modules.animation": "1.0.0", 21 | "com.unity.modules.assetbundle": "1.0.0", 22 | "com.unity.modules.audio": "1.0.0", 23 | "com.unity.modules.cloth": "1.0.0", 24 | "com.unity.modules.director": "1.0.0", 25 | "com.unity.modules.imageconversion": "1.0.0", 26 | "com.unity.modules.imgui": "1.0.0", 27 | "com.unity.modules.jsonserialize": "1.0.0", 28 | "com.unity.modules.particlesystem": "1.0.0", 29 | "com.unity.modules.physics": "1.0.0", 30 | "com.unity.modules.physics2d": "1.0.0", 31 | "com.unity.modules.screencapture": "1.0.0", 32 | "com.unity.modules.terrain": "1.0.0", 33 | "com.unity.modules.terrainphysics": "1.0.0", 34 | "com.unity.modules.tilemap": "1.0.0", 35 | "com.unity.modules.ui": "1.0.0", 36 | "com.unity.modules.uielements": "1.0.0", 37 | "com.unity.modules.umbra": "1.0.0", 38 | "com.unity.modules.unityanalytics": "1.0.0", 39 | "com.unity.modules.unitywebrequest": "1.0.0", 40 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 41 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 42 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 43 | "com.unity.modules.unitywebrequestwww": "1.0.0", 44 | "com.unity.modules.vehicles": "1.0.0", 45 | "com.unity.modules.video": "1.0.0", 46 | "com.unity.modules.vr": "1.0.0", 47 | "com.unity.modules.wind": "1.0.0", 48 | "com.unity.modules.xr": "1.0.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Demo/Scripts/Menu.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | using UnityEngine.InputSystem; 4 | using UnityEngine.UI; 5 | 6 | public class Menu : MonoBehaviour 7 | { 8 | [SerializeField] 9 | GameObject menuContainer; 10 | 11 | [SerializeField] 12 | Button hostButton; 13 | 14 | [SerializeField] 15 | Button connectButton; 16 | 17 | [SerializeField] 18 | InputField sessionIdInput; 19 | 20 | [SerializeField] 21 | InputField peerIdInput; 22 | 23 | [SerializeField] 24 | Text statusText; 25 | 26 | [SerializeField] 27 | RGBPicker rgbPicker; 28 | 29 | [SerializeField] 30 | ParsecUnityController parsecController; 31 | 32 | [SerializeField] 33 | Game game; 34 | 35 | private void Awake() 36 | { 37 | hostButton.onClick.AddListener(Host); 38 | connectButton.onClick.AddListener(Connect); 39 | 40 | statusText.gameObject.SetActive(false); 41 | } 42 | 43 | private void Host() 44 | { 45 | parsecController.Host(sessionIdInput.text); 46 | parsecController.StartHostStreamer(); 47 | 48 | game.Initialize(parsecController); 49 | game.AddPlayer(-1, new InputDeviceCollection(InputSystem.devices.ToArray())); 50 | game.SetPlayerColor(-1, rgbPicker.Color); 51 | 52 | Destroy(gameObject); 53 | } 54 | 55 | private void Connect() 56 | { 57 | StartCoroutine(ConnectRoutine()); 58 | } 59 | 60 | private IEnumerator ConnectRoutine() 61 | { 62 | menuContainer.gameObject.SetActive(false); 63 | statusText.gameObject.SetActive(true); 64 | 65 | parsecController.Connect(sessionIdInput.text, peerIdInput.text); 66 | 67 | ParsecGaming.Parsec.ParsecStatus status; 68 | 69 | do 70 | { 71 | status = parsecController.Parsec.ClientGetStatus(out _); 72 | statusText.text = $"Status: {status}"; 73 | yield return null; 74 | } 75 | while (status != ParsecGaming.Parsec.ParsecStatus.PARSEC_OK); 76 | 77 | parsecController.ClientSendUserData(rgbPicker.Color); 78 | parsecController.StartClientPollFrames(); 79 | 80 | Destroy(gameObject); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/Shaders/ParsecYUVtoRGB.shader: -------------------------------------------------------------------------------- 1 | Shader "Parsec/YUV to RGB" 2 | { 3 | Properties 4 | { 5 | [HideInInspector] 6 | _Y("Texture", 2D) = "grey" {} 7 | [HideInInspector] 8 | _U("Texture", 2D) = "grey" {} 9 | [HideInInspector] 10 | _V("Texture", 2D) = "grey" {} 11 | [HideInInspector] 12 | _Padding("Padding", Vector) = (1,1,0,0) 13 | } 14 | SubShader 15 | { 16 | Pass 17 | { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | 22 | struct appdata 23 | { 24 | float4 vertex : POSITION; 25 | float2 uv : TEXCOORD0; 26 | }; 27 | 28 | struct v2f 29 | { 30 | float2 uv : TEXCOORD0; 31 | float4 vertex : SV_POSITION; 32 | }; 33 | 34 | v2f vert (appdata v) 35 | { 36 | v2f o; 37 | o.vertex = UnityObjectToClipPos(v.vertex); 38 | o.uv = v.uv; 39 | return o; 40 | } 41 | 42 | // Conversion function from: https://stackoverflow.com/a/54334776 43 | float3 YUVtoRGB(float3 yuv) 44 | { 45 | float3 rgb; 46 | 47 | rgb.r = yuv.x + yuv.z * 1.13983; 48 | rgb.g = yuv.x + dot(fixed2(-0.39465, -0.58060), yuv.yz); 49 | rgb.b = yuv.x + yuv.y * 2.03211; 50 | 51 | return rgb; 52 | } 53 | 54 | sampler2D _Y; 55 | sampler2D _U; 56 | sampler2D _V; 57 | float2 _Padding; 58 | 59 | fixed4 frag(v2f i) : SV_Target 60 | { 61 | #if SHADER_API_GLCORE 62 | float2 uv = float2(i.uv.x, 1 - i.uv.y); 63 | #else 64 | float2 uv = i.uv; 65 | #endif 66 | 67 | uv *= _Padding; 68 | 69 | float y = tex2D(_Y, uv).x; 70 | float u = tex2D(_U, uv).x - 0.5; 71 | float v = tex2D(_V, uv).x - 0.5; 72 | 73 | return float4(YUVtoRGB(float3(y, u, v)), 1); 74 | } 75 | ENDCG 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Black.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Black 11 | m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Blue.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Blue 11 | m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Green.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Green 11 | m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 1, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Red.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Red 11 | m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 0, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/White.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: White 11 | m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/Demo/Materials/Beige.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Beige 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.8113208, g: 0.5328699, b: 0.25640798, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Magenta.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Magenta 11 | m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 0, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/Demo/Materials/Metal.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Metal 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.78 65 | - _GlossyReflections: 1 66 | - _Metallic: 0.855 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.1509434, g: 0.1509434, b: 0.1509434, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Materials/Wheel.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Wheel 11 | m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 2800000, guid: 21aae8b454fe2f04ea6e8e7def7cc798, type: 3} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/Textures/01XJ7.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21aae8b454fe2f04ea6e8e7def7cc798 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecFrameDecoder.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using ParsecGaming; 3 | 4 | /// 5 | /// Transforms raw parsec frame data into YUV textures. 6 | /// 7 | public class ParsecFrameDecoder 8 | { 9 | public Texture2D Y { get; private set; } 10 | public Texture2D U { get; private set; } 11 | public Texture2D V { get; private set; } 12 | 13 | public Vector2 Padding { get; private set; } 14 | public float AspectRatio { get; private set; } 15 | 16 | // TODO: I don't know for certain, but this is probably not the most efficient way of 17 | // getting an image to Unity. I'm guessing that ClientPollFrame pulls the texture 18 | // from GPU memory (where it was initially decoded) into system memory, before it is 19 | // passed here. Then, Unity places it back into GPU memory. 20 | public void Decode(Parsec.ParsecFrame frame, System.IntPtr image) 21 | { 22 | if (frame.format != Parsec.ParsecColorFormat.FORMAT_I420) 23 | throw new System.Exception($"Decoder does not currently support {frame.format}. Only {Parsec.ParsecColorFormat.FORMAT_I420} is permitted."); 24 | 25 | // The texture will be built if it does not currently exist. 26 | // Otherwise, only rebuild the texture if the dimensions have changed. 27 | if (Y == null || (Y.width != frame.fullWidth || Y.height != frame.fullHeight)) 28 | { 29 | if (Y != null) 30 | { 31 | Object.Destroy(Y); 32 | Object.Destroy(U); 33 | Object.Destroy(V); 34 | } 35 | 36 | Y = new Texture2D((int)frame.fullWidth, (int)frame.fullHeight, TextureFormat.R8, false, false); 37 | U = new Texture2D((int)frame.fullWidth / 2, (int)frame.fullHeight / 2, TextureFormat.R8, false, false); 38 | V = new Texture2D((int)frame.fullWidth / 2, (int)frame.fullHeight / 2, TextureFormat.R8, false, false); 39 | } 40 | 41 | int yBytes = (int)frame.fullWidth * (int)frame.fullHeight; 42 | int uvBytes = (int)frame.fullWidth / 2 * (int)frame.fullHeight / 2; 43 | 44 | Y.LoadRawTextureData(image, yBytes); 45 | Y.Apply(); 46 | 47 | System.IntPtr uPtr = System.IntPtr.Add(image, yBytes); 48 | U.LoadRawTextureData(uPtr, uvBytes); 49 | U.Apply(); 50 | 51 | System.IntPtr vPtr = System.IntPtr.Add(uPtr, uvBytes); 52 | V.LoadRawTextureData(vPtr, ((int)frame.fullWidth * (int)frame.fullHeight) / 2); 53 | V.Apply(); 54 | 55 | Padding = new Vector2((float)frame.width / frame.fullWidth, (float)frame.height / frame.fullHeight); 56 | AspectRatio = (float)frame.width / (float)frame.height; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /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: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 41 | - {fileID: 4800000, guid: a29114862c4233a46b7ccdf6fa6438fc, type: 3} 42 | m_PreloadedShaders: [] 43 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 44 | type: 0} 45 | m_CustomRenderPipeline: {fileID: 0} 46 | m_TransparencySortMode: 0 47 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 48 | m_DefaultRenderingPath: 1 49 | m_DefaultMobileRenderingPath: 1 50 | m_TierSettings: [] 51 | m_LightmapStripping: 0 52 | m_FogStripping: 0 53 | m_InstancingStripping: 0 54 | m_LightmapKeepPlain: 1 55 | m_LightmapKeepDirCombined: 1 56 | m_LightmapKeepDynamicPlain: 1 57 | m_LightmapKeepDynamicDirCombined: 1 58 | m_LightmapKeepShadowMask: 1 59 | m_LightmapKeepSubtractive: 1 60 | m_FogKeepLinear: 1 61 | m_FogKeepExp: 1 62 | m_FogKeepExp2: 1 63 | m_AlbedoSwatchInfos: [] 64 | m_LightsUseLinearIntensity: 0 65 | m_LightsUseColorTemperature: 0 66 | m_LogWhenShaderIsCompiled: 0 67 | m_AllowEnlightenSupportForUpgradedProject: 1 68 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Input/InputDeviceCollection.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.InputSystem; 2 | using UnityEngine.InputSystem.Users; 3 | using UnityEngine.InputSystem.LowLevel; 4 | using System.Collections.Generic; 5 | using UnityEngine.InputSystem.Controls; 6 | 7 | public class InputDeviceCollection 8 | { 9 | public event System.Action OnUseUnpairedDevice; 10 | public InputDevice[] Devices => devices.ToArray(); 11 | 12 | private readonly List devices; 13 | 14 | public InputDeviceCollection() 15 | { 16 | devices = new List(); 17 | 18 | InputUser.onUnpairedDeviceUsed += OnUnpairedDeviceUsed; 19 | // TODO: Find out why this is an int and not a bool. Line taken from 20 | // PlayerInput.cs. 21 | ++InputUser.listenForUnpairedDeviceActivity; 22 | } 23 | 24 | ~InputDeviceCollection() 25 | { 26 | InputUser.onUnpairedDeviceUsed -= OnUnpairedDeviceUsed; 27 | } 28 | 29 | public InputDeviceCollection(params InputDevice[] devices) : this() 30 | { 31 | for (int i = 0; i < devices.Length; i++) 32 | { 33 | this.devices.Add(devices[i]); 34 | } 35 | } 36 | 37 | private void OnUnpairedDeviceUsed(InputControl control, InputEventPtr eventPtr) 38 | { 39 | // Ignore anything other than button controls (to avoid small mouse movements, 40 | // or mouse position updates switching schemes). 41 | if (!(control is ButtonControl)) 42 | return; 43 | 44 | int indexOfDevice = devices.IndexOf(control.device); 45 | 46 | // Move the device to the front of the list so that it has priority 47 | // if the list is passed into a control scheme. 48 | if (indexOfDevice >= 0) 49 | { 50 | InputDevice temp = devices[0]; 51 | devices[0] = control.device; 52 | devices[indexOfDevice] = temp; 53 | 54 | OnUseUnpairedDevice?.Invoke(); 55 | } 56 | } 57 | 58 | /// 59 | /// Creates a virtual input device of the provided type and adds it this collection. 60 | /// 61 | /// 62 | /// 63 | public T CreateAndAdd() where T : InputDevice 64 | { 65 | T device = InputSystem.AddDevice(); 66 | devices.Add(device); 67 | 68 | return device; 69 | } 70 | 71 | public bool Get(out T device) where T : InputDevice 72 | { 73 | for (int i = 0; i < devices.Count; i++) 74 | { 75 | if (devices[i] is T t) 76 | { 77 | device = t; 78 | return true; 79 | } 80 | } 81 | 82 | device = null; 83 | return false; 84 | } 85 | 86 | public void Free() 87 | { 88 | foreach (var device in devices) 89 | { 90 | InputSystem.RemoveDevice(device); 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /Assets/Demo/Scripts/Player.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.InputSystem; 3 | 4 | public class Player : MonoBehaviour 5 | { 6 | [SerializeField] 7 | Transform turret; 8 | 9 | [SerializeField] 10 | Transform chassis; 11 | 12 | [SerializeField] 13 | float speed = 4; 14 | 15 | [SerializeField] 16 | float acceleration = 60; 17 | 18 | [SerializeField] 19 | float turnSpeed = 180; 20 | 21 | [SerializeField] 22 | Rigidbody projectilePrefab; 23 | 24 | [SerializeField] 25 | float fireSpeed = 10; 26 | 27 | private PlayerInput playerInput; 28 | 29 | private Vector3 velocity; 30 | 31 | private void Awake() 32 | { 33 | playerInput = GetComponent(); 34 | playerInput.actions["Fire"].performed += Fire; 35 | } 36 | 37 | private void Fire(InputAction.CallbackContext obj) 38 | { 39 | Rigidbody projectile = Instantiate(projectilePrefab, turret.transform.position + turret.transform.forward * 0.5f, Quaternion.identity); 40 | projectile.velocity = fireSpeed * turret.transform.forward; 41 | 42 | Destroy(projectile.gameObject, 2f); 43 | } 44 | 45 | private void Update() 46 | { 47 | Vector2 moveInput = playerInput.actions["Move"].ReadValue(); 48 | Vector2 lookDirection = playerInput.actions["LookDirection"].ReadValue(); 49 | Vector2 lookTarget = playerInput.actions["LookTarget"].ReadValue(); 50 | 51 | Vector3 worldMoveInput = Vector3.ClampMagnitude(new Vector3(moveInput.x, 0, moveInput.y), 1); 52 | Vector3 worldLookDirection = new Vector3(lookDirection.x, 0, lookDirection.y); 53 | 54 | velocity = Vector3.MoveTowards(velocity, worldMoveInput * speed, acceleration * Time.deltaTime); 55 | 56 | transform.position += velocity * Time.deltaTime; 57 | 58 | if (moveInput != Vector2.zero) 59 | chassis.rotation = Quaternion.RotateTowards(chassis.rotation, Quaternion.LookRotation(worldMoveInput), turnSpeed * Time.deltaTime); 60 | 61 | if (lookDirection != Vector2.zero) 62 | turret.rotation = Quaternion.RotateTowards(turret.rotation, Quaternion.LookRotation(worldLookDirection), turnSpeed * Time.deltaTime); 63 | 64 | if (lookTarget != Vector2.zero) 65 | { 66 | Ray ray = Camera.main.ScreenPointToRay(lookTarget); 67 | Plane groundPlane = new Plane(Vector3.up, Vector3.zero); 68 | 69 | if (groundPlane.Raycast(ray, out float distance)) 70 | { 71 | Vector3 point = ray.GetPoint(distance); 72 | Vector3 to = point - turret.position; 73 | to.y = 0; 74 | 75 | turret.rotation = Quaternion.RotateTowards(turret.rotation, Quaternion.LookRotation(to), turnSpeed * Time.deltaTime); 76 | } 77 | } 78 | } 79 | 80 | public void SetColor(Color color) 81 | { 82 | foreach (Renderer r in GetComponentsInChildren()) 83 | { 84 | r.material.color = color; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/InputSystemDummy.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.InputSystem; 3 | using UnityEngine.InputSystem.LowLevel; 4 | 5 | public class InputSystemDummy : MonoBehaviour 6 | { 7 | [SerializeField] 8 | int executeFrame = 1; 9 | 10 | [SerializeField] 11 | public bool doA; 12 | 13 | [SerializeField] 14 | public bool doB; 15 | 16 | [Header("Debug")] 17 | public bool pressedA; 18 | public bool pressedB; 19 | 20 | private Keyboard keyboard; 21 | 22 | private void Start() 23 | { 24 | keyboard = InputSystem.AddDevice(); 25 | } 26 | 27 | private void Update() 28 | { 29 | if (Time.frameCount == executeFrame) 30 | { 31 | using (StateEvent.From(keyboard, out InputEventPtr eventPtr)) 32 | { 33 | keyboard[Key.A].WriteValueIntoEvent(1, eventPtr); 34 | keyboard[Key.B].WriteValueIntoEvent(1, eventPtr); 35 | InputSystem.QueueEvent(eventPtr); 36 | } 37 | 38 | //if (doA) 39 | //{ 40 | // using (StateEvent.From(keyboard, out InputEventPtr eventPtr)) 41 | // { 42 | // keyboard[Key.A].WriteValueIntoEvent(1, eventPtr); 43 | // InputSystem.QueueEvent(eventPtr); 44 | // } 45 | //} 46 | 47 | //if (doB) 48 | //{ 49 | // using (StateEvent.From(keyboard, out InputEventPtr eventPtr)) 50 | // { 51 | // keyboard[Key.B].WriteValueIntoEvent(1, eventPtr); 52 | // InputSystem.QueueEvent(eventPtr); 53 | // } 54 | //} 55 | } 56 | else if (Time.frameCount == executeFrame * 2) 57 | { 58 | using (StateEvent.From(keyboard, out InputEventPtr eventPtr)) 59 | { 60 | keyboard[Key.A].WriteValueIntoEvent(0, eventPtr); 61 | keyboard[Key.B].WriteValueIntoEvent(0, eventPtr); 62 | InputSystem.QueueEvent(eventPtr); 63 | } 64 | 65 | //if (doA) 66 | //{ 67 | // using (StateEvent.From(keyboard, out InputEventPtr eventPtr)) 68 | // { 69 | // keyboard[Key.A].WriteValueIntoEvent(0, eventPtr); 70 | // InputSystem.QueueEvent(eventPtr); 71 | // } 72 | //} 73 | 74 | //if (doB) 75 | //{ 76 | // using (StateEvent.From(keyboard, out InputEventPtr eventPtr)) 77 | // { 78 | // keyboard[Key.B].WriteValueIntoEvent(0, eventPtr); 79 | // InputSystem.QueueEvent(eventPtr); 80 | // } 81 | //} 82 | } 83 | 84 | pressedA = keyboard[Key.A].ReadValue() > 0.1f; 85 | pressedB = keyboard[Key.B].ReadValue() > 0.1f; 86 | } 87 | 88 | private void OnDestroy() 89 | { 90 | InputSystem.RemoveDevice(keyboard); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/Projectile.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &6684483183727293226 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 6684483183727293230} 12 | - component: {fileID: 6684483183727293231} 13 | - component: {fileID: 6684483183727293224} 14 | - component: {fileID: 6684483183727293225} 15 | m_Layer: 0 16 | m_Name: Projectile 17 | m_TagString: Untagged 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!4 &6684483183727293230 23 | Transform: 24 | m_ObjectHideFlags: 0 25 | m_CorrespondingSourceObject: {fileID: 0} 26 | m_PrefabInstance: {fileID: 0} 27 | m_PrefabAsset: {fileID: 0} 28 | m_GameObject: {fileID: 6684483183727293226} 29 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 30 | m_LocalPosition: {x: 0, y: 0.5, z: 1.75} 31 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 32 | m_Children: [] 33 | m_Father: {fileID: 0} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | --- !u!33 &6684483183727293231 37 | MeshFilter: 38 | m_ObjectHideFlags: 0 39 | m_CorrespondingSourceObject: {fileID: 0} 40 | m_PrefabInstance: {fileID: 0} 41 | m_PrefabAsset: {fileID: 0} 42 | m_GameObject: {fileID: 6684483183727293226} 43 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 44 | --- !u!23 &6684483183727293224 45 | MeshRenderer: 46 | m_ObjectHideFlags: 0 47 | m_CorrespondingSourceObject: {fileID: 0} 48 | m_PrefabInstance: {fileID: 0} 49 | m_PrefabAsset: {fileID: 0} 50 | m_GameObject: {fileID: 6684483183727293226} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 1 54 | m_DynamicOccludee: 1 55 | m_MotionVectors: 1 56 | m_LightProbeUsage: 1 57 | m_ReflectionProbeUsage: 1 58 | m_RayTracingMode: 2 59 | m_RenderingLayerMask: 1 60 | m_RendererPriority: 0 61 | m_Materials: 62 | - {fileID: 2100000, guid: 9dadb7a322188404a9903e439d04d762, type: 2} 63 | m_StaticBatchInfo: 64 | firstSubMesh: 0 65 | subMeshCount: 0 66 | m_StaticBatchRoot: {fileID: 0} 67 | m_ProbeAnchor: {fileID: 0} 68 | m_LightProbeVolumeOverride: {fileID: 0} 69 | m_ScaleInLightmap: 1 70 | m_ReceiveGI: 1 71 | m_PreserveUVs: 0 72 | m_IgnoreNormalsForChartDetection: 0 73 | m_ImportantGI: 0 74 | m_StitchLightmapSeams: 1 75 | m_SelectedEditorRenderState: 3 76 | m_MinimumChartSize: 4 77 | m_AutoUVMaxDistance: 0.5 78 | m_AutoUVMaxAngle: 89 79 | m_LightmapParameters: {fileID: 0} 80 | m_SortingLayerID: 0 81 | m_SortingLayer: 0 82 | m_SortingOrder: 0 83 | --- !u!54 &6684483183727293225 84 | Rigidbody: 85 | m_ObjectHideFlags: 0 86 | m_CorrespondingSourceObject: {fileID: 0} 87 | m_PrefabInstance: {fileID: 0} 88 | m_PrefabAsset: {fileID: 0} 89 | m_GameObject: {fileID: 6684483183727293226} 90 | serializedVersion: 2 91 | m_Mass: 1 92 | m_Drag: 0 93 | m_AngularDrag: 0.05 94 | m_UseGravity: 0 95 | m_IsKinematic: 0 96 | m_Interpolate: 0 97 | m_Constraints: 0 98 | m_CollisionDetection: 0 99 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecGuestInput.cs: -------------------------------------------------------------------------------- 1 | using ParsecGaming; 2 | using UnityEngine; 3 | using UnityEngine.InputSystem; 4 | 5 | public class ParsecGuestInput : MonoBehaviour 6 | { 7 | private Parsec parsec; 8 | 9 | public void Initialize(Parsec parsec) 10 | { 11 | this.parsec = parsec; 12 | } 13 | 14 | private void LateUpdate() 15 | { 16 | // If no keyboard is plugged in, this will be null. 17 | var keyboard = Keyboard.current; 18 | 19 | if (keyboard != null) 20 | { 21 | foreach (var kvp in ParsecInputSystemMapping.Keys) 22 | { 23 | if (keyboard[kvp.Value].wasPressedThisFrame || keyboard[kvp.Value].wasReleasedThisFrame) 24 | { 25 | var message = new Parsec.ParsecMessage { type = Parsec.ParsecMessageType.MESSAGE_KEYBOARD }; 26 | 27 | message.keyboard.code = kvp.Key; 28 | message.keyboard.pressed = keyboard[kvp.Value].wasPressedThisFrame; 29 | 30 | parsec.ClientSendMessage(message); 31 | } 32 | } 33 | } 34 | 35 | // If no mouse is plugged in, this will be null. 36 | var mouse = Mouse.current; 37 | 38 | if (mouse != null) 39 | { 40 | foreach (var kvp in ParsecInputSystemMapping.MouseButtons(mouse)) 41 | { 42 | if (kvp.Value.wasPressedThisFrame || kvp.Value.wasReleasedThisFrame) 43 | { 44 | var message = new Parsec.ParsecMessage { type = Parsec.ParsecMessageType.MESSAGE_MOUSE_BUTTON }; 45 | 46 | message.mouseButton.button = kvp.Key; 47 | message.mouseButton.pressed = kvp.Value.wasPressedThisFrame; 48 | 49 | parsec.ClientSendMessage(message); 50 | } 51 | } 52 | 53 | // Unity stores the deltas as floats, but they are always 54 | // whole numbers. 55 | int deltaX = (int)mouse.delta.x.ReadValue(); 56 | int deltaY = (int)mouse.delta.y.ReadValue(); 57 | 58 | if (deltaX > 0 || deltaY > 0) 59 | { 60 | var message = new Parsec.ParsecMessage { type = Parsec.ParsecMessageType.MESSAGE_MOUSE_MOTION }; 61 | 62 | message.mouseMotion.relative = true; 63 | message.mouseMotion.x = deltaX; 64 | message.mouseMotion.y = deltaY; 65 | 66 | parsec.ClientSendMessage(message); 67 | } 68 | 69 | int posX = (int)mouse.position.x.ReadValue(); 70 | int posY = (int)mouse.position.y.ReadValue(); 71 | 72 | var positionMessage = new Parsec.ParsecMessage { type = Parsec.ParsecMessageType.MESSAGE_MOUSE_MOTION }; 73 | 74 | positionMessage.mouseMotion.relative = false; 75 | positionMessage.mouseMotion.x = posX; 76 | positionMessage.mouseMotion.y = posY; 77 | 78 | parsec.ClientSendMessage(positionMessage); 79 | } 80 | 81 | var gamepad = Gamepad.current; 82 | 83 | if (gamepad != null) 84 | { 85 | foreach (var kvp in ParsecInputSystemMapping.GamepadButtons(gamepad)) 86 | { 87 | if (kvp.Value.wasPressedThisFrame || kvp.Value.wasReleasedThisFrame) 88 | { 89 | var message = new Parsec.ParsecMessage { type = Parsec.ParsecMessageType.MESSAGE_GAMEPAD_BUTTON }; 90 | 91 | message.gamepadButton.button = kvp.Key; 92 | message.gamepadButton.pressed = kvp.Value.wasPressedThisFrame; 93 | 94 | parsec.ClientSendMessage(message); 95 | } 96 | } 97 | 98 | foreach (var kvp in ParsecInputSystemMapping.GamepadAxes(gamepad)) 99 | { 100 | short axis = (short)(kvp.Value.ReadValue() * short.MaxValue); 101 | 102 | var msg = new Parsec.ParsecMessage { type = Parsec.ParsecMessageType.MESSAGE_GAMEPAD_AXIS }; 103 | msg.gamepadAxis.axis = kvp.Key; 104 | msg.gamepadAxis.value = axis; 105 | 106 | parsec.ClientSendMessage(msg); 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | :warning: **This project is a work-in-progress and is not production ready** :warning: 2 | 3 | This repository uses the [Parsec C# SDK](https://github.com/parsec-cloud/parsec-sdk) to allow hosting and joining Parsec sessions within Unity. The Parsec C# SDK provides interoperability with the [native Parsec SDK](https://parsecgaming.com/docs/sdk/). [Parsec](https://parsecgaming.com/) is an interactive video streaming application that is commonly used to play local multiplayer games over a network. This allows a developer to add networked multiplayer to their project without needing to write any netcode. **This repository is not affiliated with the Parsec team.** 4 | 5 | ![Screenshot of both local and remote views of the demo game](https://i.imgur.com/TBphcwK.png) 6 | 7 | [Demo video](https://gfycat.com/specificuncomfortableargentinehornedfrog) 8 | 9 | # Getting Started 10 | 11 | This repository does not contain the Parsec SDK libraries. You will need to copy the following into this repo from the [Parsec SDK](https://github.com/parsec-cloud/parsec-sdk): 12 | - [parsec.dll](https://github.com/parsec-cloud/parsec-sdk/blob/master/sdk/windows/parsec.dll) 13 | - [parsec32.dll](https://github.com/parsec-cloud/parsec-sdk/blob/master/sdk/windows/parsec32.dll) 14 | - [ParsecUnity46.dll](https://github.com/parsec-cloud/parsec-sdk/blob/master/sdk/ParsecUnity/ParsecUnity46.dll) 15 | - [libparsec.dylib](https://github.com/parsec-cloud/parsec-sdk/blob/master/sdk/macos/libparsec.dylib) (rename it to `parsec.bundle`) 16 | 17 | You can also run the setup scripts for the Unity SDK ([described on this page](https://github.com/parsec-cloud/parsec-sdk/tree/master/sdk/ParsecUnity)) to have these libraries set up in the Unity examples included in the Parsec SDK, and then copy them from there into this repository. 18 | 19 | Unity does not allow a single project to be open in multiple Editor instances. This can be frustrating when working with networked projects, as it would require a build to be created each time you wish to test both host and client. A workaround to this is to use the [Unity Project Junction tool](https://gist.github.com/IronWarrior/005f649e443bf51b656729231d0b8af4) included with this repository to create a second dummy project. 20 | 21 | To start a host and connect a client, you will need a Parsec account (created on their website) and a valid `sessionId` and `peerId` [retrieved using the Parsec API](https://github.com/parsec-cloud/parsec-sdk/tree/master/api/personal) (the examples do come included with a valid `session`/`peerId` at the time of writing, but this may change. Better to request your own). 22 | 23 | # Examples 24 | 25 | Run the scene [Assets/ParsecUnity/Experiments/ParsecTest](Assets/ParsecUnity/Experiments/ParsecTest.unity) to get started. The status will be displayed on screen if the connection is successful. Tick the **Try Make Texture** toggle on the client to start polling for video frames. 26 | 27 | If you have successfully run the above scene, you can try the demo project in [Assets/Demo/Main](Assets/Demo/Main.unity). This uses the Unity Input System to handle input. Note that in the Editor, to allow guest inputs to be correctly read on the host, you'll need to lock input in the host Editor instance (`Window > Analysis > Input Debugger > Options > Lock Input to Game View`). 28 | 29 | # TODO 30 | 31 | - Unity sometimes crashes when attempting to connect a client. Unknown why. 32 | - Parsec supports [many different color formats](https://parsecgaming.com/docs/sdk/enum/ParsecColorFormat/) for streaming. Currently `FORMAT_I420` is the only supported one in this package (not sure how to force the host to use a specific format to test the others). The color in the guest view is also slightly off right now. 33 | - ~Audio is not currently supported. The [Parsec Unity SDK](https://github.com/parsec-cloud/parsec-sdk/tree/master/sdk/ParsecUnity) does have an example that supports outgoing audio from a single AudioSource. Currently the exception *`MarshalDirectiveException: [MarshalAs] attribute required to marshal arrays to managed code.`* is thrown when calling `Parsec.ClientPollAudio`.~ This is fixed on the `audio` branch. However, it uses an edited version of the ParsecUnity dll, which is not included in this package. This branch will be merged when the fix propogates to the official distribution of the ParsecUnity dll. 34 | - Unity Input System is the only supported input on both the host and client. The Parsec Unity SDK does have input for both the legacy input and Rewired, so adding in more input systems should not be challenging. 35 | - ...and lots more! Search for `// TODO` in the comments. 36 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Editor/UnityProjectJunctionTool.cs: -------------------------------------------------------------------------------- 1 | // gist by Roystan (IronWarrior): https://gist.github.com/IronWarrior/005f649e443bf51b656729231d0b8af4 2 | // 3 | // CONTRIBUTIONS: 4 | // Mac and Linux support added by Creature Coding: https://creaturecoding.com/ 5 | // 6 | // PURPOSE: 7 | // Unity does not permit a project to be open in two different editor instances. 8 | // This can be frustrating when building projects with multiplayer networking, 9 | // as it would require you to create a build every time you wish you test your netcode. 10 | // A workaround would be to duplicate the project, but this would require the duplicated 11 | // project to be updated each time a change is made. 12 | // 13 | // Instead of duplicating the project, we create a new directory and populate it with 14 | // junction links to our existing project's Assets, ProjectSettings and Packages directories. 15 | // https://docs.microsoft.com/en-us/windows/win32/fileio/hard-links-and-junctions#junctions 16 | // The contents of these junctions are identical, but Unity will treat the directory containing 17 | // them as a new project, allowing us to have multiple instances of our project open. 18 | // 19 | // 20 | // TO USE THIS SCRIPT: 21 | // Place it in your Unity project in a directory called "Editor". A new menu will appear 22 | // on the top bar called "Unity Project Junction". Click it and Create Unity Junction Project. 23 | // You can now open this "new" project in a separate Unity Editor instance. 24 | 25 | using UnityEngine; 26 | using UnityEditor; 27 | using System.IO; 28 | using System.Diagnostics; 29 | 30 | public static class UnityProjectJunctionTool 31 | { 32 | [MenuItem("Unity Project Junction/Create Junction Unity Project")] 33 | private static void CreateJunctionUnityProject() 34 | { 35 | DirectoryInfo projectDirectoryInfo = new DirectoryInfo(Directory.GetCurrentDirectory()); 36 | 37 | string junctionDirectory = $"{projectDirectoryInfo.Name}-Junction"; 38 | string junctionPath = Path.Combine(projectDirectoryInfo.Parent.FullName, junctionDirectory); 39 | 40 | if (Directory.Exists(junctionPath)) 41 | { 42 | if (EditorUtility.DisplayDialog("Junction already exists", 43 | $"Junction project directory already exists at {junctionPath}.\n\nWould you like to create another junction project?", 44 | "Cancel", "Yes, create another")) 45 | { 46 | return; 47 | } 48 | else 49 | { 50 | int junctionIndex = 1; 51 | 52 | do 53 | { 54 | junctionDirectory = $"{projectDirectoryInfo.Name}-Junction-{junctionIndex}"; 55 | junctionPath = Path.Combine(projectDirectoryInfo.Parent.FullName, junctionDirectory); 56 | 57 | junctionIndex++; 58 | } 59 | while (Directory.Exists(junctionPath)); 60 | } 61 | } 62 | 63 | DirectoryInfo junctionDirectoryInfo = Directory.CreateDirectory(junctionPath); 64 | 65 | string linkAssets = Path.Combine(junctionDirectoryInfo.FullName, "Assets"); 66 | string linkProjectSettings = Path.Combine(junctionDirectoryInfo.FullName, "ProjectSettings"); 67 | string linkPackages = Path.Combine(junctionDirectoryInfo.FullName, "Packages"); 68 | 69 | string targetAssets = Path.Combine(projectDirectoryInfo.FullName, "Assets"); 70 | string targetProjectSettings = Path.Combine(projectDirectoryInfo.FullName, "ProjectSettings"); 71 | string targetPackages = Path.Combine(projectDirectoryInfo.FullName, "Packages"); 72 | 73 | CreateJunction(linkAssets, targetAssets); 74 | CreateJunction(linkProjectSettings, targetProjectSettings); 75 | CreateJunction(linkPackages, targetPackages); 76 | 77 | EditorUtility.DisplayDialog("Complete", $"Created junction project at {junctionPath}.\n\nYou may now open this new project in a separate Unity Editor instance.", "Ok"); 78 | 79 | EditorUtility.RevealInFinder(junctionDirectoryInfo.FullName); 80 | } 81 | 82 | private static void CreateJunction(string link, string target) 83 | { 84 | if (Application.platform == RuntimePlatform.WindowsEditor) 85 | { 86 | LinkWinOS(link, target); 87 | } 88 | else if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.LinuxEditor) 89 | { 90 | LinkMacLinOS(link, target); 91 | } 92 | } 93 | 94 | public static void LinkWinOS(string link, string target) 95 | { 96 | string command = $"/C mklink /J \"{link}\" \"{target}\""; 97 | Process.Start("cmd.exe", command); 98 | } 99 | 100 | public static void LinkMacLinOS(string link, string target) 101 | { 102 | string command = $"ln -s \"{target}\" \"{link}\""; 103 | 104 | var proc = new Process 105 | { 106 | StartInfo = new ProcessStartInfo 107 | { 108 | FileName = "/bin/bash", 109 | Arguments = "-c \"" + command.Replace("\"", "\"\"") + "\"", 110 | UseShellExecute = false, 111 | RedirectStandardOutput = true, 112 | CreateNoWindow = true, 113 | } 114 | }; 115 | 116 | proc.Start(); 117 | proc.WaitForExit(); 118 | } 119 | 120 | } -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/Prefabs/ParsecGuestView.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &3216626056677132517 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 3216626056677132519} 12 | - component: {fileID: 3216626056677132516} 13 | - component: {fileID: 3216626056677132518} 14 | m_Layer: 8 15 | m_Name: ParsecGuestView 16 | m_TagString: MainCamera 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &3216626056677132519 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 3216626056677132517} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 1, z: -10} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: 32 | - {fileID: 3216626056764873284} 33 | m_Father: {fileID: 0} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | --- !u!20 &3216626056677132516 37 | Camera: 38 | m_ObjectHideFlags: 0 39 | m_CorrespondingSourceObject: {fileID: 0} 40 | m_PrefabInstance: {fileID: 0} 41 | m_PrefabAsset: {fileID: 0} 42 | m_GameObject: {fileID: 3216626056677132517} 43 | m_Enabled: 1 44 | serializedVersion: 2 45 | m_ClearFlags: 2 46 | m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} 47 | m_projectionMatrixMode: 1 48 | m_GateFitMode: 2 49 | m_FOVAxisMode: 0 50 | m_SensorSize: {x: 36, y: 24} 51 | m_LensShift: {x: 0, y: 0} 52 | m_FocalLength: 50 53 | m_NormalizedViewPortRect: 54 | serializedVersion: 2 55 | x: 0 56 | y: 0 57 | width: 1 58 | height: 1 59 | near clip plane: 0.3 60 | far clip plane: 2 61 | field of view: 60 62 | orthographic: 1 63 | orthographic size: 0.5 64 | m_Depth: 0 65 | m_CullingMask: 66 | serializedVersion: 2 67 | m_Bits: 256 68 | m_RenderingPath: -1 69 | m_TargetTexture: {fileID: 0} 70 | m_TargetDisplay: 0 71 | m_TargetEye: 3 72 | m_HDR: 1 73 | m_AllowMSAA: 1 74 | m_AllowDynamicResolution: 0 75 | m_ForceIntoRT: 0 76 | m_OcclusionCulling: 1 77 | m_StereoConvergence: 10 78 | m_StereoSeparation: 0.022 79 | --- !u!114 &3216626056677132518 80 | MonoBehaviour: 81 | m_ObjectHideFlags: 0 82 | m_CorrespondingSourceObject: {fileID: 0} 83 | m_PrefabInstance: {fileID: 0} 84 | m_PrefabAsset: {fileID: 0} 85 | m_GameObject: {fileID: 3216626056677132517} 86 | m_Enabled: 1 87 | m_EditorHideFlags: 0 88 | m_Script: {fileID: 11500000, guid: 882f8f1ef4bc80e4599cfab684d869c5, type: 3} 89 | m_Name: 90 | m_EditorClassIdentifier: 91 | frame: {fileID: 3216626056764873287} 92 | --- !u!1 &3216626056764873285 93 | GameObject: 94 | m_ObjectHideFlags: 0 95 | m_CorrespondingSourceObject: {fileID: 0} 96 | m_PrefabInstance: {fileID: 0} 97 | m_PrefabAsset: {fileID: 0} 98 | serializedVersion: 6 99 | m_Component: 100 | - component: {fileID: 3216626056764873284} 101 | - component: {fileID: 3216626056764873286} 102 | - component: {fileID: 3216626056764873287} 103 | m_Layer: 8 104 | m_Name: Frame 105 | m_TagString: Untagged 106 | m_Icon: {fileID: 0} 107 | m_NavMeshLayer: 0 108 | m_StaticEditorFlags: 0 109 | m_IsActive: 1 110 | --- !u!4 &3216626056764873284 111 | Transform: 112 | m_ObjectHideFlags: 0 113 | m_CorrespondingSourceObject: {fileID: 0} 114 | m_PrefabInstance: {fileID: 0} 115 | m_PrefabAsset: {fileID: 0} 116 | m_GameObject: {fileID: 3216626056764873285} 117 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 118 | m_LocalPosition: {x: 0, y: 0, z: 1} 119 | m_LocalScale: {x: 1.7777778, y: 1, z: 1} 120 | m_Children: [] 121 | m_Father: {fileID: 3216626056677132519} 122 | m_RootOrder: 0 123 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 124 | --- !u!33 &3216626056764873286 125 | MeshFilter: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInstance: {fileID: 0} 129 | m_PrefabAsset: {fileID: 0} 130 | m_GameObject: {fileID: 3216626056764873285} 131 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 132 | --- !u!23 &3216626056764873287 133 | MeshRenderer: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInstance: {fileID: 0} 137 | m_PrefabAsset: {fileID: 0} 138 | m_GameObject: {fileID: 3216626056764873285} 139 | m_Enabled: 1 140 | m_CastShadows: 1 141 | m_ReceiveShadows: 1 142 | m_DynamicOccludee: 1 143 | m_MotionVectors: 1 144 | m_LightProbeUsage: 1 145 | m_ReflectionProbeUsage: 1 146 | m_RayTracingMode: 2 147 | m_RenderingLayerMask: 1 148 | m_RendererPriority: 0 149 | m_Materials: 150 | - {fileID: 0} 151 | m_StaticBatchInfo: 152 | firstSubMesh: 0 153 | subMeshCount: 0 154 | m_StaticBatchRoot: {fileID: 0} 155 | m_ProbeAnchor: {fileID: 0} 156 | m_LightProbeVolumeOverride: {fileID: 0} 157 | m_ScaleInLightmap: 1 158 | m_ReceiveGI: 1 159 | m_PreserveUVs: 0 160 | m_IgnoreNormalsForChartDetection: 0 161 | m_ImportantGI: 0 162 | m_StitchLightmapSeams: 1 163 | m_SelectedEditorRenderState: 3 164 | m_MinimumChartSize: 4 165 | m_AutoUVMaxDistance: 0.5 166 | m_AutoUVMaxAngle: 89 167 | m_LightmapParameters: {fileID: 0} 168 | m_SortingLayerID: 0 169 | m_SortingLayer: 0 170 | m_SortingOrder: 0 171 | -------------------------------------------------------------------------------- /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: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 0 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 70 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 2 136 | antiAliasing: 2 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSM: 5 183 | PSP2: 2 184 | Standalone: 5 185 | Tizen: 2 186 | WebGL: 3 187 | WiiU: 5 188 | Windows Store Apps: 5 189 | XboxOne: 5 190 | iPhone: 2 191 | tvOS: 2 192 | -------------------------------------------------------------------------------- /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: P1_Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: P1_Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: P1_Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: P1_Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: P1_Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: P1_Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: P1_Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: P1_Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: P1_Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: P1_Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: P1_Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: P1_Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: P1_Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: P1_Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: P1_Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: P1_Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: P1_Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: P1_Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | - serializedVersion: 3 297 | m_Name: Default 298 | descriptiveName: 299 | descriptiveNegativeName: 300 | negativeButton: 301 | positiveButton: escape 302 | altNegativeButton: 303 | altPositiveButton: joystick button 1 304 | gravity: 1000 305 | dead: 0.001 306 | sensitivity: 1000 307 | snap: 0 308 | invert: 0 309 | type: 0 310 | axis: 0 311 | joyNum: 0 312 | -------------------------------------------------------------------------------- /Assets/Demo/Input/InputActions.inputactions: -------------------------------------------------------------------------------- 1 | { 2 | "name": "InputActions", 3 | "maps": [ 4 | { 5 | "name": "Player", 6 | "id": "2c929efe-1edb-4c0a-a3b2-3755dcff8443", 7 | "actions": [ 8 | { 9 | "name": "Move", 10 | "type": "Value", 11 | "id": "6828742a-12bc-4f39-9e59-2e86cf4899d2", 12 | "expectedControlType": "Vector2", 13 | "processors": "", 14 | "interactions": "" 15 | }, 16 | { 17 | "name": "LookDirection", 18 | "type": "Value", 19 | "id": "4c416975-2ab2-4a84-aeb8-4b688f9978da", 20 | "expectedControlType": "Vector2", 21 | "processors": "", 22 | "interactions": "" 23 | }, 24 | { 25 | "name": "Fire", 26 | "type": "Button", 27 | "id": "3e518e68-d479-43d1-9384-a2dffde402df", 28 | "expectedControlType": "Button", 29 | "processors": "", 30 | "interactions": "" 31 | }, 32 | { 33 | "name": "LookTarget", 34 | "type": "Value", 35 | "id": "6cac2791-a02a-4cbf-83f9-9a1c104da15e", 36 | "expectedControlType": "Vector2", 37 | "processors": "", 38 | "interactions": "" 39 | } 40 | ], 41 | "bindings": [ 42 | { 43 | "name": "2D Vector", 44 | "id": "098b882f-4a1b-4145-b477-1693b5e42217", 45 | "path": "2DVector", 46 | "interactions": "", 47 | "processors": "", 48 | "groups": "", 49 | "action": "Move", 50 | "isComposite": true, 51 | "isPartOfComposite": false 52 | }, 53 | { 54 | "name": "up", 55 | "id": "fcf67724-920f-44eb-a4f4-2714875960d9", 56 | "path": "/w", 57 | "interactions": "", 58 | "processors": "", 59 | "groups": "MouseKeyboard", 60 | "action": "Move", 61 | "isComposite": false, 62 | "isPartOfComposite": true 63 | }, 64 | { 65 | "name": "down", 66 | "id": "5a5a6010-7bb1-4d8d-9fa3-8bb4954b5f41", 67 | "path": "/s", 68 | "interactions": "", 69 | "processors": "", 70 | "groups": "MouseKeyboard", 71 | "action": "Move", 72 | "isComposite": false, 73 | "isPartOfComposite": true 74 | }, 75 | { 76 | "name": "left", 77 | "id": "9eba33be-05e6-480b-abce-2506303a45c2", 78 | "path": "/a", 79 | "interactions": "", 80 | "processors": "", 81 | "groups": "MouseKeyboard", 82 | "action": "Move", 83 | "isComposite": false, 84 | "isPartOfComposite": true 85 | }, 86 | { 87 | "name": "right", 88 | "id": "322de8ad-f105-42a0-9991-7f1f79f8e8fa", 89 | "path": "/d", 90 | "interactions": "", 91 | "processors": "", 92 | "groups": "MouseKeyboard", 93 | "action": "Move", 94 | "isComposite": false, 95 | "isPartOfComposite": true 96 | }, 97 | { 98 | "name": "", 99 | "id": "af1e8329-a1c3-4a06-9c1a-731dab7992c0", 100 | "path": "/leftStick", 101 | "interactions": "", 102 | "processors": "", 103 | "groups": "Gamepad", 104 | "action": "Move", 105 | "isComposite": false, 106 | "isPartOfComposite": false 107 | }, 108 | { 109 | "name": "", 110 | "id": "04b14a15-cfa4-471f-ae76-716e171c15bf", 111 | "path": "/dpad", 112 | "interactions": "", 113 | "processors": "", 114 | "groups": "Gamepad", 115 | "action": "Move", 116 | "isComposite": false, 117 | "isPartOfComposite": false 118 | }, 119 | { 120 | "name": "", 121 | "id": "f875fd2f-5794-44b7-b246-6de736f37269", 122 | "path": "/rightStick", 123 | "interactions": "", 124 | "processors": "", 125 | "groups": "Gamepad", 126 | "action": "LookDirection", 127 | "isComposite": false, 128 | "isPartOfComposite": false 129 | }, 130 | { 131 | "name": "", 132 | "id": "69528bb0-87c1-41c2-908f-69d86bdf514a", 133 | "path": "/rightTrigger", 134 | "interactions": "Press(pressPoint=0.9)", 135 | "processors": "", 136 | "groups": "Gamepad", 137 | "action": "Fire", 138 | "isComposite": false, 139 | "isPartOfComposite": false 140 | }, 141 | { 142 | "name": "", 143 | "id": "662403f4-43d4-4c27-85d9-89b17665bd76", 144 | "path": "/leftButton", 145 | "interactions": "", 146 | "processors": "", 147 | "groups": "MouseKeyboard", 148 | "action": "Fire", 149 | "isComposite": false, 150 | "isPartOfComposite": false 151 | }, 152 | { 153 | "name": "", 154 | "id": "835bffca-bd43-44f9-9801-3a2beded7355", 155 | "path": "/position", 156 | "interactions": "", 157 | "processors": "", 158 | "groups": "MouseKeyboard", 159 | "action": "LookTarget", 160 | "isComposite": false, 161 | "isPartOfComposite": false 162 | } 163 | ] 164 | } 165 | ], 166 | "controlSchemes": [ 167 | { 168 | "name": "MouseKeyboard", 169 | "bindingGroup": "MouseKeyboard", 170 | "devices": [ 171 | { 172 | "devicePath": "", 173 | "isOptional": false, 174 | "isOR": false 175 | }, 176 | { 177 | "devicePath": "", 178 | "isOptional": false, 179 | "isOR": false 180 | } 181 | ] 182 | }, 183 | { 184 | "name": "Gamepad", 185 | "bindingGroup": "Gamepad", 186 | "devices": [ 187 | { 188 | "devicePath": "", 189 | "isOptional": false, 190 | "isOR": false 191 | } 192 | ] 193 | } 194 | ] 195 | } -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecUnityController.cs: -------------------------------------------------------------------------------- 1 | using ParsecGaming; 2 | using System; 3 | using System.Collections; 4 | using UnityEngine; 5 | 6 | public class ParsecUnityController : MonoBehaviour 7 | { 8 | /// 9 | /// NOTE: Ideally this should be accessed publicly as little as possible, with 10 | /// all relevant data and operations encapsulated to the consumer. 11 | /// 12 | public Parsec Parsec { get; private set; } 13 | 14 | // Manually toggling this on and off until better debugging tools are made. 15 | // Static variables are so sinful :( 16 | public static bool EnableDebug { private get; set; } = true; 17 | 18 | // TODO: Ideally the host and client code should be split into two separate modules. 19 | #region Host 20 | // TODO: This should contain something more abstract. 21 | public event Action OnGuestConnected; 22 | public event Action OnGuestDisconnected; 23 | // TODO: This is currently only used for the client to send their color on game start. 24 | // Autoconverts in the incoming UTF-8 string into JSON, but does not encode anything about 25 | // its type (its assumed to be a color right now). 26 | public event Action OnReceiveUserData; 27 | 28 | private ParsecHostInput hostInput; 29 | private Texture2D screenshot; 30 | 31 | /// 32 | /// Starts hosting a Parsec session with the associated session ID. 33 | /// Streaming will not being until is called. 34 | /// 35 | /// 36 | public void Host(string sessionId) 37 | { 38 | InitializeParsec(); 39 | 40 | var status = Parsec.HostStart(Parsec.ParsecHostMode.HOST_GAME, sessionId); 41 | Log($"Starting host: {status}"); 42 | 43 | hostInput = gameObject.AddComponent(); 44 | hostInput.Initialize(Parsec); 45 | 46 | StartCoroutine(HostPollEvents()); 47 | } 48 | 49 | /// 50 | /// Starts capturing the screen at the end of every frame, submitting 51 | /// it to Parsec. 52 | /// 53 | public void StartHostStreamer() 54 | { 55 | StartCoroutine(HostSubmitFrame()); 56 | } 57 | 58 | private IEnumerator HostPollEvents() 59 | { 60 | while (true) 61 | { 62 | yield return null; 63 | 64 | while (Parsec.HostPollEvents(0u, out Parsec.ParsecHostEvent hostEvent)) 65 | { 66 | if (hostEvent.type == Parsec.ParsecHostEventType.HOST_EVENT_GUEST_STATE_CHANGE) 67 | { 68 | Parsec.ParsecGuestState state = hostEvent.guestStateChange.guest.state; 69 | 70 | switch (state) 71 | { 72 | case Parsec.ParsecGuestState.GUEST_CONNECTED: 73 | Log($"Guest ID {hostEvent.guestStateChange.guest.id} connected."); 74 | 75 | var deviceCollection = hostInput.AddGuest(hostEvent.guestStateChange.guest); 76 | OnGuestConnected?.Invoke(hostEvent.guestStateChange.guest, deviceCollection); 77 | break; 78 | case Parsec.ParsecGuestState.GUEST_DISCONNECTED: 79 | Log($"Guest ID {hostEvent.guestStateChange.guest.id} disconnected."); 80 | 81 | OnGuestDisconnected?.Invoke(hostEvent.guestStateChange.guest); 82 | break; 83 | default: 84 | break; 85 | } 86 | } 87 | else if (hostEvent.type == Parsec.ParsecHostEventType.HOST_EVENT_USER_DATA) 88 | { 89 | Log($"Received user data from {hostEvent.userData.guest.id}."); 90 | 91 | string json = Parsec.HostGetUserDataString(hostEvent.userData.key); 92 | OnReceiveUserData?.Invoke(hostEvent.userData.guest, json); 93 | } 94 | } 95 | } 96 | } 97 | 98 | private IEnumerator HostSubmitFrame() 99 | { 100 | while (true) 101 | { 102 | yield return new WaitForEndOfFrame(); 103 | 104 | if (screenshot != null) 105 | Destroy(screenshot); 106 | 107 | screenshot = ScreenCapture.CaptureScreenshotAsTexture(1); 108 | UnityNative.UnitySubmitFrame(Parsec.GetPointer(), screenshot.GetNativeTexturePtr()); 109 | GL.IssuePluginEvent(UnityNative.UnityGetRenderEventFunction(), 1); 110 | } 111 | } 112 | #endregion 113 | 114 | #region Client 115 | [SerializeField] 116 | ParsecGuestView parsecGuestViewPrefab; 117 | 118 | private ParsecFrameDecoder parsecFrameDecoder; 119 | private ParsecGuestView parsecGuestView; 120 | 121 | public void Connect(string sessionId, string userId) 122 | { 123 | InitializeParsec(); 124 | 125 | Parsec.ParsecClientConfig defaultConfig = new Parsec.ParsecClientConfig() 126 | { 127 | mediaContainer = 0, 128 | protocol = 1, 129 | secret = "", 130 | pngCursor = false 131 | }; 132 | 133 | var status = Parsec.ClientConnect(defaultConfig, sessionId, userId); 134 | Log($"Connecting client: {status}"); 135 | 136 | gameObject.AddComponent().Initialize(Parsec); 137 | 138 | // TODO: This should probably start a coroutine to monitor the connection attempt, 139 | // firing appropriate events on status change/success/failure. 140 | } 141 | 142 | /// 143 | /// Instantiates a client view and begins polling for frames to populate it. 144 | /// 145 | public void StartClientPollFrames() 146 | { 147 | parsecFrameDecoder = new ParsecFrameDecoder(); 148 | parsecGuestView = Instantiate(parsecGuestViewPrefab); 149 | 150 | StartCoroutine(ClientMonitorScreenSize()); 151 | StartCoroutine(ClientPollFrame()); 152 | } 153 | 154 | public void ClientSendUserData(Color color) 155 | { 156 | string json = JsonUtility.ToJson(color); 157 | 158 | Parsec.ClientSendUserData(0, json); 159 | } 160 | 161 | private int currentScreenWidth, currentScreenHeight; 162 | 163 | private IEnumerator ClientMonitorScreenSize() 164 | { 165 | while (true) 166 | { 167 | yield return null; 168 | 169 | if (Screen.width != currentScreenWidth || Screen.height != currentScreenHeight) 170 | { 171 | currentScreenWidth = Screen.width; 172 | currentScreenHeight = Screen.height; 173 | 174 | Parsec.ClientSetDimensions(0, (uint)currentScreenWidth, (uint)currentScreenHeight, 1); 175 | } 176 | } 177 | } 178 | 179 | private IEnumerator ClientPollFrame() 180 | { 181 | while (true) 182 | { 183 | yield return null; 184 | Parsec.ClientPollFrame(0, OnClientReceiveFrame, 0u); 185 | } 186 | } 187 | 188 | private void OnClientReceiveFrame(Parsec.ParsecFrame frame, IntPtr image, IntPtr opaque) 189 | { 190 | parsecFrameDecoder.Decode(frame, image); 191 | // TODO: Could just initialize the guest view with the decoder? 192 | parsecGuestView.Populate(parsecFrameDecoder.Y, parsecFrameDecoder.U, parsecFrameDecoder.V, parsecFrameDecoder.Padding, parsecFrameDecoder.AspectRatio); 193 | } 194 | #endregion 195 | 196 | public static void Log(string text) 197 | { 198 | if (!EnableDebug) 199 | return; 200 | 201 | Debug.Log($"Unity Parsec: {text}"); 202 | } 203 | 204 | private void InitializeParsec() 205 | { 206 | Parsec = new Parsec(); 207 | 208 | var status = Parsec.Init(); 209 | Log($"Parsec Init: {status}"); 210 | } 211 | 212 | private void OnDestroy() 213 | { 214 | if (Parsec != null) 215 | Parsec.ParsecDestroy(); 216 | } 217 | } 218 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecHostInput.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.InputSystem; 3 | using ParsecGaming; 4 | using System.Collections.Generic; 5 | using UnityEngine.InputSystem.LowLevel; 6 | 7 | // TODO: The Input System-specific code should be moved to a different module. This 8 | // class would then only be responsible for polymorphically converting Parsec inputs 9 | // to the module's domain, and surfacing the converted inputs to the app. 10 | public class ParsecHostInput : MonoBehaviour 11 | { 12 | private Parsec parsec; 13 | 14 | public Dictionary guests; 15 | 16 | private void Awake() 17 | { 18 | guests = new Dictionary(); 19 | } 20 | 21 | private void OnDestroy() 22 | { 23 | foreach (var kvp in guests) 24 | { 25 | kvp.Value.Free(); 26 | } 27 | } 28 | 29 | public void Initialize(Parsec parsec) 30 | { 31 | this.parsec = parsec; 32 | } 33 | 34 | public InputDeviceCollection AddGuest(Parsec.ParsecGuest guest) 35 | { 36 | guests[guest.id] = new InputDeviceCollection(); 37 | return guests[guest.id]; 38 | } 39 | 40 | // TODO: This should be applied before all updates, or whenever 41 | // input normally is applied (based on the InputSystem configuration). 42 | private void Update() 43 | { 44 | // TODO: Probably don't need to allocate a new set of dictionaries every frame. 45 | var keyboardMessages = new Dictionary>(); 46 | var mouseMessages = new Dictionary>(); 47 | var gamepadMessages = new Dictionary>(); 48 | 49 | while (parsec.HostPollInput(0u, out Parsec.ParsecGuest guest, out Parsec.ParsecMessage msg)) 50 | { 51 | switch (msg.type) 52 | { 53 | case Parsec.ParsecMessageType.MESSAGE_KEYBOARD: 54 | if (!keyboardMessages.ContainsKey(guest.id)) 55 | keyboardMessages[guest.id] = new List(); 56 | 57 | keyboardMessages[guest.id].Add(msg); 58 | break; 59 | case Parsec.ParsecMessageType.MESSAGE_MOUSE_BUTTON: 60 | if (!mouseMessages.ContainsKey(guest.id)) 61 | mouseMessages[guest.id] = new List(); 62 | 63 | mouseMessages[guest.id].Add(msg); 64 | break; 65 | case Parsec.ParsecMessageType.MESSAGE_MOUSE_MOTION: 66 | if (!mouseMessages.ContainsKey(guest.id)) 67 | mouseMessages[guest.id] = new List(); 68 | 69 | mouseMessages[guest.id].Add(msg); 70 | break; 71 | case Parsec.ParsecMessageType.MESSAGE_GAMEPAD_BUTTON: 72 | if (!gamepadMessages.ContainsKey(guest.id)) 73 | gamepadMessages[guest.id] = new List(); 74 | 75 | gamepadMessages[guest.id].Add(msg); 76 | break; 77 | case Parsec.ParsecMessageType.MESSAGE_GAMEPAD_AXIS: 78 | if (!gamepadMessages.ContainsKey(guest.id)) 79 | gamepadMessages[guest.id] = new List(); 80 | 81 | gamepadMessages[guest.id].Add(msg); 82 | break; 83 | default: 84 | break; 85 | } 86 | } 87 | 88 | // Unity's low level input event queuing system apparently does not like 89 | // multiple events to be queued for a single device each input round, 90 | // making it necessary to store all events per device ahead of time. 91 | foreach (var kvp in keyboardMessages) 92 | { 93 | if (!guests[kvp.Key].Get(out Keyboard keyboard)) 94 | { 95 | keyboard = guests[kvp.Key].CreateAndAdd(); 96 | } 97 | 98 | using (StateEvent.From(keyboard, out InputEventPtr eventPtr)) 99 | { 100 | foreach (var msg in kvp.Value) 101 | { 102 | if (ParsecInputSystemMapping.Keys.TryGetValue(msg.keyboard.code, out Key key)) 103 | { 104 | ParsecUnityController.Log($"Guest {kvp.Key} {(msg.keyboard.pressed ? "pressed" : "released")} key {key} at {Time.time}"); 105 | 106 | keyboard[key].WriteValueIntoEvent(msg.keyboard.pressed ? 1 : 0, eventPtr); 107 | } 108 | } 109 | 110 | InputSystem.QueueEvent(eventPtr); 111 | } 112 | } 113 | 114 | foreach (var kvp in mouseMessages) 115 | { 116 | if (!guests[kvp.Key].Get(out Mouse mouse)) 117 | { 118 | mouse = guests[kvp.Key].CreateAndAdd(); 119 | } 120 | 121 | using (StateEvent.From(mouse, out InputEventPtr eventPtr)) 122 | { 123 | foreach (var msg in kvp.Value) 124 | { 125 | if (msg.type == Parsec.ParsecMessageType.MESSAGE_MOUSE_BUTTON) 126 | { 127 | var button = ParsecInputSystemMapping.ParsecToMouseButton(mouse, msg.mouseButton.button); 128 | 129 | if (button != null) 130 | { 131 | ParsecUnityController.Log($"Guest {kvp.Key} {(msg.mouseButton.pressed ? "pressed" : "released")} {button} on mouse at {Time.time}"); 132 | 133 | button.WriteValueIntoEvent(msg.mouseButton.pressed ? 1 : 0, eventPtr); 134 | } 135 | } 136 | else if (msg.type == Parsec.ParsecMessageType.MESSAGE_MOUSE_MOTION && !msg.mouseMotion.relative) 137 | { 138 | // TODO: Logging levels for very low priority debugs, like mouse motion or position. 139 | // ParsecUnityController.Log($"Guest {kvp.Key} mouse position is at {msg.mouseMotion.x}, {msg.mouseMotion.y} at {Time.time}"); 140 | 141 | mouse.position.x.WriteValueIntoEvent(msg.mouseMotion.x, eventPtr); 142 | mouse.position.y.WriteValueIntoEvent(msg.mouseMotion.y, eventPtr); 143 | } 144 | else if (msg.type == Parsec.ParsecMessageType.MESSAGE_MOUSE_MOTION && msg.mouseMotion.relative) 145 | { 146 | // TODO: Logging levels for very low priority debugs, like mouse motion or position. 147 | // ParsecUnityController.Log($"Guest {kvp.Key} mouse delta was {msg.mouseMotion.x}, {msg.mouseMotion.y} at {Time.time}"); 148 | 149 | mouse.delta.x.WriteValueIntoEvent(msg.mouseMotion.x, eventPtr); 150 | mouse.delta.y.WriteValueIntoEvent(msg.mouseMotion.y, eventPtr); 151 | } 152 | } 153 | 154 | InputSystem.QueueEvent(eventPtr); 155 | } 156 | } 157 | 158 | foreach (var kvp in gamepadMessages) 159 | { 160 | if (!guests[kvp.Key].Get(out Gamepad gamepad)) 161 | { 162 | gamepad = guests[kvp.Key].CreateAndAdd(); 163 | } 164 | 165 | using (StateEvent.From(gamepad, out InputEventPtr eventPtr)) 166 | { 167 | foreach (var msg in kvp.Value) 168 | { 169 | if (msg.type == Parsec.ParsecMessageType.MESSAGE_GAMEPAD_BUTTON) 170 | { 171 | var button = ParsecInputSystemMapping.ParsecToGamepadButton(gamepad, msg.gamepadButton.button); 172 | 173 | if (button != null) 174 | { 175 | ParsecUnityController.Log($"Guest {kvp.Key} {(msg.gamepadButton.pressed ? "pressed" : "released")} {button} on gamepad {msg.gamepadButton.id} at {Time.time}"); 176 | 177 | button.WriteValueIntoEvent(msg.gamepadButton.pressed ? 1 : 0, eventPtr); 178 | } 179 | } 180 | else if (msg.type == Parsec.ParsecMessageType.MESSAGE_GAMEPAD_AXIS) 181 | { 182 | var axis = ParsecInputSystemMapping.ParsecToGamepadAxis(gamepad, msg.gamepadAxis.axis); 183 | 184 | if (axis != null) 185 | { 186 | float value = (float)msg.gamepadAxis.value / short.MaxValue; 187 | 188 | axis.WriteValueIntoEvent(value, eventPtr); 189 | } 190 | } 191 | } 192 | 193 | InputSystem.QueueEvent(eventPtr); 194 | } 195 | } 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/ParsecTest.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using ParsecGaming; 3 | using System; 4 | using System.Collections; 5 | using UnityEngine.UI; 6 | using System.Runtime.InteropServices; 7 | using System.Collections.Generic; 8 | using System.Threading; 9 | 10 | public class ParsecTest : MonoBehaviour 11 | { 12 | [SerializeField] 13 | private ParsecGuestView parsecGuestView; 14 | 15 | public GameObject menu; 16 | 17 | public GameObject scene; 18 | 19 | public Button hostButton; 20 | public Button connectButton; 21 | 22 | public InputField sessionId; 23 | public InputField peerId; 24 | 25 | public Toggle tryCreateTextureToggle; 26 | 27 | public Text statusText; 28 | 29 | public enum Role { None, Host, Guest } 30 | 31 | private Parsec parsec; 32 | private Role role; 33 | 34 | private Texture2D viewportTexture; 35 | 36 | private ParsecFrameDecoder decoder; 37 | 38 | [Header("Debug")] 39 | public bool pollClientFrame; 40 | 41 | private void Awake() 42 | { 43 | hostButton.onClick.AddListener(Host); 44 | connectButton.onClick.AddListener(Connect); 45 | 46 | parsecGuestView.gameObject.SetActive(false); 47 | scene.SetActive(false); 48 | tryCreateTextureToggle.gameObject.SetActive(false); 49 | 50 | decoder = new ParsecFrameDecoder(); 51 | } 52 | 53 | private void OnValidate() 54 | { 55 | if (pollClientFrame && role == Role.Guest) 56 | { 57 | var status = parsec.ClientPollFrame(0, ClientReceiveFrame, 60); 58 | 59 | pollClientFrame = false; 60 | } 61 | } 62 | 63 | private void InitParsec() 64 | { 65 | parsec = new Parsec(); 66 | Parsec.ParsecStatus status = parsec.Init(); 67 | Debug.Log($"Parsec init: {status}"); 68 | 69 | sampleRate = (uint)AudioSettings.outputSampleRate; 70 | instance = this; 71 | //framePCMData = new List(); 72 | 73 | StartCoroutine(CheckStatus()); 74 | } 75 | 76 | private void OnDestroy() 77 | { 78 | if (parsec != null) 79 | { 80 | parsec.ParsecDestroy(); 81 | } 82 | 83 | pollAudio = false; 84 | } 85 | 86 | private void Host() 87 | { 88 | InitParsec(); 89 | 90 | role = Role.Host; 91 | 92 | var status = parsec.HostStart(Parsec.ParsecHostMode.HOST_GAME, sessionId.text); 93 | Debug.Log($"Parsec host: {status}"); 94 | StartCoroutine(SubmitFrame()); 95 | 96 | menu.SetActive(false); 97 | scene.SetActive(true); 98 | 99 | parsec.KeyboardInput += Parsec_KeyboardInput; 100 | parsec.MouseMotion += Parsec_MouseMotion; 101 | parsec.MouseButton += Parsec_MouseButton; 102 | } 103 | 104 | private void Parsec_MouseMotion(object sender, Parsec.ParsecGuest guest, Parsec.ParsecMouseMotionMessage mouseMotion) 105 | { 106 | // Debug.Log($"Guest {guest.id} moved mouse {mouseMotion.x}, {mouseMotion.y}"); 107 | } 108 | 109 | private void Parsec_MouseButton(object sender, Parsec.ParsecGuest guest, Parsec.ParsecMouseButtonMessage mouseButton) 110 | { 111 | Debug.Log($"Guest {guest.id} {(mouseButton.pressed ? "clicked" : "released")} key {mouseButton.button}"); 112 | } 113 | 114 | private void Parsec_KeyboardInput(object sender, Parsec.ParsecGuest guest, Parsec.ParsecKeyboardMessage keyboard) 115 | { 116 | Debug.Log($"Guest {guest.id} {(keyboard.pressed ? "pressed" : "released")} key {keyboard.code}"); 117 | } 118 | 119 | private void Connect() 120 | { 121 | InitParsec(); 122 | 123 | role = Role.Guest; 124 | 125 | Parsec.ParsecClientConfig defaultConfig = new Parsec.ParsecClientConfig() 126 | { 127 | mediaContainer = 0, 128 | protocol = 1, 129 | secret = "", 130 | pngCursor = false 131 | }; 132 | 133 | var status = parsec.ClientConnect(defaultConfig, sessionId.text, peerId.text); 134 | Debug.Log($"Parsec client: {status}"); 135 | 136 | parsecGuestView.gameObject.SetActive(true); 137 | menu.SetActive(false); 138 | tryCreateTextureToggle.gameObject.SetActive(true); 139 | 140 | gameObject.AddComponent().Initialize(parsec); 141 | 142 | #region Audio 143 | pcmData = new Queue(); 144 | 145 | AudioClip clip = AudioClip.Create("ParsecInput", 960, 2, 48000, true, OnAudioRead, OnAudioSetPosition); 146 | AudioSource source = GetComponent(); 147 | source.clip = clip; 148 | source.loop = true; 149 | source.Play(); 150 | 151 | Thread pollThread = new Thread(() => PollAudio()); 152 | pollThread.Start(); 153 | #endregion 154 | } 155 | 156 | public int position = 0; 157 | 158 | void OnAudioSetPosition(int newPosition) 159 | { 160 | position = newPosition; 161 | } 162 | 163 | private void OnAudioRead(float[] data) 164 | { 165 | if (pcmData.Count > 0) 166 | { 167 | var pcm = pcmData.Dequeue(); 168 | 169 | for (int i = 0; i < data.Length; i++) 170 | { 171 | data[i] = (float)pcm[i] / short.MaxValue; 172 | } 173 | } 174 | } 175 | 176 | private void Update() 177 | { 178 | if (role == Role.Guest && tryCreateTextureToggle.isOn) 179 | { 180 | parsec.ClientPollFrame(0, ClientReceiveFrame, 60); 181 | } 182 | 183 | if (role == Role.Host) 184 | { 185 | parsec.HostPollInput(); 186 | } 187 | } 188 | 189 | private void ClientReceiveFrame(Parsec.ParsecFrame frame, IntPtr image, IntPtr opaque) 190 | { 191 | // Debug.Log($"Frame received at {Time.time}. Format:{frame.format} Size:{frame.width}x{frame.height} ActualSize:{frame.fullWidth}x{frame.fullHeight} ByteSize:{frame.size}"); 192 | 193 | decoder.Decode(frame, image); 194 | 195 | Vector2 padding = new Vector2((float)frame.width / frame.fullWidth, (float)frame.height / frame.fullHeight); 196 | parsecGuestView.Populate(decoder.Y, decoder.U, decoder.V, padding, decoder.AspectRatio); 197 | } 198 | 199 | private IEnumerator CheckStatus() 200 | { 201 | while (true) 202 | { 203 | yield return null; 204 | 205 | string text; 206 | 207 | if (role == Role.Host) 208 | { 209 | parsec.HostGetStatus(out Parsec.ParsecHostStatus status); 210 | text = $"Host status\nGuests: {status.numGuests}\nRunning: {status.running}\nInvalid id:{status.invalidSessionID}"; 211 | } 212 | else 213 | { 214 | var status = parsec.ClientGetStatus(out Parsec.ParsecClientStatus clientStatus); 215 | text = $"Client status: {status}\nSelf guest status: {clientStatus.self.state}\nNet failure: {clientStatus.networkFailure}"; 216 | } 217 | 218 | statusText.text = text; 219 | } 220 | } 221 | 222 | private IEnumerator SubmitFrame() 223 | { 224 | while (true) 225 | { 226 | yield return new WaitForEndOfFrame(); 227 | 228 | //Debug.Log($"Submitting frame received at {Time.time}"); 229 | 230 | if (viewportTexture != null) 231 | Destroy(viewportTexture); 232 | 233 | viewportTexture = ScreenCapture.CaptureScreenshotAsTexture(1); 234 | UnityNative.UnitySubmitFrame(parsec.GetPointer(), viewportTexture.GetNativeTexturePtr()); 235 | GL.IssuePluginEvent(UnityNative.UnityGetRenderEventFunction(), 1); 236 | } 237 | } 238 | 239 | #region Audio Stuff 240 | private static ParsecTest instance; 241 | private uint sampleRate; 242 | 243 | //private System.Collections.Generic.List framePCMData; 244 | 245 | // private int audioCount = 2; 246 | // private int dataLength; 247 | 248 | public static void SubmitAudio(float[] data) 249 | { 250 | instance.SubmitAudioInternal(data); 251 | } 252 | 253 | private void SubmitAudioInternal(float[] data) 254 | { 255 | uint frames = (uint)(data.Length / 2); 256 | parsec.HostSubmitAudio(sampleRate, data, frames); 257 | 258 | Debug.Log($"Submitting audio at rate {sampleRate} for {frames} frames."); 259 | } 260 | 261 | private Queue pcmData; 262 | 263 | private void ClientReceiveAudio(IntPtr pcm, uint frames, IntPtr opaque) 264 | { 265 | short[] marshalledPCM = new short[frames * 2]; 266 | Marshal.Copy(pcm, marshalledPCM, 0, (int)frames * 2); 267 | pcmData.Enqueue(marshalledPCM); 268 | 269 | Debug.Log($"Audio received with frames {frames}"); 270 | } 271 | 272 | private bool pollAudio; 273 | 274 | private void PollAudio() 275 | { 276 | pollAudio = true; 277 | 278 | while (pollAudio) 279 | { 280 | // Audio polling is disabled on client for now. With the current Parsec dll, an error 281 | // is thrown when the PCM data is marshalled. Modifying the dll fixes this error. Will 282 | // leave this disabled until a new version of the dll has the error fixed. 283 | //parsec.ClientPollAudio(ClientReceiveAudio, 0u); 284 | Thread.Sleep(10); 285 | } 286 | } 287 | #endregion 288 | } -------------------------------------------------------------------------------- /Assets/ParsecUnity/Parsec/ParsecInputSystemMapping.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.InputSystem; 2 | using System.Collections.Generic; 3 | using ParsecGaming; 4 | using UnityEngine.InputSystem.Controls; 5 | 6 | public static class ParsecInputSystemMapping 7 | { 8 | public static readonly Dictionary Keys = new Dictionary() 9 | { 10 | { Parsec.ParsecKeycode.KEY_A, Key.A }, 11 | { Parsec.ParsecKeycode.KEY_B, Key.B }, 12 | { Parsec.ParsecKeycode.KEY_C, Key.C }, 13 | { Parsec.ParsecKeycode.KEY_D, Key.D }, 14 | { Parsec.ParsecKeycode.KEY_E, Key.E }, 15 | { Parsec.ParsecKeycode.KEY_F, Key.F }, 16 | { Parsec.ParsecKeycode.KEY_G, Key.G }, 17 | { Parsec.ParsecKeycode.KEY_H, Key.H }, 18 | { Parsec.ParsecKeycode.KEY_I, Key.I }, 19 | { Parsec.ParsecKeycode.KEY_J, Key.J }, 20 | { Parsec.ParsecKeycode.KEY_K, Key.K }, 21 | { Parsec.ParsecKeycode.KEY_L, Key.L }, 22 | { Parsec.ParsecKeycode.KEY_M, Key.M }, 23 | { Parsec.ParsecKeycode.KEY_N, Key.N }, 24 | { Parsec.ParsecKeycode.KEY_O, Key.O }, 25 | { Parsec.ParsecKeycode.KEY_P, Key.P }, 26 | { Parsec.ParsecKeycode.KEY_Q, Key.Q }, 27 | { Parsec.ParsecKeycode.KEY_R, Key.R }, 28 | { Parsec.ParsecKeycode.KEY_S, Key.S }, 29 | { Parsec.ParsecKeycode.KEY_T, Key.T }, 30 | { Parsec.ParsecKeycode.KEY_U, Key.U }, 31 | { Parsec.ParsecKeycode.KEY_V, Key.V }, 32 | { Parsec.ParsecKeycode.KEY_W, Key.W }, 33 | { Parsec.ParsecKeycode.KEY_X, Key.X }, 34 | { Parsec.ParsecKeycode.KEY_Y, Key.Y }, 35 | { Parsec.ParsecKeycode.KEY_Z, Key.Z }, 36 | 37 | { Parsec.ParsecKeycode.KEY_1, Key.Digit1 }, 38 | { Parsec.ParsecKeycode.KEY_2, Key.Digit2 }, 39 | { Parsec.ParsecKeycode.KEY_3, Key.Digit3 }, 40 | { Parsec.ParsecKeycode.KEY_4, Key.Digit4 }, 41 | { Parsec.ParsecKeycode.KEY_5, Key.Digit5 }, 42 | { Parsec.ParsecKeycode.KEY_6, Key.Digit6 }, 43 | { Parsec.ParsecKeycode.KEY_7, Key.Digit7 }, 44 | { Parsec.ParsecKeycode.KEY_8, Key.Digit8 }, 45 | { Parsec.ParsecKeycode.KEY_9, Key.Digit9 }, 46 | { Parsec.ParsecKeycode.KEY_0, Key.Digit0 }, 47 | 48 | { Parsec.ParsecKeycode.KEY_SPACE, Key.Space }, 49 | { Parsec.ParsecKeycode.KEY_ENTER, Key.Enter }, 50 | { Parsec.ParsecKeycode.KEY_TAB, Key.Tab }, 51 | { Parsec.ParsecKeycode.KEY_LSHIFT, Key.LeftShift }, 52 | { Parsec.ParsecKeycode.KEY_RSHIFT, Key.RightShift }, 53 | { Parsec.ParsecKeycode.KEY_LALT, Key.LeftAlt }, 54 | { Parsec.ParsecKeycode.KEY_RALT, Key.RightAlt }, 55 | { Parsec.ParsecKeycode.KEY_LCTRL, Key.LeftCtrl }, 56 | { Parsec.ParsecKeycode.KEY_RCTRL, Key.RightCtrl }, 57 | 58 | { Parsec.ParsecKeycode.KEY_UP, Key.UpArrow }, 59 | { Parsec.ParsecKeycode.KEY_DOWN, Key.DownArrow }, 60 | { Parsec.ParsecKeycode.KEY_RIGHT, Key.RightArrow }, 61 | { Parsec.ParsecKeycode.KEY_LEFT, Key.LeftArrow } 62 | }; 63 | 64 | public static Dictionary MouseButtons(Mouse mouse) 65 | { 66 | return new Dictionary() 67 | { 68 | { Parsec.ParsecMouseButton.MOUSE_L, mouse.leftButton }, 69 | { Parsec.ParsecMouseButton.MOUSE_R, mouse.rightButton }, 70 | { Parsec.ParsecMouseButton.MOUSE_MIDDLE, mouse.middleButton } 71 | }; 72 | } 73 | 74 | public static ButtonControl ParsecToMouseButton(Mouse mouse, Parsec.ParsecMouseButton button) 75 | { 76 | switch (button) 77 | { 78 | case Parsec.ParsecMouseButton.MOUSE_L: 79 | return mouse.leftButton; 80 | case Parsec.ParsecMouseButton.MOUSE_R: 81 | return mouse.rightButton; 82 | case Parsec.ParsecMouseButton.MOUSE_MIDDLE: 83 | return mouse.middleButton; 84 | default: 85 | return null; 86 | } 87 | } 88 | 89 | // TODO: Probably worth wrapping all this in a class that has a Gamepad injected. 90 | public static Dictionary GamepadButtons(Gamepad gamepad) 91 | { 92 | return new Dictionary() 93 | { 94 | // Ahh yes, the "A" button: https://images.pushsquare.com/a7c69ec3b5207/playstation-x-button-cross-xbox.original.jpg 95 | // (Parsec seems to match an Xbox controller layout.) 96 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_A, gamepad.buttonSouth }, 97 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_B, gamepad.buttonEast }, 98 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_X, gamepad.buttonWest }, 99 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_Y, gamepad.buttonNorth }, 100 | 101 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_LSHOULDER, gamepad.leftShoulder }, 102 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_RSHOULDER, gamepad.rightShoulder }, 103 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_LSTICK, gamepad.leftStickButton }, 104 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_RSTICK, gamepad.rightStickButton }, 105 | 106 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_DPAD_UP, gamepad.dpad.up }, 107 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_DPAD_DOWN, gamepad.dpad.down }, 108 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_DPAD_LEFT, gamepad.dpad.left }, 109 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_DPAD_RIGHT, gamepad.dpad.right }, 110 | 111 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_GUIDE, gamepad.startButton }, 112 | { Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_BACK, gamepad.selectButton } 113 | }; 114 | } 115 | 116 | public static Dictionary GamepadAxes(Gamepad gamepad) 117 | { 118 | return new Dictionary() 119 | { 120 | { Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_LX, gamepad.leftStick.x }, 121 | { Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_LY, gamepad.leftStick.y }, 122 | 123 | { Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_RX, gamepad.rightStick.x }, 124 | { Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_RY, gamepad.rightStick.y }, 125 | 126 | { Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_TRIGGERL, gamepad.leftTrigger }, 127 | { Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_TRIGGERR, gamepad.rightTrigger } 128 | }; 129 | } 130 | 131 | public static ButtonControl ParsecToGamepadButton(Gamepad gamepad, Parsec.ParsecGamepadButton button) 132 | { 133 | switch (button) 134 | { 135 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_A: 136 | return gamepad.buttonSouth; 137 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_B: 138 | return gamepad.buttonEast; 139 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_X: 140 | return gamepad.buttonWest; 141 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_Y: 142 | return gamepad.buttonNorth; 143 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_LSHOULDER: 144 | return gamepad.leftShoulder; 145 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_RSHOULDER: 146 | return gamepad.rightShoulder; 147 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_LSTICK: 148 | return gamepad.leftStickButton; 149 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_RSTICK: 150 | return gamepad.rightStickButton; 151 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_DPAD_UP: 152 | return gamepad.dpad.up; 153 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_DPAD_DOWN: 154 | return gamepad.dpad.down; 155 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_DPAD_LEFT: 156 | return gamepad.dpad.left; 157 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_DPAD_RIGHT: 158 | return gamepad.dpad.right; 159 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_GUIDE: 160 | return gamepad.startButton; 161 | case Parsec.ParsecGamepadButton.GAMEPAD_BUTTON_BACK: 162 | return gamepad.selectButton; 163 | default: 164 | return null; 165 | } 166 | } 167 | 168 | public static AxisControl ParsecToGamepadAxis(Gamepad gamepad, Parsec.ParsecGamepadAxis axis) 169 | { 170 | switch (axis) 171 | { 172 | case Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_LX: 173 | return gamepad.leftStick.x; 174 | case Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_LY: 175 | return gamepad.leftStick.y; 176 | case Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_RX: 177 | return gamepad.rightStick.x; 178 | case Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_RY: 179 | return gamepad.rightStick.y; 180 | case Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_TRIGGERL: 181 | return gamepad.leftTrigger; 182 | case Parsec.ParsecGamepadAxis.GAMEPAD_AXIS_TRIGGERR: 183 | return gamepad.rightTrigger; 184 | default: 185 | return null; 186 | } 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /Assets/Demo/Prefabs/Player.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &451223064689515130 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 451223064689515131} 12 | - component: {fileID: 451223064689515133} 13 | - component: {fileID: 451223064689515132} 14 | m_Layer: 0 15 | m_Name: Turret 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &451223064689515131 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 451223064689515130} 28 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0.743, z: 0} 30 | m_LocalScale: {x: 0.75, y: 0.5, z: 0.75} 31 | m_Children: 32 | - {fileID: 451223065796141984} 33 | m_Father: {fileID: 451223065104525629} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | --- !u!33 &451223064689515133 37 | MeshFilter: 38 | m_ObjectHideFlags: 0 39 | m_CorrespondingSourceObject: {fileID: 0} 40 | m_PrefabInstance: {fileID: 0} 41 | m_PrefabAsset: {fileID: 0} 42 | m_GameObject: {fileID: 451223064689515130} 43 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 44 | --- !u!23 &451223064689515132 45 | MeshRenderer: 46 | m_ObjectHideFlags: 0 47 | m_CorrespondingSourceObject: {fileID: 0} 48 | m_PrefabInstance: {fileID: 0} 49 | m_PrefabAsset: {fileID: 0} 50 | m_GameObject: {fileID: 451223064689515130} 51 | m_Enabled: 1 52 | m_CastShadows: 1 53 | m_ReceiveShadows: 1 54 | m_DynamicOccludee: 1 55 | m_MotionVectors: 1 56 | m_LightProbeUsage: 1 57 | m_ReflectionProbeUsage: 1 58 | m_RayTracingMode: 2 59 | m_RenderingLayerMask: 1 60 | m_RendererPriority: 0 61 | m_Materials: 62 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 63 | m_StaticBatchInfo: 64 | firstSubMesh: 0 65 | subMeshCount: 0 66 | m_StaticBatchRoot: {fileID: 0} 67 | m_ProbeAnchor: {fileID: 0} 68 | m_LightProbeVolumeOverride: {fileID: 0} 69 | m_ScaleInLightmap: 1 70 | m_ReceiveGI: 1 71 | m_PreserveUVs: 0 72 | m_IgnoreNormalsForChartDetection: 0 73 | m_ImportantGI: 0 74 | m_StitchLightmapSeams: 1 75 | m_SelectedEditorRenderState: 3 76 | m_MinimumChartSize: 4 77 | m_AutoUVMaxDistance: 0.5 78 | m_AutoUVMaxAngle: 89 79 | m_LightmapParameters: {fileID: 0} 80 | m_SortingLayerID: 0 81 | m_SortingLayer: 0 82 | m_SortingOrder: 0 83 | --- !u!1 &451223065104525628 84 | GameObject: 85 | m_ObjectHideFlags: 0 86 | m_CorrespondingSourceObject: {fileID: 0} 87 | m_PrefabInstance: {fileID: 0} 88 | m_PrefabAsset: {fileID: 0} 89 | serializedVersion: 6 90 | m_Component: 91 | - component: {fileID: 451223065104525629} 92 | - component: {fileID: -83300462333649018} 93 | - component: {fileID: 4682672134994259708} 94 | - component: {fileID: -923842325083925407} 95 | m_Layer: 0 96 | m_Name: Player 97 | m_TagString: Untagged 98 | m_Icon: {fileID: 0} 99 | m_NavMeshLayer: 0 100 | m_StaticEditorFlags: 0 101 | m_IsActive: 1 102 | --- !u!4 &451223065104525629 103 | Transform: 104 | m_ObjectHideFlags: 0 105 | m_CorrespondingSourceObject: {fileID: 0} 106 | m_PrefabInstance: {fileID: 0} 107 | m_PrefabAsset: {fileID: 0} 108 | m_GameObject: {fileID: 451223065104525628} 109 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 110 | m_LocalPosition: {x: 0, y: 0, z: 0} 111 | m_LocalScale: {x: 1, y: 1, z: 1} 112 | m_Children: 113 | - {fileID: 451223064689515131} 114 | - {fileID: 1768809625237768446} 115 | m_Father: {fileID: 0} 116 | m_RootOrder: 0 117 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 118 | --- !u!114 &-83300462333649018 119 | MonoBehaviour: 120 | m_ObjectHideFlags: 0 121 | m_CorrespondingSourceObject: {fileID: 0} 122 | m_PrefabInstance: {fileID: 0} 123 | m_PrefabAsset: {fileID: 0} 124 | m_GameObject: {fileID: 451223065104525628} 125 | m_Enabled: 1 126 | m_EditorHideFlags: 0 127 | m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} 128 | m_Name: 129 | m_EditorClassIdentifier: 130 | m_Actions: {fileID: -944628639613478452, guid: 70fa9a7ec7e50df4d89c87e172309dfa, 131 | type: 3} 132 | m_NotificationBehavior: 3 133 | m_UIInputModule: {fileID: 0} 134 | m_DeviceLostEvent: 135 | m_PersistentCalls: 136 | m_Calls: [] 137 | m_DeviceRegainedEvent: 138 | m_PersistentCalls: 139 | m_Calls: [] 140 | m_ControlsChangedEvent: 141 | m_PersistentCalls: 142 | m_Calls: [] 143 | m_ActionEvents: [] 144 | m_NeverAutoSwitchControlSchemes: 1 145 | m_DefaultControlScheme: 146 | m_DefaultActionMap: Player 147 | m_SplitScreenIndex: -1 148 | m_Camera: {fileID: 0} 149 | --- !u!114 &4682672134994259708 150 | MonoBehaviour: 151 | m_ObjectHideFlags: 0 152 | m_CorrespondingSourceObject: {fileID: 0} 153 | m_PrefabInstance: {fileID: 0} 154 | m_PrefabAsset: {fileID: 0} 155 | m_GameObject: {fileID: 451223065104525628} 156 | m_Enabled: 1 157 | m_EditorHideFlags: 0 158 | m_Script: {fileID: 11500000, guid: 43a678bebeda15a4e9b9ee7b729b5f1f, type: 3} 159 | m_Name: 160 | m_EditorClassIdentifier: 161 | turret: {fileID: 451223064689515131} 162 | chassis: {fileID: 1768809625237768446} 163 | speed: 4 164 | acceleration: 60 165 | turnSpeed: 1200 166 | projectilePrefab: {fileID: 6684483183727293225, guid: 8e53408690ee6f5408542efcbec476bb, 167 | type: 3} 168 | fireSpeed: 10 169 | --- !u!114 &-923842325083925407 170 | MonoBehaviour: 171 | m_ObjectHideFlags: 0 172 | m_CorrespondingSourceObject: {fileID: 0} 173 | m_PrefabInstance: {fileID: 0} 174 | m_PrefabAsset: {fileID: 0} 175 | m_GameObject: {fileID: 451223065104525628} 176 | m_Enabled: 1 177 | m_EditorHideFlags: 0 178 | m_Script: {fileID: 11500000, guid: ca791a9420448524cbb982bb6d1e63e9, type: 3} 179 | m_Name: 180 | m_EditorClassIdentifier: 181 | --- !u!1 &451223065796141999 182 | GameObject: 183 | m_ObjectHideFlags: 0 184 | m_CorrespondingSourceObject: {fileID: 0} 185 | m_PrefabInstance: {fileID: 0} 186 | m_PrefabAsset: {fileID: 0} 187 | serializedVersion: 6 188 | m_Component: 189 | - component: {fileID: 451223065796141984} 190 | - component: {fileID: 451223065796141986} 191 | - component: {fileID: 451223065796141985} 192 | m_Layer: 0 193 | m_Name: Nose 194 | m_TagString: Untagged 195 | m_Icon: {fileID: 0} 196 | m_NavMeshLayer: 0 197 | m_StaticEditorFlags: 0 198 | m_IsActive: 1 199 | --- !u!4 &451223065796141984 200 | Transform: 201 | m_ObjectHideFlags: 0 202 | m_CorrespondingSourceObject: {fileID: 0} 203 | m_PrefabInstance: {fileID: 0} 204 | m_PrefabAsset: {fileID: 0} 205 | m_GameObject: {fileID: 451223065796141999} 206 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 207 | m_LocalPosition: {x: 0, y: 0, z: 0.454} 208 | m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} 209 | m_Children: [] 210 | m_Father: {fileID: 451223064689515131} 211 | m_RootOrder: 0 212 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 213 | --- !u!33 &451223065796141986 214 | MeshFilter: 215 | m_ObjectHideFlags: 0 216 | m_CorrespondingSourceObject: {fileID: 0} 217 | m_PrefabInstance: {fileID: 0} 218 | m_PrefabAsset: {fileID: 0} 219 | m_GameObject: {fileID: 451223065796141999} 220 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 221 | --- !u!23 &451223065796141985 222 | MeshRenderer: 223 | m_ObjectHideFlags: 0 224 | m_CorrespondingSourceObject: {fileID: 0} 225 | m_PrefabInstance: {fileID: 0} 226 | m_PrefabAsset: {fileID: 0} 227 | m_GameObject: {fileID: 451223065796141999} 228 | m_Enabled: 1 229 | m_CastShadows: 1 230 | m_ReceiveShadows: 1 231 | m_DynamicOccludee: 1 232 | m_MotionVectors: 1 233 | m_LightProbeUsage: 1 234 | m_ReflectionProbeUsage: 1 235 | m_RayTracingMode: 2 236 | m_RenderingLayerMask: 1 237 | m_RendererPriority: 0 238 | m_Materials: 239 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 240 | m_StaticBatchInfo: 241 | firstSubMesh: 0 242 | subMeshCount: 0 243 | m_StaticBatchRoot: {fileID: 0} 244 | m_ProbeAnchor: {fileID: 0} 245 | m_LightProbeVolumeOverride: {fileID: 0} 246 | m_ScaleInLightmap: 1 247 | m_ReceiveGI: 1 248 | m_PreserveUVs: 0 249 | m_IgnoreNormalsForChartDetection: 0 250 | m_ImportantGI: 0 251 | m_StitchLightmapSeams: 1 252 | m_SelectedEditorRenderState: 3 253 | m_MinimumChartSize: 4 254 | m_AutoUVMaxDistance: 0.5 255 | m_AutoUVMaxAngle: 89 256 | m_LightmapParameters: {fileID: 0} 257 | m_SortingLayerID: 0 258 | m_SortingLayer: 0 259 | m_SortingOrder: 0 260 | --- !u!1 &8302631597798569982 261 | GameObject: 262 | m_ObjectHideFlags: 0 263 | m_CorrespondingSourceObject: {fileID: 0} 264 | m_PrefabInstance: {fileID: 0} 265 | m_PrefabAsset: {fileID: 0} 266 | serializedVersion: 6 267 | m_Component: 268 | - component: {fileID: 1768809625237768446} 269 | - component: {fileID: 4494686650776554948} 270 | - component: {fileID: 1466415851903466047} 271 | m_Layer: 0 272 | m_Name: Chassis 273 | m_TagString: Untagged 274 | m_Icon: {fileID: 0} 275 | m_NavMeshLayer: 0 276 | m_StaticEditorFlags: 0 277 | m_IsActive: 1 278 | --- !u!4 &1768809625237768446 279 | Transform: 280 | m_ObjectHideFlags: 0 281 | m_CorrespondingSourceObject: {fileID: 0} 282 | m_PrefabInstance: {fileID: 0} 283 | m_PrefabAsset: {fileID: 0} 284 | m_GameObject: {fileID: 8302631597798569982} 285 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 286 | m_LocalPosition: {x: 0, y: 0.25, z: 0} 287 | m_LocalScale: {x: 1, y: 0.5, z: 1} 288 | m_Children: [] 289 | m_Father: {fileID: 451223065104525629} 290 | m_RootOrder: 1 291 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 292 | --- !u!33 &4494686650776554948 293 | MeshFilter: 294 | m_ObjectHideFlags: 0 295 | m_CorrespondingSourceObject: {fileID: 0} 296 | m_PrefabInstance: {fileID: 0} 297 | m_PrefabAsset: {fileID: 0} 298 | m_GameObject: {fileID: 8302631597798569982} 299 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 300 | --- !u!23 &1466415851903466047 301 | MeshRenderer: 302 | m_ObjectHideFlags: 0 303 | m_CorrespondingSourceObject: {fileID: 0} 304 | m_PrefabInstance: {fileID: 0} 305 | m_PrefabAsset: {fileID: 0} 306 | m_GameObject: {fileID: 8302631597798569982} 307 | m_Enabled: 1 308 | m_CastShadows: 1 309 | m_ReceiveShadows: 1 310 | m_DynamicOccludee: 1 311 | m_MotionVectors: 1 312 | m_LightProbeUsage: 1 313 | m_ReflectionProbeUsage: 1 314 | m_RayTracingMode: 2 315 | m_RenderingLayerMask: 1 316 | m_RendererPriority: 0 317 | m_Materials: 318 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 319 | m_StaticBatchInfo: 320 | firstSubMesh: 0 321 | subMeshCount: 0 322 | m_StaticBatchRoot: {fileID: 0} 323 | m_ProbeAnchor: {fileID: 0} 324 | m_LightProbeVolumeOverride: {fileID: 0} 325 | m_ScaleInLightmap: 1 326 | m_ReceiveGI: 1 327 | m_PreserveUVs: 0 328 | m_IgnoreNormalsForChartDetection: 0 329 | m_ImportantGI: 0 330 | m_StitchLightmapSeams: 1 331 | m_SelectedEditorRenderState: 3 332 | m_MinimumChartSize: 4 333 | m_AutoUVMaxDistance: 0.5 334 | m_AutoUVMaxAngle: 89 335 | m_LightmapParameters: {fileID: 0} 336 | m_SortingLayerID: 0 337 | m_SortingLayer: 0 338 | m_SortingOrder: 0 339 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": { 4 | "version": "1.0.0", 5 | "depth": 0, 6 | "source": "builtin", 7 | "dependencies": {} 8 | }, 9 | "com.unity.2d.tilemap": { 10 | "version": "1.0.0", 11 | "depth": 0, 12 | "source": "builtin", 13 | "dependencies": {} 14 | }, 15 | "com.unity.ads": { 16 | "version": "3.4.9", 17 | "depth": 0, 18 | "source": "registry", 19 | "dependencies": { 20 | "com.unity.ugui": "1.0.0" 21 | }, 22 | "url": "https://packages.unity.com" 23 | }, 24 | "com.unity.analytics": { 25 | "version": "3.3.5", 26 | "depth": 0, 27 | "source": "registry", 28 | "dependencies": { 29 | "com.unity.ugui": "1.0.0" 30 | }, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.collab-proxy": { 34 | "version": "1.2.16", 35 | "depth": 0, 36 | "source": "registry", 37 | "dependencies": {}, 38 | "url": "https://packages.unity.com" 39 | }, 40 | "com.unity.ext.nunit": { 41 | "version": "1.0.0", 42 | "depth": 1, 43 | "source": "registry", 44 | "dependencies": {}, 45 | "url": "https://packages.unity.com" 46 | }, 47 | "com.unity.ide.rider": { 48 | "version": "1.1.4", 49 | "depth": 0, 50 | "source": "registry", 51 | "dependencies": { 52 | "com.unity.test-framework": "1.1.1" 53 | }, 54 | "url": "https://packages.unity.com" 55 | }, 56 | "com.unity.ide.vscode": { 57 | "version": "1.2.1", 58 | "depth": 0, 59 | "source": "registry", 60 | "dependencies": {}, 61 | "url": "https://packages.unity.com" 62 | }, 63 | "com.unity.inputsystem": { 64 | "version": "1.0.0", 65 | "depth": 0, 66 | "source": "registry", 67 | "dependencies": {}, 68 | "url": "https://packages.unity.com" 69 | }, 70 | "com.unity.multiplayer-hlapi": { 71 | "version": "1.0.6", 72 | "depth": 0, 73 | "source": "registry", 74 | "dependencies": { 75 | "nuget.mono-cecil": "0.1.6-preview" 76 | }, 77 | "url": "https://packages.unity.com" 78 | }, 79 | "com.unity.purchasing": { 80 | "version": "2.1.0", 81 | "depth": 0, 82 | "source": "registry", 83 | "dependencies": { 84 | "com.unity.ugui": "1.0.0" 85 | }, 86 | "url": "https://packages.unity.com" 87 | }, 88 | "com.unity.test-framework": { 89 | "version": "1.1.16", 90 | "depth": 0, 91 | "source": "registry", 92 | "dependencies": { 93 | "com.unity.ext.nunit": "1.0.0", 94 | "com.unity.modules.imgui": "1.0.0", 95 | "com.unity.modules.jsonserialize": "1.0.0" 96 | }, 97 | "url": "https://packages.unity.com" 98 | }, 99 | "com.unity.textmeshpro": { 100 | "version": "2.0.1", 101 | "depth": 0, 102 | "source": "registry", 103 | "dependencies": { 104 | "com.unity.ugui": "1.0.0" 105 | }, 106 | "url": "https://packages.unity.com" 107 | }, 108 | "com.unity.timeline": { 109 | "version": "1.2.6", 110 | "depth": 0, 111 | "source": "registry", 112 | "dependencies": {}, 113 | "url": "https://packages.unity.com" 114 | }, 115 | "com.unity.ugui": { 116 | "version": "1.0.0", 117 | "depth": 0, 118 | "source": "builtin", 119 | "dependencies": { 120 | "com.unity.modules.ui": "1.0.0", 121 | "com.unity.modules.imgui": "1.0.0" 122 | } 123 | }, 124 | "com.unity.xr.legacyinputhelpers": { 125 | "version": "2.1.4", 126 | "depth": 0, 127 | "source": "registry", 128 | "dependencies": {}, 129 | "url": "https://packages.unity.com" 130 | }, 131 | "nuget.mono-cecil": { 132 | "version": "0.1.6-preview", 133 | "depth": 1, 134 | "source": "registry", 135 | "dependencies": {}, 136 | "url": "https://packages.unity.com" 137 | }, 138 | "com.unity.modules.ai": { 139 | "version": "1.0.0", 140 | "depth": 0, 141 | "source": "builtin", 142 | "dependencies": {} 143 | }, 144 | "com.unity.modules.androidjni": { 145 | "version": "1.0.0", 146 | "depth": 0, 147 | "source": "builtin", 148 | "dependencies": {} 149 | }, 150 | "com.unity.modules.animation": { 151 | "version": "1.0.0", 152 | "depth": 0, 153 | "source": "builtin", 154 | "dependencies": {} 155 | }, 156 | "com.unity.modules.assetbundle": { 157 | "version": "1.0.0", 158 | "depth": 0, 159 | "source": "builtin", 160 | "dependencies": {} 161 | }, 162 | "com.unity.modules.audio": { 163 | "version": "1.0.0", 164 | "depth": 0, 165 | "source": "builtin", 166 | "dependencies": {} 167 | }, 168 | "com.unity.modules.cloth": { 169 | "version": "1.0.0", 170 | "depth": 0, 171 | "source": "builtin", 172 | "dependencies": { 173 | "com.unity.modules.physics": "1.0.0" 174 | } 175 | }, 176 | "com.unity.modules.director": { 177 | "version": "1.0.0", 178 | "depth": 0, 179 | "source": "builtin", 180 | "dependencies": { 181 | "com.unity.modules.audio": "1.0.0", 182 | "com.unity.modules.animation": "1.0.0" 183 | } 184 | }, 185 | "com.unity.modules.imageconversion": { 186 | "version": "1.0.0", 187 | "depth": 0, 188 | "source": "builtin", 189 | "dependencies": {} 190 | }, 191 | "com.unity.modules.imgui": { 192 | "version": "1.0.0", 193 | "depth": 0, 194 | "source": "builtin", 195 | "dependencies": {} 196 | }, 197 | "com.unity.modules.jsonserialize": { 198 | "version": "1.0.0", 199 | "depth": 0, 200 | "source": "builtin", 201 | "dependencies": {} 202 | }, 203 | "com.unity.modules.particlesystem": { 204 | "version": "1.0.0", 205 | "depth": 0, 206 | "source": "builtin", 207 | "dependencies": {} 208 | }, 209 | "com.unity.modules.physics": { 210 | "version": "1.0.0", 211 | "depth": 0, 212 | "source": "builtin", 213 | "dependencies": {} 214 | }, 215 | "com.unity.modules.physics2d": { 216 | "version": "1.0.0", 217 | "depth": 0, 218 | "source": "builtin", 219 | "dependencies": {} 220 | }, 221 | "com.unity.modules.screencapture": { 222 | "version": "1.0.0", 223 | "depth": 0, 224 | "source": "builtin", 225 | "dependencies": { 226 | "com.unity.modules.imageconversion": "1.0.0" 227 | } 228 | }, 229 | "com.unity.modules.subsystems": { 230 | "version": "1.0.0", 231 | "depth": 1, 232 | "source": "builtin", 233 | "dependencies": { 234 | "com.unity.modules.jsonserialize": "1.0.0" 235 | } 236 | }, 237 | "com.unity.modules.terrain": { 238 | "version": "1.0.0", 239 | "depth": 0, 240 | "source": "builtin", 241 | "dependencies": {} 242 | }, 243 | "com.unity.modules.terrainphysics": { 244 | "version": "1.0.0", 245 | "depth": 0, 246 | "source": "builtin", 247 | "dependencies": { 248 | "com.unity.modules.physics": "1.0.0", 249 | "com.unity.modules.terrain": "1.0.0" 250 | } 251 | }, 252 | "com.unity.modules.tilemap": { 253 | "version": "1.0.0", 254 | "depth": 0, 255 | "source": "builtin", 256 | "dependencies": { 257 | "com.unity.modules.physics2d": "1.0.0" 258 | } 259 | }, 260 | "com.unity.modules.ui": { 261 | "version": "1.0.0", 262 | "depth": 0, 263 | "source": "builtin", 264 | "dependencies": {} 265 | }, 266 | "com.unity.modules.uielements": { 267 | "version": "1.0.0", 268 | "depth": 0, 269 | "source": "builtin", 270 | "dependencies": { 271 | "com.unity.modules.imgui": "1.0.0", 272 | "com.unity.modules.jsonserialize": "1.0.0" 273 | } 274 | }, 275 | "com.unity.modules.umbra": { 276 | "version": "1.0.0", 277 | "depth": 0, 278 | "source": "builtin", 279 | "dependencies": {} 280 | }, 281 | "com.unity.modules.unityanalytics": { 282 | "version": "1.0.0", 283 | "depth": 0, 284 | "source": "builtin", 285 | "dependencies": { 286 | "com.unity.modules.unitywebrequest": "1.0.0", 287 | "com.unity.modules.jsonserialize": "1.0.0" 288 | } 289 | }, 290 | "com.unity.modules.unitywebrequest": { 291 | "version": "1.0.0", 292 | "depth": 0, 293 | "source": "builtin", 294 | "dependencies": {} 295 | }, 296 | "com.unity.modules.unitywebrequestassetbundle": { 297 | "version": "1.0.0", 298 | "depth": 0, 299 | "source": "builtin", 300 | "dependencies": { 301 | "com.unity.modules.assetbundle": "1.0.0", 302 | "com.unity.modules.unitywebrequest": "1.0.0" 303 | } 304 | }, 305 | "com.unity.modules.unitywebrequestaudio": { 306 | "version": "1.0.0", 307 | "depth": 0, 308 | "source": "builtin", 309 | "dependencies": { 310 | "com.unity.modules.unitywebrequest": "1.0.0", 311 | "com.unity.modules.audio": "1.0.0" 312 | } 313 | }, 314 | "com.unity.modules.unitywebrequesttexture": { 315 | "version": "1.0.0", 316 | "depth": 0, 317 | "source": "builtin", 318 | "dependencies": { 319 | "com.unity.modules.unitywebrequest": "1.0.0", 320 | "com.unity.modules.imageconversion": "1.0.0" 321 | } 322 | }, 323 | "com.unity.modules.unitywebrequestwww": { 324 | "version": "1.0.0", 325 | "depth": 0, 326 | "source": "builtin", 327 | "dependencies": { 328 | "com.unity.modules.unitywebrequest": "1.0.0", 329 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 330 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 331 | "com.unity.modules.audio": "1.0.0", 332 | "com.unity.modules.assetbundle": "1.0.0", 333 | "com.unity.modules.imageconversion": "1.0.0" 334 | } 335 | }, 336 | "com.unity.modules.vehicles": { 337 | "version": "1.0.0", 338 | "depth": 0, 339 | "source": "builtin", 340 | "dependencies": { 341 | "com.unity.modules.physics": "1.0.0" 342 | } 343 | }, 344 | "com.unity.modules.video": { 345 | "version": "1.0.0", 346 | "depth": 0, 347 | "source": "builtin", 348 | "dependencies": { 349 | "com.unity.modules.audio": "1.0.0", 350 | "com.unity.modules.ui": "1.0.0", 351 | "com.unity.modules.unitywebrequest": "1.0.0" 352 | } 353 | }, 354 | "com.unity.modules.vr": { 355 | "version": "1.0.0", 356 | "depth": 0, 357 | "source": "builtin", 358 | "dependencies": { 359 | "com.unity.modules.jsonserialize": "1.0.0", 360 | "com.unity.modules.physics": "1.0.0", 361 | "com.unity.modules.xr": "1.0.0" 362 | } 363 | }, 364 | "com.unity.modules.wind": { 365 | "version": "1.0.0", 366 | "depth": 0, 367 | "source": "builtin", 368 | "dependencies": {} 369 | }, 370 | "com.unity.modules.xr": { 371 | "version": "1.0.0", 372 | "depth": 0, 373 | "source": "builtin", 374 | "dependencies": { 375 | "com.unity.modules.physics": "1.0.0", 376 | "com.unity.modules.jsonserialize": "1.0.0", 377 | "com.unity.modules.subsystems": "1.0.0" 378 | } 379 | } 380 | } 381 | } 382 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/InputSystemExp.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 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: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_UseShadowmask: 1 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | debug: 122 | m_Flags: 0 123 | m_NavMeshData: {fileID: 0} 124 | --- !u!1 &550946384 125 | GameObject: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInstance: {fileID: 0} 129 | m_PrefabAsset: {fileID: 0} 130 | serializedVersion: 6 131 | m_Component: 132 | - component: {fileID: 550946387} 133 | - component: {fileID: 550946386} 134 | - component: {fileID: 550946385} 135 | m_Layer: 0 136 | m_Name: Main Camera 137 | m_TagString: MainCamera 138 | m_Icon: {fileID: 0} 139 | m_NavMeshLayer: 0 140 | m_StaticEditorFlags: 0 141 | m_IsActive: 1 142 | --- !u!81 &550946385 143 | AudioListener: 144 | m_ObjectHideFlags: 0 145 | m_CorrespondingSourceObject: {fileID: 0} 146 | m_PrefabInstance: {fileID: 0} 147 | m_PrefabAsset: {fileID: 0} 148 | m_GameObject: {fileID: 550946384} 149 | m_Enabled: 1 150 | --- !u!20 &550946386 151 | Camera: 152 | m_ObjectHideFlags: 0 153 | m_CorrespondingSourceObject: {fileID: 0} 154 | m_PrefabInstance: {fileID: 0} 155 | m_PrefabAsset: {fileID: 0} 156 | m_GameObject: {fileID: 550946384} 157 | m_Enabled: 1 158 | serializedVersion: 2 159 | m_ClearFlags: 1 160 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 161 | m_projectionMatrixMode: 1 162 | m_GateFitMode: 2 163 | m_FOVAxisMode: 0 164 | m_SensorSize: {x: 36, y: 24} 165 | m_LensShift: {x: 0, y: 0} 166 | m_FocalLength: 50 167 | m_NormalizedViewPortRect: 168 | serializedVersion: 2 169 | x: 0 170 | y: 0 171 | width: 1 172 | height: 1 173 | near clip plane: 0.3 174 | far clip plane: 1000 175 | field of view: 60 176 | orthographic: 0 177 | orthographic size: 5 178 | m_Depth: -1 179 | m_CullingMask: 180 | serializedVersion: 2 181 | m_Bits: 4294967295 182 | m_RenderingPath: -1 183 | m_TargetTexture: {fileID: 0} 184 | m_TargetDisplay: 0 185 | m_TargetEye: 3 186 | m_HDR: 1 187 | m_AllowMSAA: 1 188 | m_AllowDynamicResolution: 0 189 | m_ForceIntoRT: 0 190 | m_OcclusionCulling: 1 191 | m_StereoConvergence: 10 192 | m_StereoSeparation: 0.022 193 | --- !u!4 &550946387 194 | Transform: 195 | m_ObjectHideFlags: 0 196 | m_CorrespondingSourceObject: {fileID: 0} 197 | m_PrefabInstance: {fileID: 0} 198 | m_PrefabAsset: {fileID: 0} 199 | m_GameObject: {fileID: 550946384} 200 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 201 | m_LocalPosition: {x: 0, y: 1, z: -10} 202 | m_LocalScale: {x: 1, y: 1, z: 1} 203 | m_Children: [] 204 | m_Father: {fileID: 0} 205 | m_RootOrder: 0 206 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 207 | --- !u!1 &1276139720 208 | GameObject: 209 | m_ObjectHideFlags: 0 210 | m_CorrespondingSourceObject: {fileID: 0} 211 | m_PrefabInstance: {fileID: 0} 212 | m_PrefabAsset: {fileID: 0} 213 | serializedVersion: 6 214 | m_Component: 215 | - component: {fileID: 1276139725} 216 | - component: {fileID: 1276139724} 217 | - component: {fileID: 1276139723} 218 | - component: {fileID: 1276139722} 219 | - component: {fileID: 1276139721} 220 | m_Layer: 0 221 | m_Name: Cube 222 | m_TagString: Untagged 223 | m_Icon: {fileID: 0} 224 | m_NavMeshLayer: 0 225 | m_StaticEditorFlags: 0 226 | m_IsActive: 1 227 | --- !u!114 &1276139721 228 | MonoBehaviour: 229 | m_ObjectHideFlags: 0 230 | m_CorrespondingSourceObject: {fileID: 0} 231 | m_PrefabInstance: {fileID: 0} 232 | m_PrefabAsset: {fileID: 0} 233 | m_GameObject: {fileID: 1276139720} 234 | m_Enabled: 1 235 | m_EditorHideFlags: 0 236 | m_Script: {fileID: 11500000, guid: 4d5be48d7d211a84aafdfee1f5a52789, type: 3} 237 | m_Name: 238 | m_EditorClassIdentifier: 239 | executeFrame: 1 240 | doA: 1 241 | doB: 0 242 | pressedA: 0 243 | pressedB: 0 244 | --- !u!65 &1276139722 245 | BoxCollider: 246 | m_ObjectHideFlags: 0 247 | m_CorrespondingSourceObject: {fileID: 0} 248 | m_PrefabInstance: {fileID: 0} 249 | m_PrefabAsset: {fileID: 0} 250 | m_GameObject: {fileID: 1276139720} 251 | m_Material: {fileID: 0} 252 | m_IsTrigger: 0 253 | m_Enabled: 1 254 | serializedVersion: 2 255 | m_Size: {x: 1, y: 1, z: 1} 256 | m_Center: {x: 0, y: 0, z: 0} 257 | --- !u!23 &1276139723 258 | MeshRenderer: 259 | m_ObjectHideFlags: 0 260 | m_CorrespondingSourceObject: {fileID: 0} 261 | m_PrefabInstance: {fileID: 0} 262 | m_PrefabAsset: {fileID: 0} 263 | m_GameObject: {fileID: 1276139720} 264 | m_Enabled: 1 265 | m_CastShadows: 1 266 | m_ReceiveShadows: 1 267 | m_DynamicOccludee: 1 268 | m_MotionVectors: 1 269 | m_LightProbeUsage: 1 270 | m_ReflectionProbeUsage: 1 271 | m_RayTracingMode: 2 272 | m_RenderingLayerMask: 1 273 | m_RendererPriority: 0 274 | m_Materials: 275 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 276 | m_StaticBatchInfo: 277 | firstSubMesh: 0 278 | subMeshCount: 0 279 | m_StaticBatchRoot: {fileID: 0} 280 | m_ProbeAnchor: {fileID: 0} 281 | m_LightProbeVolumeOverride: {fileID: 0} 282 | m_ScaleInLightmap: 1 283 | m_ReceiveGI: 1 284 | m_PreserveUVs: 0 285 | m_IgnoreNormalsForChartDetection: 0 286 | m_ImportantGI: 0 287 | m_StitchLightmapSeams: 1 288 | m_SelectedEditorRenderState: 3 289 | m_MinimumChartSize: 4 290 | m_AutoUVMaxDistance: 0.5 291 | m_AutoUVMaxAngle: 89 292 | m_LightmapParameters: {fileID: 0} 293 | m_SortingLayerID: 0 294 | m_SortingLayer: 0 295 | m_SortingOrder: 0 296 | --- !u!33 &1276139724 297 | MeshFilter: 298 | m_ObjectHideFlags: 0 299 | m_CorrespondingSourceObject: {fileID: 0} 300 | m_PrefabInstance: {fileID: 0} 301 | m_PrefabAsset: {fileID: 0} 302 | m_GameObject: {fileID: 1276139720} 303 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 304 | --- !u!4 &1276139725 305 | Transform: 306 | m_ObjectHideFlags: 0 307 | m_CorrespondingSourceObject: {fileID: 0} 308 | m_PrefabInstance: {fileID: 0} 309 | m_PrefabAsset: {fileID: 0} 310 | m_GameObject: {fileID: 1276139720} 311 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 312 | m_LocalPosition: {x: 0, y: 0, z: 0} 313 | m_LocalScale: {x: 1, y: 1, z: 1} 314 | m_Children: [] 315 | m_Father: {fileID: 0} 316 | m_RootOrder: 2 317 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 318 | --- !u!1 &1973922051 319 | GameObject: 320 | m_ObjectHideFlags: 0 321 | m_CorrespondingSourceObject: {fileID: 0} 322 | m_PrefabInstance: {fileID: 0} 323 | m_PrefabAsset: {fileID: 0} 324 | serializedVersion: 6 325 | m_Component: 326 | - component: {fileID: 1973922053} 327 | - component: {fileID: 1973922052} 328 | m_Layer: 0 329 | m_Name: Directional Light 330 | m_TagString: Untagged 331 | m_Icon: {fileID: 0} 332 | m_NavMeshLayer: 0 333 | m_StaticEditorFlags: 0 334 | m_IsActive: 1 335 | --- !u!108 &1973922052 336 | Light: 337 | m_ObjectHideFlags: 0 338 | m_CorrespondingSourceObject: {fileID: 0} 339 | m_PrefabInstance: {fileID: 0} 340 | m_PrefabAsset: {fileID: 0} 341 | m_GameObject: {fileID: 1973922051} 342 | m_Enabled: 1 343 | serializedVersion: 10 344 | m_Type: 1 345 | m_Shape: 0 346 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 347 | m_Intensity: 1 348 | m_Range: 10 349 | m_SpotAngle: 30 350 | m_InnerSpotAngle: 21.80208 351 | m_CookieSize: 10 352 | m_Shadows: 353 | m_Type: 2 354 | m_Resolution: -1 355 | m_CustomResolution: -1 356 | m_Strength: 1 357 | m_Bias: 0.05 358 | m_NormalBias: 0.4 359 | m_NearPlane: 0.2 360 | m_CullingMatrixOverride: 361 | e00: 1 362 | e01: 0 363 | e02: 0 364 | e03: 0 365 | e10: 0 366 | e11: 1 367 | e12: 0 368 | e13: 0 369 | e20: 0 370 | e21: 0 371 | e22: 1 372 | e23: 0 373 | e30: 0 374 | e31: 0 375 | e32: 0 376 | e33: 1 377 | m_UseCullingMatrixOverride: 0 378 | m_Cookie: {fileID: 0} 379 | m_DrawHalo: 0 380 | m_Flare: {fileID: 0} 381 | m_RenderMode: 0 382 | m_CullingMask: 383 | serializedVersion: 2 384 | m_Bits: 4294967295 385 | m_RenderingLayerMask: 1 386 | m_Lightmapping: 4 387 | m_LightShadowCasterMode: 0 388 | m_AreaSize: {x: 1, y: 1} 389 | m_BounceIntensity: 1 390 | m_ColorTemperature: 6570 391 | m_UseColorTemperature: 0 392 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 393 | m_UseBoundingSphereOverride: 0 394 | m_ShadowRadius: 0 395 | m_ShadowAngle: 0 396 | --- !u!4 &1973922053 397 | Transform: 398 | m_ObjectHideFlags: 0 399 | m_CorrespondingSourceObject: {fileID: 0} 400 | m_PrefabInstance: {fileID: 0} 401 | m_PrefabAsset: {fileID: 0} 402 | m_GameObject: {fileID: 1973922051} 403 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 404 | m_LocalPosition: {x: 0, y: 3, z: 0} 405 | m_LocalScale: {x: 1, y: 1, z: 1} 406 | m_Children: [] 407 | m_Father: {fileID: 0} 408 | m_RootOrder: 1 409 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 410 | -------------------------------------------------------------------------------- /Assets/ParsecUnity/Experiments/AudioTest.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 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: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_UseShadowmask: 1 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | debug: 122 | m_Flags: 0 123 | m_NavMeshData: {fileID: 0} 124 | --- !u!1 &1459359929 125 | GameObject: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInstance: {fileID: 0} 129 | m_PrefabAsset: {fileID: 0} 130 | serializedVersion: 6 131 | m_Component: 132 | - component: {fileID: 1459359932} 133 | - component: {fileID: 1459359931} 134 | - component: {fileID: 1459359930} 135 | m_Layer: 0 136 | m_Name: AudioSampleTest 137 | m_TagString: Untagged 138 | m_Icon: {fileID: 0} 139 | m_NavMeshLayer: 0 140 | m_StaticEditorFlags: 0 141 | m_IsActive: 1 142 | --- !u!82 &1459359930 143 | AudioSource: 144 | m_ObjectHideFlags: 0 145 | m_CorrespondingSourceObject: {fileID: 0} 146 | m_PrefabInstance: {fileID: 0} 147 | m_PrefabAsset: {fileID: 0} 148 | m_GameObject: {fileID: 1459359929} 149 | m_Enabled: 1 150 | serializedVersion: 4 151 | OutputAudioMixerGroup: {fileID: 0} 152 | m_audioClip: {fileID: 0} 153 | m_PlayOnAwake: 1 154 | m_Volume: 1 155 | m_Pitch: 1 156 | Loop: 0 157 | Mute: 0 158 | Spatialize: 0 159 | SpatializePostEffects: 0 160 | Priority: 128 161 | DopplerLevel: 1 162 | MinDistance: 1 163 | MaxDistance: 500 164 | Pan2D: 0 165 | rolloffMode: 0 166 | BypassEffects: 0 167 | BypassListenerEffects: 0 168 | BypassReverbZones: 0 169 | rolloffCustomCurve: 170 | serializedVersion: 2 171 | m_Curve: 172 | - serializedVersion: 3 173 | time: 0 174 | value: 1 175 | inSlope: 0 176 | outSlope: 0 177 | tangentMode: 0 178 | weightedMode: 0 179 | inWeight: 0.33333334 180 | outWeight: 0.33333334 181 | - serializedVersion: 3 182 | time: 1 183 | value: 0 184 | inSlope: 0 185 | outSlope: 0 186 | tangentMode: 0 187 | weightedMode: 0 188 | inWeight: 0.33333334 189 | outWeight: 0.33333334 190 | m_PreInfinity: 2 191 | m_PostInfinity: 2 192 | m_RotationOrder: 4 193 | panLevelCustomCurve: 194 | serializedVersion: 2 195 | m_Curve: 196 | - serializedVersion: 3 197 | time: 0 198 | value: 0 199 | inSlope: 0 200 | outSlope: 0 201 | tangentMode: 0 202 | weightedMode: 0 203 | inWeight: 0.33333334 204 | outWeight: 0.33333334 205 | m_PreInfinity: 2 206 | m_PostInfinity: 2 207 | m_RotationOrder: 4 208 | spreadCustomCurve: 209 | serializedVersion: 2 210 | m_Curve: 211 | - serializedVersion: 3 212 | time: 0 213 | value: 0 214 | inSlope: 0 215 | outSlope: 0 216 | tangentMode: 0 217 | weightedMode: 0 218 | inWeight: 0.33333334 219 | outWeight: 0.33333334 220 | m_PreInfinity: 2 221 | m_PostInfinity: 2 222 | m_RotationOrder: 4 223 | reverbZoneMixCustomCurve: 224 | serializedVersion: 2 225 | m_Curve: 226 | - serializedVersion: 3 227 | time: 0 228 | value: 1 229 | inSlope: 0 230 | outSlope: 0 231 | tangentMode: 0 232 | weightedMode: 0 233 | inWeight: 0.33333334 234 | outWeight: 0.33333334 235 | m_PreInfinity: 2 236 | m_PostInfinity: 2 237 | m_RotationOrder: 4 238 | --- !u!114 &1459359931 239 | MonoBehaviour: 240 | m_ObjectHideFlags: 0 241 | m_CorrespondingSourceObject: {fileID: 0} 242 | m_PrefabInstance: {fileID: 0} 243 | m_PrefabAsset: {fileID: 0} 244 | m_GameObject: {fileID: 1459359929} 245 | m_Enabled: 1 246 | m_EditorHideFlags: 0 247 | m_Script: {fileID: 11500000, guid: b2671a9b73a34824d9f4e98a2ac660a4, type: 3} 248 | m_Name: 249 | m_EditorClassIdentifier: 250 | sampleCount: 960 251 | samplerate: 48000 252 | frequency: 440 253 | position: 0 254 | --- !u!4 &1459359932 255 | Transform: 256 | m_ObjectHideFlags: 0 257 | m_CorrespondingSourceObject: {fileID: 0} 258 | m_PrefabInstance: {fileID: 0} 259 | m_PrefabAsset: {fileID: 0} 260 | m_GameObject: {fileID: 1459359929} 261 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 262 | m_LocalPosition: {x: 414.42892, y: 206.80296, z: -70.09375} 263 | m_LocalScale: {x: 1, y: 1, z: 1} 264 | m_Children: [] 265 | m_Father: {fileID: 0} 266 | m_RootOrder: 2 267 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 268 | --- !u!1 &1577254366 269 | GameObject: 270 | m_ObjectHideFlags: 0 271 | m_CorrespondingSourceObject: {fileID: 0} 272 | m_PrefabInstance: {fileID: 0} 273 | m_PrefabAsset: {fileID: 0} 274 | serializedVersion: 6 275 | m_Component: 276 | - component: {fileID: 1577254369} 277 | - component: {fileID: 1577254368} 278 | - component: {fileID: 1577254367} 279 | m_Layer: 0 280 | m_Name: Main Camera 281 | m_TagString: MainCamera 282 | m_Icon: {fileID: 0} 283 | m_NavMeshLayer: 0 284 | m_StaticEditorFlags: 0 285 | m_IsActive: 1 286 | --- !u!81 &1577254367 287 | AudioListener: 288 | m_ObjectHideFlags: 0 289 | m_CorrespondingSourceObject: {fileID: 0} 290 | m_PrefabInstance: {fileID: 0} 291 | m_PrefabAsset: {fileID: 0} 292 | m_GameObject: {fileID: 1577254366} 293 | m_Enabled: 1 294 | --- !u!20 &1577254368 295 | Camera: 296 | m_ObjectHideFlags: 0 297 | m_CorrespondingSourceObject: {fileID: 0} 298 | m_PrefabInstance: {fileID: 0} 299 | m_PrefabAsset: {fileID: 0} 300 | m_GameObject: {fileID: 1577254366} 301 | m_Enabled: 1 302 | serializedVersion: 2 303 | m_ClearFlags: 1 304 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 305 | m_projectionMatrixMode: 1 306 | m_GateFitMode: 2 307 | m_FOVAxisMode: 0 308 | m_SensorSize: {x: 36, y: 24} 309 | m_LensShift: {x: 0, y: 0} 310 | m_FocalLength: 50 311 | m_NormalizedViewPortRect: 312 | serializedVersion: 2 313 | x: 0 314 | y: 0 315 | width: 1 316 | height: 1 317 | near clip plane: 0.3 318 | far clip plane: 1000 319 | field of view: 60 320 | orthographic: 0 321 | orthographic size: 5 322 | m_Depth: -1 323 | m_CullingMask: 324 | serializedVersion: 2 325 | m_Bits: 4294967295 326 | m_RenderingPath: -1 327 | m_TargetTexture: {fileID: 0} 328 | m_TargetDisplay: 0 329 | m_TargetEye: 3 330 | m_HDR: 1 331 | m_AllowMSAA: 1 332 | m_AllowDynamicResolution: 0 333 | m_ForceIntoRT: 0 334 | m_OcclusionCulling: 1 335 | m_StereoConvergence: 10 336 | m_StereoSeparation: 0.022 337 | --- !u!4 &1577254369 338 | Transform: 339 | m_ObjectHideFlags: 0 340 | m_CorrespondingSourceObject: {fileID: 0} 341 | m_PrefabInstance: {fileID: 0} 342 | m_PrefabAsset: {fileID: 0} 343 | m_GameObject: {fileID: 1577254366} 344 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 345 | m_LocalPosition: {x: 0, y: 1, z: -10} 346 | m_LocalScale: {x: 1, y: 1, z: 1} 347 | m_Children: [] 348 | m_Father: {fileID: 0} 349 | m_RootOrder: 0 350 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 351 | --- !u!1 &1625846438 352 | GameObject: 353 | m_ObjectHideFlags: 0 354 | m_CorrespondingSourceObject: {fileID: 0} 355 | m_PrefabInstance: {fileID: 0} 356 | m_PrefabAsset: {fileID: 0} 357 | serializedVersion: 6 358 | m_Component: 359 | - component: {fileID: 1625846440} 360 | - component: {fileID: 1625846439} 361 | m_Layer: 0 362 | m_Name: Directional Light 363 | m_TagString: Untagged 364 | m_Icon: {fileID: 0} 365 | m_NavMeshLayer: 0 366 | m_StaticEditorFlags: 0 367 | m_IsActive: 1 368 | --- !u!108 &1625846439 369 | Light: 370 | m_ObjectHideFlags: 0 371 | m_CorrespondingSourceObject: {fileID: 0} 372 | m_PrefabInstance: {fileID: 0} 373 | m_PrefabAsset: {fileID: 0} 374 | m_GameObject: {fileID: 1625846438} 375 | m_Enabled: 1 376 | serializedVersion: 10 377 | m_Type: 1 378 | m_Shape: 0 379 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 380 | m_Intensity: 1 381 | m_Range: 10 382 | m_SpotAngle: 30 383 | m_InnerSpotAngle: 21.80208 384 | m_CookieSize: 10 385 | m_Shadows: 386 | m_Type: 2 387 | m_Resolution: -1 388 | m_CustomResolution: -1 389 | m_Strength: 1 390 | m_Bias: 0.05 391 | m_NormalBias: 0.4 392 | m_NearPlane: 0.2 393 | m_CullingMatrixOverride: 394 | e00: 1 395 | e01: 0 396 | e02: 0 397 | e03: 0 398 | e10: 0 399 | e11: 1 400 | e12: 0 401 | e13: 0 402 | e20: 0 403 | e21: 0 404 | e22: 1 405 | e23: 0 406 | e30: 0 407 | e31: 0 408 | e32: 0 409 | e33: 1 410 | m_UseCullingMatrixOverride: 0 411 | m_Cookie: {fileID: 0} 412 | m_DrawHalo: 0 413 | m_Flare: {fileID: 0} 414 | m_RenderMode: 0 415 | m_CullingMask: 416 | serializedVersion: 2 417 | m_Bits: 4294967295 418 | m_RenderingLayerMask: 1 419 | m_Lightmapping: 4 420 | m_LightShadowCasterMode: 0 421 | m_AreaSize: {x: 1, y: 1} 422 | m_BounceIntensity: 1 423 | m_ColorTemperature: 6570 424 | m_UseColorTemperature: 0 425 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 426 | m_UseBoundingSphereOverride: 0 427 | m_ShadowRadius: 0 428 | m_ShadowAngle: 0 429 | --- !u!4 &1625846440 430 | Transform: 431 | m_ObjectHideFlags: 0 432 | m_CorrespondingSourceObject: {fileID: 0} 433 | m_PrefabInstance: {fileID: 0} 434 | m_PrefabAsset: {fileID: 0} 435 | m_GameObject: {fileID: 1625846438} 436 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 437 | m_LocalPosition: {x: 0, y: 3, z: 0} 438 | m_LocalScale: {x: 1, y: 1, z: 1} 439 | m_Children: [] 440 | m_Father: {fileID: 0} 441 | m_RootOrder: 1 442 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 443 | --------------------------------------------------------------------------------