├── .gitignore ├── Assets ├── Prototypes.meta └── Prototypes │ ├── 1-Viewing.meta │ ├── 1-Viewing │ ├── Models.meta │ ├── Models │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── bunny.mat │ │ │ ├── bunny.mat.meta │ │ │ ├── defaultMat.mat │ │ │ └── defaultMat.mat.meta │ │ ├── bunny.obj │ │ └── bunny.obj.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── Viewing-Mobile.meta │ │ ├── Viewing-Mobile.unity │ │ ├── Viewing-Mobile.unity.meta │ │ ├── Viewing-Mobile │ │ │ ├── LightingData.asset │ │ │ ├── LightingData.asset.meta │ │ │ ├── ReflectionProbe-0.exr │ │ │ └── ReflectionProbe-0.exr.meta │ │ ├── Viewing-PC.meta │ │ ├── Viewing-PC.unity │ │ ├── Viewing-PC.unity.meta │ │ └── Viewing-PC │ │ │ ├── LightingData.asset │ │ │ ├── LightingData.asset.meta │ │ │ ├── ReflectionProbe-0.exr │ │ │ └── ReflectionProbe-0.exr.meta │ └── Scripts.meta │ ├── 2-SimpleShooter.meta │ ├── 2-SimpleShooter │ ├── Materials.meta │ ├── Materials │ │ ├── WallMaterial.mat │ │ └── WallMaterial.mat.meta │ ├── Resources.meta │ ├── Resources │ │ ├── BulletMat.mat │ │ ├── BulletMat.mat.meta │ │ ├── BulletPrefab.prefab │ │ ├── BulletPrefab.prefab.meta │ │ ├── PlayerAvatar.prefab │ │ └── PlayerAvatar.prefab.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── SimpleShooter-Mobile.meta │ │ ├── SimpleShooter-Mobile.unity │ │ ├── SimpleShooter-Mobile.unity.meta │ │ ├── SimpleShooter-Mobile │ │ │ ├── LightingData.asset │ │ │ ├── LightingData.asset.meta │ │ │ ├── ReflectionProbe-0.exr │ │ │ └── ReflectionProbe-0.exr.meta │ │ ├── SimpleShooter-PC.meta │ │ ├── SimpleShooter-PC.unity │ │ ├── SimpleShooter-PC.unity.meta │ │ └── SimpleShooter-PC │ │ │ ├── LightingData.asset │ │ │ ├── LightingData.asset.meta │ │ │ ├── ReflectionProbe-0.exr │ │ │ └── ReflectionProbe-0.exr.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── BulletSpawn.cs │ │ ├── BulletSpawn.cs.meta │ │ ├── BulletStatus.cs │ │ ├── BulletStatus.cs.meta │ │ ├── MobileBulletSpawn.cs │ │ ├── MobileBulletSpawn.cs.meta │ │ ├── ShooterMobileResultUIController.cs │ │ ├── ShooterMobileResultUIController.cs.meta │ │ ├── ShooterPCResultUIController.cs │ │ ├── ShooterPCResultUIController.cs.meta │ │ ├── ShooterPlayerAvatar.cs │ │ ├── ShooterPlayerAvatar.cs.meta │ │ ├── ShooterPlayerColorTable.cs │ │ ├── ShooterPlayerColorTable.cs.meta │ │ ├── ShooterPlayerStatusManager.cs │ │ ├── ShooterPlayerStatusManager.cs.meta │ │ ├── ShooterResultReceiver.cs │ │ └── ShooterResultReceiver.cs.meta │ ├── Common.meta │ └── Common │ ├── Prefabs.meta │ ├── Prefabs │ ├── Mobile Camera Renderer.prefab │ ├── Mobile Camera Renderer.prefab.meta │ ├── Mobile Lobby UI.prefab │ ├── Mobile Lobby UI.prefab.meta │ ├── PC Lobby UI.prefab │ └── PC Lobby UI.prefab.meta │ ├── Scripts.meta │ └── Scripts │ ├── AndroidCameraRecorder.cs │ ├── AndroidCameraRecorder.cs.meta │ ├── ControllerModelSwap.cs │ ├── ControllerModelSwap.cs.meta │ ├── GameProgressController.cs │ ├── GameProgressController.cs.meta │ ├── GlobalEventDef.cs │ ├── GlobalEventDef.cs.meta │ ├── PlayTimeHandler.cs │ ├── PlayTimeHandler.cs.meta │ ├── SteamPoseUpdaterHelper.cs │ ├── SteamPoseUpdaterHelper.cs.meta │ ├── UI.meta │ ├── UI │ ├── MobileLobbyUIController.cs │ ├── MobileLobbyUIController.cs.meta │ ├── PCLobbyUIController.cs │ └── PCLobbyUIController.cs.meta │ ├── ViveShare.meta │ ├── ViveShare │ ├── Event.meta │ ├── Event │ │ ├── ViveShare_Event.cs │ │ ├── ViveShare_Event.cs.meta │ │ ├── ViveShare_EventDef.cs │ │ └── ViveShare_EventDef.cs.meta │ ├── Messages.meta │ ├── Messages │ │ ├── ViveShare_Message.cs │ │ ├── ViveShare_Message.cs.meta │ │ ├── ViveShare_MessageHandler.cs │ │ ├── ViveShare_MessageHandler.cs.meta │ │ ├── ViveShare_ParamMessage.cs │ │ └── ViveShare_ParamMessage.cs.meta │ ├── ParamSync.meta │ ├── ParamSync │ │ ├── ViveShare_SyncBase.cs │ │ ├── ViveShare_SyncBase.cs.meta │ │ ├── ViveShare_SyncIdentity.cs │ │ ├── ViveShare_SyncIdentity.cs.meta │ │ ├── ViveShare_SyncPose.cs │ │ └── ViveShare_SyncPose.cs.meta │ ├── Serialization.meta │ ├── Serialization │ │ ├── ViveShare_BinaryFormatter.cs │ │ ├── ViveShare_BinaryFormatter.cs.meta │ │ ├── ViveShare_Surrogates.cs │ │ └── ViveShare_Surrogates.cs.meta │ ├── ViveShare_Client.cs │ ├── ViveShare_Client.cs.meta │ ├── ViveShare_Server.cs │ ├── ViveShare_Server.cs.meta │ ├── ViveShare_Utils.cs │ └── ViveShare_Utils.cs.meta │ ├── ViveTrackerMapFileReader.cs │ └── ViveTrackerMapFileReader.cs.meta ├── ProjectSettings └── EditorSettings.asset ├── contributing.md ├── license.md └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | 7 | ProjectSettings/* 8 | !ProjectSettings/EditorSettings.asset 9 | 10 | Assets/* 11 | !Assets/Prototypes/ 12 | !Assets/Prototypes.meta 13 | 14 | *.cfg 15 | 16 | # Autogenerated VS/MD/Consulo solution and project files 17 | ExportedObj/ 18 | .consulo/ 19 | *.csproj 20 | *.unityproj 21 | *.sln 22 | *.suo 23 | *.tmp 24 | *.user 25 | *.userprefs 26 | *.pidb 27 | *.booproj 28 | *.svd 29 | 30 | # Unity3D generated meta files 31 | *.pidb.meta 32 | 33 | # Unity3D Generated File On Crash Reports 34 | sysinfo.txt 35 | 36 | # Builds 37 | *.apk 38 | *.unitypackage -------------------------------------------------------------------------------- /Assets/Prototypes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd4580fae5cb70146b2ede6097c92984 3 | folderAsset: yes 4 | timeCreated: 1490855560 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8834f9c90befa8e4b8b34fe8407ba2db 3 | folderAsset: yes 4 | timeCreated: 1490855626 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Models.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd201b41a4dc7ad4cb47ae7b022e4ed4 3 | folderAsset: yes 4 | timeCreated: 1490933013 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Models/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77bd2422eb366744a91ecf8eca92d5ab 3 | folderAsset: yes 4 | timeCreated: 1490933063 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Models/Materials/bunny.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/1-Viewing/Models/Materials/bunny.mat -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Models/Materials/bunny.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc27bfd0318e47a4bada392265086c38 3 | timeCreated: 1490933064 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Models/Materials/defaultMat.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/1-Viewing/Models/Materials/defaultMat.mat -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Models/Materials/defaultMat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc9ca4baf7c4dbc4aab3252d0f6a36c0 3 | timeCreated: 1490940920 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Models/bunny.obj.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ef535e1d2ec500458faf6ad99081df1 3 | timeCreated: 1490933064 4 | licenseType: Free 5 | ModelImporter: 6 | serializedVersion: 19 7 | fileIDToRecycleName: 8 | 100000: //RootNode 9 | 100002: default 10 | 400000: //RootNode 11 | 400002: default 12 | 2300000: default 13 | 3300000: default 14 | 4300000: default 15 | materials: 16 | importMaterials: 0 17 | materialName: 0 18 | materialSearch: 1 19 | animations: 20 | legacyGenerateAnimations: 4 21 | bakeSimulation: 0 22 | resampleCurves: 1 23 | optimizeGameObjects: 0 24 | motionNodeName: 25 | animationImportErrors: 26 | animationImportWarnings: 27 | animationRetargetingWarnings: 28 | animationDoRetargetingWarnings: 0 29 | animationCompression: 1 30 | animationRotationError: 0.5 31 | animationPositionError: 0.5 32 | animationScaleError: 0.5 33 | animationWrapMode: 0 34 | extraExposedTransformPaths: [] 35 | clipAnimations: [] 36 | isReadable: 1 37 | meshes: 38 | lODScreenPercentages: [] 39 | globalScale: 1 40 | meshCompression: 0 41 | addColliders: 0 42 | importBlendShapes: 1 43 | swapUVChannels: 0 44 | generateSecondaryUV: 0 45 | useFileUnits: 1 46 | optimizeMeshForGPU: 1 47 | keepQuads: 0 48 | weldVertices: 1 49 | secondaryUVAngleDistortion: 8 50 | secondaryUVAreaDistortion: 15.000001 51 | secondaryUVHardAngle: 88 52 | secondaryUVPackMargin: 4 53 | useFileScale: 1 54 | tangentSpace: 55 | normalSmoothAngle: 60 56 | normalImportMode: 0 57 | tangentImportMode: 3 58 | importAnimation: 1 59 | copyAvatar: 0 60 | humanDescription: 61 | serializedVersion: 2 62 | human: [] 63 | skeleton: [] 64 | armTwist: 0.5 65 | foreArmTwist: 0.5 66 | upperLegTwist: 0.5 67 | legTwist: 0.5 68 | armStretch: 0.05 69 | legStretch: 0.05 70 | feetSpacing: 0 71 | rootMotionBoneName: 72 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 73 | hasTranslationDoF: 0 74 | hasExtraRoot: 0 75 | skeletonHasParents: 1 76 | lastHumanDescriptionAvatarSource: {instanceID: 0} 77 | animationType: 0 78 | humanoidOversampling: 1 79 | additionalBone: 0 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6183bebdd6979d47a75138a82ca42a2 3 | folderAsset: yes 4 | timeCreated: 1490933003 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bda333658adb84646bfa8b6ad111832c 3 | folderAsset: yes 4 | timeCreated: 1490933482 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile.unity -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d6cae05b80bfa8439dee10b050c1765 3 | timeCreated: 1490933317 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile/LightingData.asset -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae18854aff2417849908251f414d6821 3 | timeCreated: 1490933496 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-Mobile/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9213df344822ead48af213de0b1478dd 3 | timeCreated: 1490933496 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 8900000: generatedCubemap 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 1 12 | sRGBTexture: 1 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 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 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 1 27 | seamlessCubemap: 1 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | filterMode: 2 32 | aniso: 0 33 | mipBias: 0 34 | wrapMode: 1 35 | nPOTScale: 1 36 | lightmap: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: 0.5, y: 0.5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaUsage: 1 46 | alphaIsTransparency: 0 47 | spriteTessellationDetail: -1 48 | textureType: 0 49 | textureShape: 2 50 | maxTextureSizeSet: 0 51 | compressionQualitySet: 0 52 | textureFormatSet: 0 53 | platformSettings: 54 | - buildTarget: DefaultTexturePlatform 55 | maxTextureSize: 2048 56 | textureFormat: -1 57 | textureCompression: 1 58 | compressionQuality: 100 59 | crunchedCompression: 0 60 | allowsAlphaSplitting: 0 61 | overridden: 0 62 | spriteSheet: 63 | serializedVersion: 2 64 | sprites: [] 65 | outline: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | assetBundleVariant: 70 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-PC.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6e9ea243ac428d47b14fdd54091b219 3 | folderAsset: yes 4 | timeCreated: 1490933553 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-PC.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/1-Viewing/Scenes/Viewing-PC.unity -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-PC.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de1698d45d7b66d4fa2e45235c29cc59 3 | timeCreated: 1490933075 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-PC/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/1-Viewing/Scenes/Viewing-PC/LightingData.asset -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-PC/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e612fc2615f7eb142bdf3430de01cd6f 3 | timeCreated: 1490933554 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-PC/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/1-Viewing/Scenes/Viewing-PC/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scenes/Viewing-PC/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df259a169b406494e89d28d9ce3cd7cb 3 | timeCreated: 1490933554 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 8900000: generatedCubemap 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 1 12 | sRGBTexture: 1 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 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 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 1 27 | seamlessCubemap: 1 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | filterMode: 2 32 | aniso: 0 33 | mipBias: 0 34 | wrapMode: 1 35 | nPOTScale: 1 36 | lightmap: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: 0.5, y: 0.5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaUsage: 1 46 | alphaIsTransparency: 0 47 | spriteTessellationDetail: -1 48 | textureType: 0 49 | textureShape: 2 50 | maxTextureSizeSet: 0 51 | compressionQualitySet: 0 52 | textureFormatSet: 0 53 | platformSettings: 54 | - buildTarget: DefaultTexturePlatform 55 | maxTextureSize: 2048 56 | textureFormat: -1 57 | textureCompression: 1 58 | compressionQuality: 100 59 | crunchedCompression: 0 60 | allowsAlphaSplitting: 0 61 | overridden: 0 62 | spriteSheet: 63 | serializedVersion: 2 64 | sprites: [] 65 | outline: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | assetBundleVariant: 70 | -------------------------------------------------------------------------------- /Assets/Prototypes/1-Viewing/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ef671588a764ac4293bf5deddcfadbe 3 | folderAsset: yes 4 | timeCreated: 1490933008 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 747d271d0c1777c49945fe6c1b29c069 3 | folderAsset: yes 4 | timeCreated: 1490855633 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfeb377e81a4d1540b40840b7bd28736 3 | folderAsset: yes 4 | timeCreated: 1490926404 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Materials/WallMaterial.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Materials/WallMaterial.mat -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Materials/WallMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 148a1dae78b694e40ad5da54280ebc17 3 | timeCreated: 1490926400 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ad812b9e4fd4b54b9ba2e499d0168ea 3 | folderAsset: yes 4 | timeCreated: 1490924731 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Resources/BulletMat.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Resources/BulletMat.mat -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Resources/BulletMat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f359ecb4ac3bb99428afdd9a9d337ebf 3 | timeCreated: 1490148586 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Resources/BulletPrefab.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Resources/BulletPrefab.prefab -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Resources/BulletPrefab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd48f0ad4597ed147a4cafb33e2a9fc2 3 | timeCreated: 1490148586 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Resources/PlayerAvatar.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Resources/PlayerAvatar.prefab -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Resources/PlayerAvatar.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7faa3b424ab81ae4d8b3008c1e374e9f 3 | timeCreated: 1490925037 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c90a7ae5fba07949a76224ec1317ea1 3 | folderAsset: yes 4 | timeCreated: 1490921449 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed6470c4436c1474eb02a31d566cff7c 3 | folderAsset: yes 4 | timeCreated: 1490927478 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile.unity -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4688220869ad8d6489a7498b011aab2f 3 | timeCreated: 1490927246 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile/LightingData.asset -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f12bc27db6accb94c9cdc323eff13128 3 | timeCreated: 1490927479 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-Mobile/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 174a0587e7604594f9451c61b8d764d3 3 | timeCreated: 1490927479 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 8900000: generatedCubemap 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 1 12 | sRGBTexture: 1 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 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 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 1 27 | seamlessCubemap: 1 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | filterMode: 2 32 | aniso: 0 33 | mipBias: 0 34 | wrapMode: 1 35 | nPOTScale: 1 36 | lightmap: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: 0.5, y: 0.5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaUsage: 1 46 | alphaIsTransparency: 0 47 | spriteTessellationDetail: -1 48 | textureType: 0 49 | textureShape: 2 50 | maxTextureSizeSet: 0 51 | compressionQualitySet: 0 52 | textureFormatSet: 0 53 | platformSettings: 54 | - buildTarget: DefaultTexturePlatform 55 | maxTextureSize: 2048 56 | textureFormat: -1 57 | textureCompression: 1 58 | compressionQuality: 100 59 | crunchedCompression: 0 60 | allowsAlphaSplitting: 0 61 | overridden: 0 62 | spriteSheet: 63 | serializedVersion: 2 64 | sprites: [] 65 | outline: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | assetBundleVariant: 70 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 266392bf04e605044b73655bac41ad93 3 | folderAsset: yes 4 | timeCreated: 1490927486 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC.unity -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df8888fec395165428911313f76db6cf 3 | timeCreated: 1490921000 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC/LightingData.asset -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cde6a1d4a5677f54782f5a093736c5aa 3 | timeCreated: 1490927487 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scenes/SimpleShooter-PC/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd868bae8401b224db4360425e27e27a 3 | timeCreated: 1490927487 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 8900000: generatedCubemap 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 1 12 | sRGBTexture: 1 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 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 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 1 27 | seamlessCubemap: 1 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | filterMode: 2 32 | aniso: 0 33 | mipBias: 0 34 | wrapMode: 1 35 | nPOTScale: 1 36 | lightmap: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: 0.5, y: 0.5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaUsage: 1 46 | alphaIsTransparency: 0 47 | spriteTessellationDetail: -1 48 | textureType: 0 49 | textureShape: 2 50 | maxTextureSizeSet: 0 51 | compressionQualitySet: 0 52 | textureFormatSet: 0 53 | platformSettings: 54 | - buildTarget: DefaultTexturePlatform 55 | maxTextureSize: 2048 56 | textureFormat: -1 57 | textureCompression: 1 58 | compressionQuality: 100 59 | crunchedCompression: 0 60 | allowsAlphaSplitting: 0 61 | overridden: 0 62 | spriteSheet: 63 | serializedVersion: 2 64 | sprites: [] 65 | outline: [] 66 | spritePackingTag: 67 | userData: 68 | assetBundleName: 69 | assetBundleVariant: 70 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 066e51fb8b3725d4e8a4fa58cf011beb 3 | folderAsset: yes 4 | timeCreated: 1490921454 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/BulletSpawn.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using HTC.UnityPlugin.PoseTracker; 4 | using HTC.UnityPlugin.Vive; 5 | using HTC.UnityPlugin.ViveShare; 6 | using UnityEngine; 7 | 8 | public class BulletSpawn : MonoBehaviour 9 | { 10 | public ShooterPlayerStatusManager playerManager; 11 | 12 | public GameObject bulletPrefab; 13 | 14 | public float coolTime = 0.25f; 15 | public float bulletSpeed = 4.0f; 16 | public float fireOffset = 0.4f; 17 | 18 | public Collider[] wallCollider; 19 | 20 | private float lastFireTime; 21 | 22 | private void OnEnable() 23 | { 24 | ViveShare_Event.bulletSpawnEvent.Listen(Spawn); 25 | } 26 | 27 | private void OnDisable() 28 | { 29 | ViveShare_Event.bulletSpawnEvent.Remove(Spawn); 30 | } 31 | 32 | private void Update() 33 | { 34 | if (ViveInput.GetPressDownEx(HandRole.RightHand, ControllerButton.Trigger)) 35 | { 36 | if (Time.time - lastFireTime < coolTime) 37 | { 38 | return; 39 | } 40 | 41 | Pose pose = VivePose.GetPose(HandRole.RightHand); 42 | Vector3 position = pose.pos; 43 | Vector3 forward = pose.rot * Vector3.forward; 44 | Spawn(position, forward, 0); 45 | 46 | lastFireTime = Time.time; 47 | } 48 | } 49 | 50 | void Spawn(Vector3 pt, Vector3 dir, int sourcePlayer) 51 | { 52 | // offset bullet a little to avoid colliding with camera 53 | Vector3 offsetPos = pt + dir.normalized * fireOffset; 54 | 55 | // calculate bullet velocity 56 | Vector3 bullectVelocity = bulletSpeed * dir.normalized; 57 | 58 | // calculate prefab rotation 59 | Vector3 rotationAxis = Vector3.Cross(Vector3.forward, dir); 60 | float rotationAngle = Vector3.Angle(Vector3.forward, dir); 61 | Quaternion quat = Quaternion.AngleAxis(rotationAngle, rotationAxis); 62 | 63 | // spawn the bullet and set its color 64 | int counter = playerManager.playerStatusDic[sourcePlayer].bulletCounter++; 65 | string objID = "[" + sourcePlayer + "] Bullet " + counter++; 66 | GameObject spawnedObj = ViveShare_Server.Instance.Spawn(bulletPrefab, objID, offsetPos, quat); 67 | 68 | spawnedObj.GetComponent().material.SetColor("_Color", ShooterPlayerColorTable.colorTable[sourcePlayer]); 69 | spawnedObj.GetComponent().material.SetColor("_EmissionColor", ShooterPlayerColorTable.colorTable[sourcePlayer]); 70 | 71 | // set bullet param for clients 72 | ViveShare_Event.setBulletParamEvent.InvokeRemote(objID, bullectVelocity, ShooterPlayerColorTable.colorTable[sourcePlayer]); 73 | 74 | // attach bullet controller to spawned bullet 75 | BulletStatus status = spawnedObj.AddComponent(); 76 | status.SetSource(sourcePlayer); 77 | status.SetPlayerStatusManager(playerManager); 78 | status.SetWallCollider(wallCollider); 79 | 80 | // set bullet property 81 | Rigidbody physics = spawnedObj.GetComponent(); 82 | physics.velocity = bullectVelocity; 83 | physics.AddForce(bullectVelocity, ForceMode.Force); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/BulletSpawn.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58b02cbc045fd4e45a37d44507541a13 3 | timeCreated: 1490924661 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/BulletStatus.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | using HTC.UnityPlugin.ViveShare; 5 | 6 | public class BulletStatus : MonoBehaviour 7 | { 8 | private int source = 0; 9 | 10 | private float startTime; 11 | private static float lifeTime = 2.0f; 12 | 13 | private ShooterPlayerStatusManager playerStatusMgr; 14 | private Collider[] wallCollider; 15 | 16 | void Start() 17 | { 18 | startTime = Time.time; 19 | } 20 | 21 | void Update() 22 | { 23 | // if lifetime ended, despawn this bullet 24 | if (Time.time - startTime > BulletStatus.lifeTime) 25 | { 26 | ViveShare_Server.Instance.UnSpawn(gameObject); 27 | } 28 | } 29 | 30 | public void OnTriggerEnter(Collider other) 31 | { 32 | if (other.GetComponentInParent() != null) 33 | { 34 | playerStatusMgr.AddBulletHitScore(source); 35 | ViveShare_Server.Instance.UnSpawn(gameObject); 36 | return; 37 | } 38 | 39 | foreach (Collider collider in wallCollider) 40 | { 41 | if(collider == other) 42 | { 43 | ViveShare_Server.Instance.UnSpawn(gameObject); 44 | return; 45 | } 46 | } 47 | } 48 | 49 | public void SetSource(int val) 50 | { 51 | source = val; 52 | } 53 | 54 | public void SetPlayerStatusManager(ShooterPlayerStatusManager mgr) 55 | { 56 | playerStatusMgr = mgr; 57 | } 58 | 59 | public void SetWallCollider(Collider[] collider) 60 | { 61 | wallCollider = collider; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/BulletStatus.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00127f68c13cddc4bae0a512339f7cfe 3 | timeCreated: 1490925197 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/MobileBulletSpawn.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | using HTC.UnityPlugin.ViveShare; 5 | 6 | public class MobileBulletSpawn : MonoBehaviour 7 | { 8 | public float coolTime = 0.25f; 9 | 10 | private float lastTapTime; 11 | 12 | private void OnEnable() 13 | { 14 | ViveShare_Event.setBulletParamEvent.Listen(OnSetBulletParam); 15 | } 16 | 17 | private void OnDisable() 18 | { 19 | ViveShare_Event.setBulletParamEvent.Remove(OnSetBulletParam); 20 | } 21 | 22 | public void OnBulletSpawnBtnPressed() 23 | { 24 | if (Time.time - lastTapTime < coolTime) 25 | { 26 | return; 27 | } 28 | 29 | ViveShare_Event.bulletSpawnEvent.InvokeRemote( 30 | Camera.main.transform.position, 31 | Camera.main.transform.forward, 32 | ViveShare_Client.Instance.GetClientId()); 33 | 34 | lastTapTime = Time.time; 35 | } 36 | 37 | private void OnSetBulletParam(string id, Vector3 vel, Color color) 38 | { 39 | GameObject go = GameObject.Find(id); 40 | if (go == null) { return; } 41 | 42 | go.GetComponent().material.SetColor("_Color", color); 43 | go.GetComponent().material.SetColor("_EmissionColor", color); 44 | 45 | Rigidbody rigidBody = go.GetComponent(); 46 | if (rigidBody != null) 47 | { 48 | rigidBody.velocity = vel; 49 | rigidBody.AddForce(vel, ForceMode.Force); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/MobileBulletSpawn.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a0bfdd178826a64a8fd0a2fb86f1810 3 | timeCreated: 1490927545 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterMobileResultUIController.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using HTC.UnityPlugin.ViveShare; 6 | using UnityEngine.Events; 7 | 8 | public class ShooterMobileResultUIController : MonoBehaviour 9 | { 10 | public Text resultText; 11 | public ShooterResultReceiver resultReceiver; 12 | 13 | public void Update() 14 | { 15 | if (resultReceiver.playerNum > 0 && resultReceiver.scoreCoutner == resultReceiver.playerNum) 16 | { 17 | string resultStr = "Host: " + resultReceiver.scoreList[0].ToString() + "\n"; 18 | for (int i = 1; i < resultReceiver.playerNum; i++) 19 | { 20 | resultStr += "P" + i + ": " + resultReceiver.scoreList[i].ToString() + "\n"; 21 | } 22 | 23 | resultText.text = resultStr; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterMobileResultUIController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44c11cbc6101dae469973d9f1d3398a3 3 | timeCreated: 1490928315 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterPCResultUIController.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using HTC.UnityPlugin.ViveShare; 6 | 7 | public class ShooterPCResultUIController : MonoBehaviour 8 | { 9 | public ShooterPlayerStatusManager statusManager; 10 | public Text resultText; 11 | 12 | void OnEnable() 13 | { 14 | ViveShare_Event.numberOfPlayerEvent.InvokeRemote(statusManager.playerStatusList.Count); 15 | ViveShare_Event.scoreBroadcastEvent.InvokeRemote(statusManager.playerStatusList[0].score); 16 | 17 | string resultStr = "Host: " + statusManager.playerStatusList[0].score.ToString() + "\n"; 18 | for (int i = 1; i < statusManager.playerStatusList.Count; i++) 19 | { 20 | ShooterPlayerStatusManager.PlayerStatus status = statusManager.playerStatusList[i]; 21 | 22 | ViveShare_Event.scoreBroadcastEvent.InvokeRemote(status.score); 23 | resultStr += "P" + i + ": " + status.score.ToString() + "\n"; 24 | } 25 | 26 | resultText.text = resultStr; 27 | } 28 | 29 | public void OnButtonPressed() 30 | { 31 | ViveShare_Server.Instance.ShutdownServer(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterPCResultUIController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d667137ad965a34d8af78b48ca18e33 3 | timeCreated: 1490926895 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterPlayerAvatar.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | 5 | public class ShooterPlayerAvatar : MonoBehaviour 6 | { 7 | public int id; 8 | } 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterPlayerAvatar.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b45b5a3240daab54d8488fd0fd0a5cdf 3 | timeCreated: 1490924808 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterPlayerColorTable.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | 5 | public class ShooterPlayerColorTable 6 | { 7 | public static Color[] colorTable = 8 | { 9 | new Color(1.0f, 0.0f, 0.0f, 1.0f), 10 | new Color(1.0f, 1.0f, 0.0f, 1.0f), 11 | new Color(0.0f, 1.0f, 0.0f, 1.0f), 12 | new Color(0.0f, 0.0f, 1.0f, 1.0f) 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterPlayerColorTable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79a4f9d95459d5448b1bac749449d437 3 | timeCreated: 1490924862 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterPlayerStatusManager.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using HTC.UnityPlugin.Vive; 6 | using HTC.UnityPlugin.ViveShare; 7 | 8 | public class ShooterPlayerStatusManager : MonoBehaviour 9 | { 10 | public GameObject cameraRig; 11 | public GameObject playerAvatarPrefab; 12 | 13 | public int hitPlayerScore = 10; 14 | 15 | public class PlayerStatus 16 | { 17 | public PlayerStatus() 18 | { 19 | avatar = null; 20 | bulletCounter = 0; 21 | score = 0; 22 | } 23 | 24 | public GameObject avatar; 25 | public int bulletCounter; 26 | public int score; 27 | } 28 | public List playerStatusList = new List(); 29 | public Dictionary playerStatusDic = new Dictionary(); 30 | 31 | void Start() 32 | { 33 | ViveShare_Event.server_initSuccessEvent.Listen(OnServerStarted); 34 | ViveShare_Event.server_clientConnectedEvent.Listen(OnClientConnect); 35 | ViveShare_Event.server_clientDisconnectedEvent.Listen(OnClientDisconnect); 36 | ViveShare_Event.gameEndEvent.Listen(OnGameEnd); 37 | } 38 | 39 | public void OnServerStarted() 40 | { 41 | int arraySize = ViveShare_Server.Instance.GetAnticiplatedPlayerNum() + 1; 42 | 43 | // remove old player status 44 | playerStatusList.Clear(); 45 | playerStatusDic.Clear(); 46 | 47 | // create player status for host 48 | PlayerStatus hostStatus = new PlayerStatus(); 49 | 50 | playerStatusList.Add(hostStatus); 51 | playerStatusDic.Add(0, hostStatus); 52 | } 53 | 54 | public void OnClientConnect(int id) 55 | { 56 | PlayerStatus playerStatus = new PlayerStatus(); 57 | 58 | if (playerAvatarPrefab != null) 59 | { 60 | GameObject playerObj = Instantiate(playerAvatarPrefab); 61 | playerObj.name = "Player " + id + " Avatar"; 62 | 63 | ShooterPlayerAvatar avatar = playerObj.GetComponent(); 64 | avatar.id = id; 65 | 66 | int colorIdx = id % ShooterPlayerColorTable.colorTable.Length; 67 | playerObj.GetComponentInChildren().material.color = ShooterPlayerColorTable.colorTable[colorIdx]; 68 | 69 | VivePoseTracker poseTracker = playerObj.GetComponent(); 70 | poseTracker.viveRole.SetEx(ViveShare_Server.Instance.GetPlayerTrackerRole(id)); 71 | 72 | playerStatus.avatar = playerObj; 73 | playerStatus.avatar.transform.parent = cameraRig.transform; 74 | } 75 | 76 | PlayerStatus oldPlayerStatus; 77 | if (playerStatusDic.TryGetValue(id, out oldPlayerStatus) == true) 78 | { 79 | playerStatusList.Remove(oldPlayerStatus); 80 | playerStatusDic.Remove(id); 81 | } 82 | 83 | playerStatusList.Add(playerStatus); 84 | playerStatusDic.Add(id, playerStatus); 85 | } 86 | 87 | public void OnClientDisconnect(int id) 88 | { 89 | PlayerStatus status; 90 | if (playerStatusDic.TryGetValue(id, out status) == true) 91 | { 92 | Destroy(status.avatar); 93 | } 94 | } 95 | 96 | public void OnGameEnd() 97 | { 98 | for (int i = 0; i < playerStatusList.Count; i++) 99 | { 100 | Destroy(playerStatusList[i].avatar); 101 | } 102 | } 103 | 104 | public void AddBulletHitScore(int playerId) 105 | { 106 | PlayerStatus status; 107 | if (playerStatusDic.TryGetValue(playerId, out status) == true) 108 | { 109 | status.score += hitPlayerScore; 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterPlayerStatusManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5868751b383a386479a6fd9d4c268ab0 3 | timeCreated: 1490924756 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterResultReceiver.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using System; 4 | using UnityEngine; 5 | 6 | public class ShooterResultReceiver : MonoBehaviour 7 | { 8 | [NonSerialized] 9 | public int playerNum = 0; 10 | 11 | [NonSerialized] 12 | public int scoreCoutner = 0; 13 | 14 | [NonSerialized] 15 | public int[] scoreList; 16 | 17 | void Start() 18 | { 19 | ViveShare_Event.gameEndEvent.Listen(OnGameStart); 20 | 21 | ViveShare_Event.numberOfPlayerEvent.Listen(OnGettingPlayerNum); 22 | ViveShare_Event.scoreBroadcastEvent.Listen(OnGettingScore); 23 | } 24 | 25 | public void OnGameStart() 26 | { 27 | playerNum = 0; 28 | scoreCoutner = 0; 29 | } 30 | 31 | public void OnGettingPlayerNum(int num) 32 | { 33 | playerNum = num; 34 | scoreList = new int[num]; 35 | } 36 | 37 | public void OnGettingScore(int score) 38 | { 39 | scoreList[scoreCoutner] = score; 40 | scoreCoutner++; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/Prototypes/2-SimpleShooter/Scripts/ShooterResultReceiver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19b1648d4aee9b440b9d4fcb15ea0eca 3 | timeCreated: 1490928382 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 527c012758b83a14680341ba729d17d3 3 | folderAsset: yes 4 | timeCreated: 1490855567 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a0a90f8996bdc9429997bb92c57d826 3 | folderAsset: yes 4 | timeCreated: 1490921547 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Prefabs/Mobile Camera Renderer.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/Common/Prefabs/Mobile Camera Renderer.prefab -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Prefabs/Mobile Camera Renderer.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ffc4d9ad11d67b4ba303c657e2a1dea 3 | timeCreated: 1490923841 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Prefabs/Mobile Lobby UI.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/Common/Prefabs/Mobile Lobby UI.prefab -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Prefabs/Mobile Lobby UI.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82b9fe6d05106dc43bbec221aa88261b 3 | timeCreated: 1490924006 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Prefabs/PC Lobby UI.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ViveSoftware/ViveTrackerExperiencePrototype/5334bbcfa4fc297943e5d194daea8e0706f96833/Assets/Prototypes/Common/Prefabs/PC Lobby UI.prefab -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Prefabs/PC Lobby UI.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a071cdfc2dbcf8045aa68e3efce2dbbd 3 | timeCreated: 1490921664 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a90c51898ff09c47b4cde619d513c20 3 | folderAsset: yes 4 | timeCreated: 1490855646 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/AndroidCameraRecorder.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | public class AndroidCameraRecorder : MonoBehaviour 7 | { 8 | // android camera stream param 9 | public int width = 1920; 10 | public int height = 1080; 11 | public int fps = 30; 12 | 13 | // camera device and data 14 | private WebCamTexture webcamTexture; 15 | 16 | // camera texture renderer 17 | public RawImage backgroundImage; 18 | 19 | private void Start() 20 | { 21 | // try to get webcam devices and create webcam texture from the device 22 | WebCamDevice[] webCamDevices = WebCamTexture.devices; 23 | if (webCamDevices.Length > 0) 24 | { 25 | // request camera stream 26 | webcamTexture = new WebCamTexture(webCamDevices[0].name, width, height, fps); 27 | webcamTexture.Play(); 28 | } 29 | } 30 | 31 | private void Update() 32 | { 33 | if (backgroundImage != null && backgroundImage.gameObject.activeSelf) 34 | { 35 | backgroundImage.texture = webcamTexture; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/AndroidCameraRecorder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f7ef108cbb44ed479cd68967406972c 3 | timeCreated: 1490923685 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/ControllerModelSwap.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | 5 | public class ControllerModelSwap : MonoBehaviour 6 | { 7 | public GameObject leftHandRectile; 8 | public GameObject leftHandGuideRay; 9 | public GameObject rightHandRectile; 10 | public GameObject rightHandGuideRay; 11 | 12 | void Start () 13 | { 14 | ViveShare_Event.gameStartEvent.Listen(OnGameStart); 15 | ViveShare_Event.gameEndEvent.Listen(OnGameEnd); 16 | } 17 | 18 | public void OnGameStart() 19 | { 20 | leftHandRectile.SetActive(false); 21 | leftHandGuideRay.SetActive(false); 22 | 23 | rightHandRectile.SetActive(false); 24 | rightHandGuideRay.SetActive(false); 25 | } 26 | 27 | public void OnGameEnd() 28 | { 29 | leftHandRectile.SetActive(true); 30 | leftHandGuideRay.SetActive(true); 31 | 32 | rightHandRectile.SetActive(true); 33 | rightHandGuideRay.SetActive(true); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/ControllerModelSwap.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9332d2bb6ba2db04b8b36eaca42a87e8 3 | timeCreated: 1490921384 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/GameProgressController.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | 5 | public class GameProgressController : MonoBehaviour 6 | { 7 | public GameObject[] lobbyGameObjects; 8 | public GameObject[] gameplayGameObjects; 9 | public GameObject[] resultGameObjects; 10 | 11 | private bool isInResultScene = false; 12 | 13 | void Start () 14 | { 15 | // set event liseners 16 | ViveShare_Event.gameStartEvent.Listen(OnGameStart); 17 | ViveShare_Event.gameEndEvent.Listen(OnGameEnd); 18 | ViveShare_Event.client_disconnectEvent.Listen(OnClientDisconnect); 19 | ViveShare_Event.server_shutdownEvent.Listen(GoBackToLobby); 20 | } 21 | 22 | public void OnGameStart() 23 | { 24 | foreach (GameObject obj in lobbyGameObjects) 25 | { 26 | obj.SetActive(false); 27 | } 28 | 29 | foreach (GameObject obj in gameplayGameObjects) 30 | { 31 | obj.SetActive(true); 32 | } 33 | } 34 | 35 | public void OnGameEnd() 36 | { 37 | foreach (GameObject obj in gameplayGameObjects) 38 | { 39 | obj.SetActive(false); 40 | } 41 | 42 | foreach (GameObject obj in resultGameObjects) 43 | { 44 | obj.SetActive(true); 45 | } 46 | 47 | isInResultScene = true; 48 | } 49 | 50 | private void OnClientDisconnect() 51 | { 52 | if (!isInResultScene) 53 | { 54 | foreach (GameObject obj in gameplayGameObjects) 55 | { 56 | obj.SetActive(false); 57 | } 58 | 59 | foreach (GameObject obj in lobbyGameObjects) 60 | { 61 | obj.SetActive(true); 62 | } 63 | } 64 | } 65 | 66 | public void GoBackToLobby() 67 | { 68 | foreach (GameObject obj in resultGameObjects) 69 | { 70 | obj.SetActive(false); 71 | } 72 | 73 | foreach (GameObject obj in lobbyGameObjects) 74 | { 75 | obj.SetActive(true); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/GameProgressController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a93bc3c418b64184998e135357ef56a6 3 | timeCreated: 1490922998 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/GlobalEventDef.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | 5 | public static partial class ViveShare_Event 6 | { 7 | // event definition 8 | public static ViveEvent setBulletParamEvent = new ViveEvent("SET_BULLET_PARAM"); 9 | public static ViveEvent bulletSpawnEvent = new ViveEvent("BULLET_SPAWN"); 10 | 11 | public static ViveEvent numberOfPlayerEvent = new ViveEvent("NUMBER_OF_PLAERS"); 12 | public static ViveEvent scoreBroadcastEvent = new ViveEvent("SCORE_BROADCAST"); 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/GlobalEventDef.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 878dc7b64d0eb274dace722cf761524e 3 | timeCreated: 1490925165 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/PlayTimeHandler.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using HTC.UnityPlugin.ViveShare; 6 | 7 | public class PlayTimeHandler : MonoBehaviour 8 | { 9 | public float timeLimit = 10.0f; 10 | private float gameStartTime = 0.0f; 11 | private float timeEndPoint = 0.0f; 12 | 13 | public Text visText; 14 | 15 | public bool hasAuthority = false; 16 | 17 | void OnEnable() 18 | { 19 | gameStartTime = Time.time; 20 | timeEndPoint = gameStartTime + timeLimit; 21 | } 22 | 23 | void FixedUpdate() 24 | { 25 | if (Time.time <= timeEndPoint) 26 | { 27 | int min = Mathf.RoundToInt(timeEndPoint - Time.time) / 60; 28 | int sec = Mathf.RoundToInt(timeEndPoint - Time.time) % 60; 29 | 30 | string minString = min.ToString().PadLeft(2, '0'); 31 | string secString = sec.ToString().PadLeft(2, '0'); 32 | 33 | visText.text = minString + ":" + secString; 34 | } 35 | else 36 | { 37 | visText.text = "00:00"; 38 | 39 | if(hasAuthority) 40 | { 41 | ViveShare_Server.Instance.EndGame(); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/PlayTimeHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d3a6020f0efcf84f834380463a28a1b 3 | timeCreated: 1490925383 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/SteamPoseUpdaterHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SteamPoseUpdaterHelper : MonoBehaviour 6 | { 7 | public GameObject mainCameraObject; 8 | 9 | void Start () 10 | { 11 | #if UNITY_5_6 12 | if (mainCameraObject != null) 13 | { 14 | mainCameraObject.AddComponent(); 15 | } 16 | #endif 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/SteamPoseUpdaterHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f511fe61e2fde4841a20d8df02d617b7 3 | timeCreated: 1492670160 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b817bd59223f2249a61c79d660120d3 3 | folderAsset: yes 4 | timeCreated: 1490925396 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/UI/MobileLobbyUIController.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using System.Net; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | using HTC.UnityPlugin.ViveShare; 7 | 8 | public class MobileLobbyUIController : MonoBehaviour 9 | { 10 | // ui elements 11 | public InputField ipInput; 12 | public InputField portInput; 13 | public Button gameSettingButton; 14 | public Text gameSettingButtonText; 15 | 16 | // network config 17 | public string ip = "10.116.81.66"; 18 | public int port = 2498; 19 | public int playerNum = 1; 20 | 21 | private ViveNetworkState state = ViveNetworkState.Init; 22 | 23 | void OnEnable() 24 | { 25 | ipInput.text = ip; 26 | portInput.text = port.ToString(); 27 | 28 | ViveShare_Event.client_connectFailedEvent.Listen(OnClientConnectFailed); 29 | ViveShare_Event.client_connectSuccessEvent.Listen(OnClientConnected); 30 | 31 | gameSettingButtonText.text = "Connect to Host"; 32 | state = ViveNetworkState.Init; 33 | } 34 | 35 | private void OnDisable() 36 | { 37 | ViveShare_Event.client_connectFailedEvent.Remove(OnClientConnectFailed); 38 | ViveShare_Event.client_connectSuccessEvent.Remove(OnClientConnected); 39 | } 40 | 41 | public void OnIpInputFinished() 42 | { 43 | IPAddress address; 44 | if (IPAddress.TryParse(ipInput.text, out address)) 45 | { 46 | ip = address.ToString(); 47 | } 48 | } 49 | 50 | public void OnPortInputFinished() 51 | { 52 | int parseResult; 53 | if (int.TryParse(portInput.text, out parseResult)) 54 | { 55 | port = parseResult; 56 | } 57 | } 58 | 59 | public void OnSelectPlayerId(int val) 60 | { 61 | playerNum = val + 1; 62 | } 63 | 64 | public void OnGameSettingButtonPressed() 65 | { 66 | if (state == ViveNetworkState.Init) 67 | { 68 | ViveShare_Client.Instance.serverAddr = ip; 69 | ViveShare_Client.Instance.portNumber = port; 70 | ViveShare_Client.Instance.SetTrackerPoseRequestParam(true, playerNum); 71 | 72 | if (ViveShare_Client.Instance.StartClient() == true) 73 | { 74 | gameSettingButtonText.text = "Connecting..."; 75 | state = ViveNetworkState.Wait_Connect; 76 | } 77 | } 78 | } 79 | 80 | public void OnClientConnectFailed() 81 | { 82 | gameSettingButtonText.text = "Connect to Host"; 83 | 84 | state = ViveNetworkState.Init; 85 | } 86 | 87 | public void OnClientConnected() 88 | { 89 | ViveShare_Client.Instance.SetClientReady(); 90 | gameSettingButtonText.text = "Preparing Game"; 91 | state = ViveNetworkState.Wait_GameStart; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/UI/MobileLobbyUIController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffd920e3cbd211c448be1cbf0996847f 3 | timeCreated: 1490927308 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prototypes/Common/Scripts/UI/PCLobbyUIController.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2017, HTC Corporation. All rights reserved. =========== 2 | 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | using HTC.UnityPlugin.ViveShare; 6 | 7 | public class PCLobbyUIController : MonoBehaviour 8 | { 9 | public Dropdown playerNumDropdown; 10 | public Button gameSettingButton; 11 | public Text gameSettingButtonText; 12 | 13 | public Color buttonNormalColor; 14 | public Color buttonStartGameColor; 15 | 16 | private int playerNum = 1; 17 | private ViveNetworkState state = ViveNetworkState.Init; 18 | 19 | public void OnEnable() 20 | { 21 | ViveShare_Event.server_initSuccessEvent.Listen(OnServerStarted); 22 | ViveShare_Event.server_allClientsReadyEvent.Listen(OnClientsReady); 23 | ViveShare_Event.server_clientDisconnectedEvent.Listen(OnClientDisconnect); 24 | 25 | state = ViveNetworkState.Init; 26 | 27 | gameSettingButton.interactable = true; 28 | 29 | var colors = gameSettingButton.colors; 30 | colors.normalColor = buttonNormalColor; 31 | colors.highlightedColor = buttonNormalColor; 32 | gameSettingButton.colors = colors; 33 | 34 | gameSettingButtonText.text = "Start as Host"; 35 | } 36 | 37 | public void OnDisable() 38 | { 39 | ViveShare_Event.server_initSuccessEvent.Remove(OnServerStarted); 40 | ViveShare_Event.server_allClientsReadyEvent.Remove(OnClientsReady); 41 | ViveShare_Event.server_clientDisconnectedEvent.Remove(OnClientDisconnect); 42 | } 43 | 44 | public void OnPlayerNumberChanaged(int optionIdx) 45 | { 46 | playerNum = optionIdx + 1; 47 | } 48 | 49 | public void OnGameSettingButtonPressed() 50 | { 51 | if (state == ViveNetworkState.Init) 52 | { 53 | ViveShare_Server.Instance.StartServer(playerNum); 54 | } 55 | else if (state == ViveNetworkState.Wait_GameStart) 56 | { 57 | ViveShare_Server.Instance.StartGame(); 58 | } 59 | } 60 | 61 | public void OnServerStarted() 62 | { 63 | //// ++ Unity bug -- GameObject mysteriously destoryed when reload scene 64 | //gameSettingButton = FindObjectOfType