├── .gitignore ├── Assets ├── Cardboard.meta ├── Cardboard │ ├── Editor.meta │ ├── Editor │ │ ├── CardboardEditor.cs │ │ ├── CardboardEditor.cs.meta │ │ ├── StereoControllerEditor.cs │ │ └── StereoControllerEditor.cs.meta │ ├── Legacy.meta │ ├── Legacy │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── CardboardGUI.prefab │ │ │ ├── CardboardGUI.prefab.meta │ │ │ ├── CardboardMain.prefab │ │ │ ├── CardboardMain.prefab.meta │ │ │ ├── LegacyPrefabs.md │ │ │ └── LegacyPrefabs.md.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ ├── GUIScreen.shader │ │ │ ├── GUIScreen.shader.meta │ │ │ ├── SkyboxMesh.shader │ │ │ └── SkyboxMesh.shader.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ │ ├── CardboardOnGUI.cs │ │ │ ├── CardboardOnGUI.cs.meta │ │ │ ├── CardboardOnGUIMouse.cs │ │ │ ├── CardboardOnGUIMouse.cs.meta │ │ │ ├── CardboardOnGUIWindow.cs │ │ │ ├── CardboardOnGUIWindow.cs.meta │ │ │ ├── LegacyCardboardAndroidDevice.cs │ │ │ ├── LegacyCardboardAndroidDevice.cs.meta │ │ │ ├── SkyboxMesh.cs │ │ │ ├── SkyboxMesh.cs.meta │ │ │ ├── StereoLensFlare.cs │ │ │ └── StereoLensFlare.cs.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── CardboardAdapter.prefab │ │ ├── CardboardAdapter.prefab.meta │ │ ├── CardboardHead.prefab │ │ ├── CardboardHead.prefab.meta │ │ ├── CardboardMain.prefab │ │ ├── CardboardMain.prefab.meta │ │ ├── Prefabs.md │ │ └── Prefabs.md.meta │ ├── Resources.meta │ ├── Resources │ │ ├── CardboardSettingsButton.png.bytes │ │ ├── CardboardSettingsButton.png.bytes.meta │ │ ├── RadialUndistortionEffect.shader │ │ ├── RadialUndistortionEffect.shader.meta │ │ ├── SolidColor.shader │ │ └── SolidColor.shader.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Cardboard.cs │ │ ├── Cardboard.cs.meta │ │ ├── CardboardEye.cs │ │ ├── CardboardEye.cs.meta │ │ ├── CardboardHead.cs │ │ ├── CardboardHead.cs.meta │ │ ├── CardboardProfile.cs │ │ ├── CardboardProfile.cs.meta │ │ ├── CardboardUILayer.cs │ │ ├── CardboardUILayer.cs.meta │ │ ├── GazeInputModule.cs │ │ ├── GazeInputModule.cs.meta │ │ ├── Pose3D.cs │ │ ├── Pose3D.cs.meta │ │ ├── RadialUndistortionEffect.cs │ │ ├── RadialUndistortionEffect.cs.meta │ │ ├── StereoController.cs │ │ ├── StereoController.cs.meta │ │ ├── VRDevices.meta │ │ └── VRDevices │ │ ├── BaseAndroidDevice.cs │ │ ├── BaseAndroidDevice.cs.meta │ │ ├── BaseCardboardDevice.cs │ │ ├── BaseCardboardDevice.cs.meta │ │ ├── BaseVRDevice.cs │ │ ├── BaseVRDevice.cs.meta │ │ ├── CardboardAndroidDevice.cs │ │ ├── CardboardAndroidDevice.cs.meta │ │ ├── CardboardiOSDevice.cs │ │ ├── CardboardiOSDevice.cs.meta │ │ ├── UnityEditorDevice.cs │ │ └── UnityEditorDevice.cs.meta ├── Editor.meta ├── Editor │ ├── CrossPlatformInput.meta │ └── CrossPlatformInput │ │ ├── CrossPlatformInputInitialize.cs │ │ └── CrossPlatformInputInitialize.cs.meta ├── InputDemo.unity ├── InputDemo.unity.meta ├── Plugins.meta ├── Plugins │ ├── Android.meta │ ├── Android │ │ ├── AndroidManifest.xml │ │ ├── AndroidManifest.xml.meta │ │ ├── libs.meta │ │ ├── libs │ │ │ ├── armeabi-v7a.meta │ │ │ ├── armeabi-v7a │ │ │ │ ├── libRenderingPlugin.so │ │ │ │ ├── libRenderingPlugin.so.meta │ │ │ │ ├── libvrunity.so │ │ │ │ └── libvrunity.so.meta │ │ │ ├── x86.meta │ │ │ └── x86 │ │ │ │ ├── libRenderingPlugin.so │ │ │ │ ├── libRenderingPlugin.so.meta │ │ │ │ ├── libvrunity.so │ │ │ │ └── libvrunity.so.meta │ │ ├── unityvractivity.jar │ │ └── unityvractivity.jar.meta │ ├── Legacy.meta │ ├── Legacy │ │ ├── Android.meta │ │ └── Android │ │ │ ├── AndroidManifest.xml │ │ │ ├── AndroidManifest.xml.meta │ │ │ ├── libprotobuf-java-2.6-nano.jar │ │ │ ├── libprotobuf-java-2.6-nano.jar.meta │ │ │ ├── unitycardboardactivity.jar │ │ │ ├── unitycardboardactivity.jar.meta │ │ │ ├── vrtoolkit.jar │ │ │ └── vrtoolkit.jar.meta │ ├── iOS.meta │ └── iOS │ │ ├── CardboardAppController.h │ │ ├── CardboardAppController.h.meta │ │ ├── CardboardAppController.mm │ │ ├── CardboardAppController.mm.meta │ │ ├── Localizable.strings │ │ ├── Localizable.strings.meta │ │ ├── libvrunity.a │ │ ├── libvrunity.a.meta │ │ ├── resources.bundle.meta │ │ └── resources.bundle │ │ ├── SyncConfigViewController~ipad.nib.meta │ │ ├── SyncConfigViewController~ipad.nib │ │ ├── objects-8.0+.nib │ │ ├── objects-8.0+.nib.meta │ │ ├── objects.nib │ │ ├── objects.nib.meta │ │ ├── runtime.nib │ │ └── runtime.nib.meta │ │ ├── SyncConfigViewController~iphone.nib.meta │ │ ├── SyncConfigViewController~iphone.nib │ │ ├── objects-8.0+.nib │ │ ├── objects-8.0+.nib.meta │ │ ├── objects.nib │ │ ├── objects.nib.meta │ │ ├── runtime.nib │ │ └── runtime.nib.meta │ │ ├── cardboardLogotype.png │ │ ├── cardboardLogotype.png.meta │ │ ├── continueButton.png │ │ ├── continueButton.png.meta │ │ ├── gearButton.png │ │ ├── gearButton.png.meta │ │ ├── onboardingBackground.jpg │ │ ├── onboardingBackground.jpg.meta │ │ ├── qrSample.png │ │ ├── qrSample.png.meta │ │ ├── rotateInstructions.png │ │ ├── rotateInstructions.png.meta │ │ ├── tickmarks.png │ │ └── tickmarks.png.meta ├── Prefabs.meta ├── Prefabs │ ├── VRController.prefab │ ├── VRController.prefab.meta │ ├── star.prefab │ └── star.prefab.meta ├── Scripts.meta ├── Scripts │ ├── FaceObject.cs │ ├── FaceObject.cs.meta │ ├── PickUp.cs │ ├── PickUp.cs.meta │ ├── VRMoveController.cs │ └── VRMoveController.cs.meta ├── Standard Assets.meta ├── Standard Assets │ ├── Prototyping.meta │ └── Prototyping │ │ ├── Materials.meta │ │ ├── Materials │ │ ├── NavyGrid.mat │ │ ├── NavyGrid.mat.meta │ │ ├── NavySmooth.mat │ │ ├── NavySmooth.mat.meta │ │ ├── PinkGrid.mat │ │ ├── PinkGrid.mat.meta │ │ ├── PinkSmooth.mat │ │ ├── PinkSmooth.mat.meta │ │ ├── YellowGrid.mat │ │ ├── YellowGrid.mat.meta │ │ ├── YellowSmooth.mat │ │ └── YellowSmooth.mat.meta │ │ ├── Textures.meta │ │ └── Textures │ │ ├── GridEmissive.png │ │ ├── GridEmissive.png.meta │ │ ├── SwatchMauveAlbedo.png │ │ ├── SwatchMauveAlbedo.png.meta │ │ ├── SwatchNavyAlbedo.png │ │ ├── SwatchNavyAlbedo.png.meta │ │ ├── SwatchNavyDarkAlbedo.png │ │ ├── SwatchNavyDarkAlbedo.png.meta │ │ ├── SwatchOrangeAlbedo.png │ │ ├── SwatchOrangeAlbedo.png.meta │ │ ├── SwatchPinkDAlbedo.png │ │ ├── SwatchPinkDAlbedo.png.meta │ │ ├── SwatchTealAlbedo.png │ │ ├── SwatchTealAlbedo.png.meta │ │ ├── SwatchTurquoiseAlbedo.png │ │ ├── SwatchTurquoiseAlbedo.png.meta │ │ ├── SwatchWhiteAlbedo.png │ │ ├── SwatchWhiteAlbedo.png.meta │ │ ├── SwatchYellowAlbedo.png │ │ └── SwatchYellowAlbedo.png.meta ├── Textures.meta └── Textures │ ├── gold-star.png │ └── gold-star.png.meta ├── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset └── TimeManager.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | 6 | # Autogenerated VS/MD solution and project files 7 | *.csproj 8 | *.unityproj 9 | *.sln 10 | *.suo 11 | *.tmp 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | 17 | # Unity3D generated meta files 18 | *.pidb.meta 19 | 20 | # Unity3D Generated File On Crash Reports 21 | sysinfo.txt 22 | 23 | -------------------------------------------------------------------------------- /Assets/Cardboard.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 804cd46ee03484ff2b54e3a33f94c5fd 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c98c5ffcf17d49fc88af4e1d260f2cb 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Editor/CardboardEditor.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | using UnityEngine.Rendering; 17 | using UnityEditor; 18 | using UnityEditor.Callbacks; 19 | 20 | /// @ingroup EditorScripts 21 | /// A custom editor for properties on the Cardboard script. This appears in the 22 | /// Inspector window of a Cardboard object. Its purpose is to allow changing the 23 | /// `Cardboard.SDK` object's properties from their default values. 24 | [CustomEditor(typeof(Cardboard))] 25 | [InitializeOnLoad] 26 | public class CardboardEditor : Editor { 27 | GUIContent vrModeLabel = new GUIContent("VR Mode Enabled", 28 | "Sets whether VR mode is enabled."); 29 | 30 | GUIContent distortionCorrectionLabel = new GUIContent("Distortion Correction", 31 | "Whether distortion correction is performed the SDK."); 32 | 33 | GUIContent autoDriftCorrectionLabel = new GUIContent("Auto Drift Correction", 34 | "When enabled, drift in the gyro readings is estimated and removed."); 35 | 36 | GUIContent neckModelScaleLabel = new GUIContent("Neck Model Scale", 37 | "The scale factor of the builtin neck model [0..1]. To disable, set to 0."); 38 | 39 | #if UNITY_IOS 40 | GUIContent syncWithCardboardLabel = new GUIContent("Sync with Cardboard App", 41 | "Enables the 'Sync with Google Cardboard' slider in the viewer settings dialog."); 42 | #endif 43 | 44 | GUIContent alignmentMarkerLabel = new GUIContent("Alignment Marker", 45 | "Whether to draw the alignment marker. The marker is a vertical line that splits " + 46 | "the viewport in half, designed to help users align the screen with the Cardboard."); 47 | 48 | GUIContent settingsButtonLabel = new GUIContent("Settings Button", 49 | "Whether to draw the settings button. The settings button opens the " + 50 | "Google Cardboard app to allow the user to configure their individual " + 51 | "settings and Cardboard headset parameters."); 52 | 53 | GUIContent tapIsTriggerLabel = new GUIContent("Tap Is Trigger", 54 | "Whether screen taps are treated as trigger events."); 55 | 56 | GUIContent editorSettingsLabel = new GUIContent("Unity Editor Emulation Settings", 57 | "Controls for the in-editor emulation of Cardboard."); 58 | 59 | GUIContent autoUntiltHeadLabel = new GUIContent("Auto Untilt Head", 60 | "When enabled, just release Ctrl to untilt the head."); 61 | 62 | GUIContent screenSizeLabel = new GUIContent("Screen Size", 63 | "The screen size to emulate."); 64 | 65 | GUIContent deviceTypeLabel = new GUIContent("Device Type", 66 | "The Cardboard device type to emulate."); 67 | 68 | public override void OnInspectorGUI() { 69 | GUI.changed = false; 70 | 71 | GUIStyle headingStyle = new GUIStyle(GUI.skin.label); 72 | headingStyle.fontStyle = FontStyle.Bold; 73 | headingStyle.fontSize = 14; 74 | 75 | Cardboard cardboard = (Cardboard)target; 76 | 77 | EditorGUILayout.LabelField("General Settings", headingStyle); 78 | cardboard.VRModeEnabled = 79 | EditorGUILayout.Toggle(vrModeLabel, cardboard.VRModeEnabled); 80 | cardboard.DistortionCorrection = 81 | EditorGUILayout.Toggle(distortionCorrectionLabel, cardboard.DistortionCorrection); 82 | cardboard.AutoDriftCorrection = 83 | EditorGUILayout.Toggle(autoDriftCorrectionLabel, cardboard.AutoDriftCorrection); 84 | cardboard.NeckModelScale = 85 | EditorGUILayout.Slider(neckModelScaleLabel, cardboard.NeckModelScale, 0, 1); 86 | EditorGUILayout.Separator(); 87 | 88 | EditorGUILayout.LabelField("Cardboard Settings", headingStyle); 89 | #if UNITY_IOS 90 | cardboard.SyncWithCardboardApp = 91 | EditorGUILayout.Toggle(syncWithCardboardLabel, cardboard.SyncWithCardboardApp); 92 | #endif 93 | cardboard.EnableAlignmentMarker = 94 | EditorGUILayout.Toggle(alignmentMarkerLabel, cardboard.EnableAlignmentMarker); 95 | cardboard.EnableSettingsButton = 96 | EditorGUILayout.Toggle(settingsButtonLabel, cardboard.EnableSettingsButton); 97 | cardboard.TapIsTrigger = 98 | EditorGUILayout.Toggle(tapIsTriggerLabel, cardboard.TapIsTrigger); 99 | EditorGUILayout.Separator(); 100 | 101 | EditorGUILayout.LabelField(editorSettingsLabel, headingStyle); 102 | cardboard.autoUntiltHead = 103 | EditorGUILayout.Toggle(autoUntiltHeadLabel, cardboard.autoUntiltHead); 104 | cardboard.ScreenSize = (CardboardProfile.ScreenSizes) 105 | EditorGUILayout.EnumPopup(screenSizeLabel, cardboard.ScreenSize); 106 | cardboard.DeviceType = (CardboardProfile.DeviceTypes) 107 | EditorGUILayout.EnumPopup(deviceTypeLabel, cardboard.DeviceType); 108 | 109 | if (GUI.changed) { 110 | EditorUtility.SetDirty(cardboard); 111 | } 112 | } 113 | 114 | static CardboardEditor() { 115 | EditorUserBuildSettings.activeBuildTargetChanged += CheckGraphicsAPI; 116 | } 117 | 118 | [PostProcessBuild] 119 | public static void CheckGraphicsAPI(BuildTarget target, string path) { 120 | CheckGraphicsAPI(); 121 | } 122 | 123 | private static void CheckGraphicsAPI() { 124 | #if UNITY_IOS 125 | #if UNITY_5 || UNITY_4_6 && !UNITY_4_6_1 && !UNITY_4_6_2 126 | #if UNITY_5 127 | var iOSBuildTarget = BuildTarget.iOS; 128 | var iOSGraphicsAPIs = PlayerSettings.GetGraphicsAPIs(BuildTarget.iOS); 129 | bool isOpenGL = true; 130 | foreach (var device in iOSGraphicsAPIs) { 131 | isOpenGL &= (device == GraphicsDeviceType.OpenGLES2 || device == GraphicsDeviceType.OpenGLES3); 132 | } 133 | #else 134 | var iOSBuildTarget = BuildTarget.iPhone; 135 | bool isOpenGL = PlayerSettings.targetIOSGraphics == TargetIOSGraphics.OpenGLES_2_0 136 | || PlayerSettings.targetIOSGraphics == TargetIOSGraphics.OpenGLES_3_0; 137 | #endif // UNITY_5 138 | if (EditorUserBuildSettings.activeBuildTarget == iOSBuildTarget 139 | && !Application.isPlaying 140 | && Object.FindObjectOfType() != null 141 | && !isOpenGL) { 142 | Debug.LogWarning("iOS Graphics API should be set to OpenGL for best " + 143 | "distortion-correction performance in Cardboard."); 144 | } 145 | #endif // UNITY_5 || UNITY_4_6 && !UNITY_4_6_1 && !UNITY_4_6_2 146 | #endif // UNITY_IOS 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Assets/Cardboard/Editor/CardboardEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed7a9fc9a5d44422b99d0a825d3cbf1e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Editor/StereoControllerEditor.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | using UnityEditor; 17 | using System.Collections; 18 | using System.Linq; 19 | 20 | /// @ingroup EditorScripts 21 | /// A custom editor for the StereoController script. It exists to add the _Update 22 | /// Stereo Cameras_ button to the StereoController's Inspector window, and to the 23 | /// corresponding main menu entry and Camera context menu command. The usage of the 24 | /// these actions is described in StereoController. 25 | [CustomEditor(typeof(StereoController))] 26 | public class StereoControllerEditor : Editor { 27 | /// Name of button, and part of "Undo ..." message. 28 | public const string ACTION_NAME = "Update Stereo Cameras"; 29 | 30 | private GUIContent updateButton = 31 | new GUIContent(ACTION_NAME, "Copy all Camera settings to the stereo cameras."); 32 | 33 | public override void OnInspectorGUI() { 34 | DrawDefaultInspector(); 35 | GUILayout.BeginHorizontal(GUILayout.ExpandHeight(false)); 36 | GUILayout.FlexibleSpace(); 37 | if (GUILayout.Button(updateButton, GUILayout.ExpandWidth(false))) { 38 | var controller = (StereoController)target; 39 | DoUpdateStereoCameras(controller.gameObject); 40 | } 41 | GUILayout.FlexibleSpace(); 42 | GUILayout.EndHorizontal(); 43 | } 44 | 45 | [MenuItem("Component/Cardboard/Update Stereo Cameras", true)] 46 | public static bool CanUpdateStereoCameras() { 47 | // Make sure all selected items have valid cameras. 48 | return Selection.gameObjects.Where(go => CanUpdateStereoCameras(go)).Count() 49 | == Selection.gameObjects.Length; 50 | } 51 | 52 | [MenuItem("CONTEXT/Camera/Update Stereo Cameras", true)] 53 | public static bool CanUpdateStereoCamerasContext(MenuCommand command) { 54 | var camera = (Camera)command.context; 55 | return CanUpdateStereoCameras(camera.gameObject); 56 | } 57 | 58 | [MenuItem("Component/Cardboard/Update Stereo Cameras")] 59 | public static void UpdateStereoCameras() { 60 | foreach (var go in Selection.gameObjects) { 61 | DoUpdateStereoCameras(go); 62 | } 63 | } 64 | 65 | [MenuItem("CONTEXT/Camera/Update Stereo Cameras")] 66 | public static void UpdateStereoCamerasContext(MenuCommand command) { 67 | var camera = (Camera)command.context; 68 | DoUpdateStereoCameras(camera.gameObject); 69 | } 70 | 71 | private static bool CanUpdateStereoCameras(GameObject go) { 72 | return go != null && 73 | go.hideFlags == HideFlags.None && 74 | go.GetComponent() != null && 75 | go.GetComponent() == null; 76 | } 77 | 78 | private static void DoUpdateStereoCameras(GameObject go) { 79 | // Make sure there is a StereoController. 80 | var controller = go.GetComponent(); 81 | if (controller == null) { 82 | controller = go.AddComponent(); 83 | Undo.RegisterCreatedObjectUndo(controller, ACTION_NAME); 84 | } 85 | 86 | // Remember current state of stereo rig. 87 | #if !UNITY_5 88 | bool hadSkybox = go.GetComponent() != null; 89 | #endif 90 | bool hadHead = controller.Head != null; 91 | bool hadEyes = controller.Eyes.Length > 0; 92 | 93 | controller.AddStereoRig(); 94 | 95 | // Support undo... 96 | 97 | #if !UNITY_5 98 | // Skybox mesh. Deletes it if camera is not Main. 99 | var skybox = go.GetComponent(); 100 | if (skybox != null) { 101 | if (!hadSkybox) { 102 | Undo.RegisterCreatedObjectUndo(skybox, ACTION_NAME); 103 | } else if (go.GetComponent().tag != "MainCamera") { 104 | Undo.DestroyObjectImmediate(skybox); 105 | } 106 | } 107 | #endif 108 | 109 | // Head. 110 | var head = go.GetComponent(); 111 | if (head != null && !hadHead) { 112 | Undo.RegisterCreatedObjectUndo(head, ACTION_NAME); 113 | } 114 | 115 | // Eyes. Synchronizes them with controller's camera too. 116 | foreach (var eye in controller.Eyes) { 117 | if (!hadEyes) { 118 | Undo.RegisterCreatedObjectUndo(eye.gameObject, ACTION_NAME); 119 | } else { 120 | Undo.RecordObject(eye.GetComponent(), ACTION_NAME); 121 | eye.CopyCameraAndMakeSideBySide(controller); 122 | } 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /Assets/Cardboard/Editor/StereoControllerEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05c5a7cf1f7ca4a0db9fef203f559380 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9084ee29385a0493b95a4318fb218e91 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1c4d995e5a7540c5bc988de855d4d24 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Prefabs/CardboardGUI.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 114: {fileID: 11400000} 12 | - 114: {fileID: 11400004} 13 | m_Layer: 5 14 | m_Name: CardboardGUI 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!1 &100002 21 | GameObject: 22 | m_ObjectHideFlags: 0 23 | m_PrefabParentObject: {fileID: 0} 24 | m_PrefabInternal: {fileID: 100100000} 25 | serializedVersion: 4 26 | m_Component: 27 | - 4: {fileID: 400002} 28 | - 33: {fileID: 3300000} 29 | - 23: {fileID: 2300000} 30 | - 64: {fileID: 6400000} 31 | - 114: {fileID: 11400002} 32 | m_Layer: 5 33 | m_Name: GUIScreen 34 | m_TagString: Untagged 35 | m_Icon: {fileID: 0} 36 | m_NavMeshLayer: 0 37 | m_StaticEditorFlags: 0 38 | m_IsActive: 1 39 | --- !u!4 &400000 40 | Transform: 41 | m_ObjectHideFlags: 1 42 | m_PrefabParentObject: {fileID: 0} 43 | m_PrefabInternal: {fileID: 100100000} 44 | m_GameObject: {fileID: 100000} 45 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 46 | m_LocalPosition: {x: 0, y: 0, z: 0} 47 | m_LocalScale: {x: 1, y: 1, z: 1} 48 | m_Children: 49 | - {fileID: 400002} 50 | m_Father: {fileID: 0} 51 | m_RootOrder: 0 52 | --- !u!4 &400002 53 | Transform: 54 | m_ObjectHideFlags: 1 55 | m_PrefabParentObject: {fileID: 0} 56 | m_PrefabInternal: {fileID: 100100000} 57 | m_GameObject: {fileID: 100002} 58 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 59 | m_LocalPosition: {x: 0, y: 0, z: 0} 60 | m_LocalScale: {x: 1, y: 1, z: 1} 61 | m_Children: [] 62 | m_Father: {fileID: 400000} 63 | m_RootOrder: 0 64 | --- !u!23 &2300000 65 | Renderer: 66 | m_ObjectHideFlags: 1 67 | m_PrefabParentObject: {fileID: 0} 68 | m_PrefabInternal: {fileID: 100100000} 69 | m_GameObject: {fileID: 100002} 70 | m_Enabled: 1 71 | m_CastShadows: 0 72 | m_ReceiveShadows: 0 73 | m_LightmapIndex: 255 74 | m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0} 75 | m_Materials: 76 | - {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0} 77 | m_SubsetIndices: 78 | m_StaticBatchRoot: {fileID: 0} 79 | m_UseLightProbes: 0 80 | m_LightProbeAnchor: {fileID: 0} 81 | m_ScaleInLightmap: 1 82 | m_SortingLayerID: 0 83 | m_SortingOrder: 0 84 | --- !u!33 &3300000 85 | MeshFilter: 86 | m_ObjectHideFlags: 1 87 | m_PrefabParentObject: {fileID: 0} 88 | m_PrefabInternal: {fileID: 100100000} 89 | m_GameObject: {fileID: 100002} 90 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 91 | --- !u!64 &6400000 92 | MeshCollider: 93 | m_ObjectHideFlags: 1 94 | m_PrefabParentObject: {fileID: 0} 95 | m_PrefabInternal: {fileID: 100100000} 96 | m_GameObject: {fileID: 100002} 97 | m_Material: {fileID: 0} 98 | m_IsTrigger: 0 99 | m_Enabled: 1 100 | serializedVersion: 2 101 | m_SmoothSphereCollisions: 0 102 | m_Convex: 0 103 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 104 | --- !u!114 &11400000 105 | MonoBehaviour: 106 | m_ObjectHideFlags: 1 107 | m_PrefabParentObject: {fileID: 0} 108 | m_PrefabInternal: {fileID: 100100000} 109 | m_GameObject: {fileID: 100000} 110 | m_Enabled: 1 111 | m_EditorHideFlags: 0 112 | m_Script: {fileID: 11500000, guid: 46945e3ed78924bdea8171f8de038346, type: 3} 113 | m_Name: 114 | m_EditorClassIdentifier: 115 | background: {r: 0, g: 0, b: 0, a: 0} 116 | --- !u!114 &11400002 117 | MonoBehaviour: 118 | m_ObjectHideFlags: 1 119 | m_PrefabParentObject: {fileID: 0} 120 | m_PrefabInternal: {fileID: 100100000} 121 | m_GameObject: {fileID: 100002} 122 | m_Enabled: 1 123 | m_EditorHideFlags: 0 124 | m_Script: {fileID: 11500000, guid: b076d97177f8c446c97ffb15e968d1af, type: 3} 125 | m_Name: 126 | m_EditorClassIdentifier: 127 | rect: 128 | serializedVersion: 2 129 | x: 0 130 | y: 0 131 | width: 1 132 | height: 1 133 | --- !u!114 &11400004 134 | MonoBehaviour: 135 | m_ObjectHideFlags: 1 136 | m_PrefabParentObject: {fileID: 0} 137 | m_PrefabInternal: {fileID: 100100000} 138 | m_GameObject: {fileID: 100000} 139 | m_Enabled: 1 140 | m_EditorHideFlags: 0 141 | m_Script: {fileID: 11500000, guid: f06724eec91fb4704a525c71a8e8deea, type: 3} 142 | m_Name: 143 | m_EditorClassIdentifier: 144 | head: {fileID: 0} 145 | pointerImage: {fileID: 2800000, guid: 53a9e781f887f46e1817489bff4b661d, type: 3} 146 | pointerSize: {x: 16, y: 16} 147 | pointerSpot: {x: 8, y: 8} 148 | --- !u!1001 &100100000 149 | Prefab: 150 | m_ObjectHideFlags: 1 151 | serializedVersion: 2 152 | m_Modification: 153 | m_TransformParent: {fileID: 0} 154 | m_Modifications: [] 155 | m_RemovedComponents: [] 156 | m_ParentPrefab: {fileID: 0} 157 | m_RootGameObject: {fileID: 100000} 158 | m_IsPrefabParent: 1 159 | m_IsExploded: 1 160 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Prefabs/CardboardGUI.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dcd8898a5b8c54c59a1b18bcf72ebd37 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Prefabs/CardboardMain.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a177aba586fa54700a4ceaac810edae9 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Prefabs/LegacyPrefabs.md: -------------------------------------------------------------------------------- 1 | # Legacy Prefabs 2 | 3 | This section describes the prefabs that are provided by the package for legacy 4 | purposes. 5 | 6 | ## CardboardGUI 7 | 8 | This prefab captures the _OnGUI_ pass of a frame into a texture. It draws the 9 | texture on a quad in the scene, along with cursor image for the mouse pointer, 10 | if you specify one. It can move the mouse by tracking the user's gaze and it 11 | can read the trigger to "click" UI elements. 12 | 13 | To use it, add an instance of the prefab to the scene. It should not be placed 14 | under a `CardboardHead` if you want the user's gaze to control the mouse, but can 15 | be if you use an alternative input device. The prefab contains one child called 16 | GUIScreen, which by default draws the entire screen's OnGUI layer on a single 17 | quad. 18 | 19 | It is possible to add more such children to the CardboardGUI object. Just 20 | duplicate the `GUIScreen` child in the Editor as needed, adjust each child's 21 | _Rect_ to pick out a different region of the OnGUI layer, and set its 22 | _Transform_ to place that region in the scene. In this way you can completely 23 | rearrange the GUI layout when in VR Mode without changing any `OnGUI()` functions' 24 | code or behavior. 25 | 26 | `CardboardGUI` and its Window children have visibility controls that you can use 27 | to convert a non-transient (i.e. always on) UI to a transient (popup) UI when in 28 | VR Mode. Non-transient UI is usually placed along the edges of the screen, 29 | which in HMD stereo systems are extremely hard to see. For VR Mode, you will 30 | likely need to rearrange the UI to appear front-and-center, perhaps depending on 31 | which way the user looks. This obscures the scene itself, unless the UI can be 32 | hidden when not needed. 33 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Prefabs/LegacyPrefabs.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba58321f331f049e990fbd5441a0790b 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11231ec82c59f4be0bcdb615d1d9a85d 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Resources/GUIScreen.shader: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | Shader "Cardboard/GUIScreen" { 16 | Properties { 17 | _MainTex ("Texture", 2D) = "white" {} 18 | } 19 | SubShader { 20 | Tags { "Queue" = "Overlay" } 21 | Lighting Off Cull Off Fog { Mode Off } ZTest Always ZWrite Off 22 | Blend SrcAlpha OneMinusSrcAlpha 23 | Pass { 24 | SetTexture [_MainTex] { combine texture double } 25 | } 26 | } 27 | Fallback Off 28 | } 29 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Resources/GUIScreen.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc707ac7319ae4f148a8ed3cbd156e4a 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Resources/SkyboxMesh.shader: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Original code by Nora 16 | // http://stereoarts.jp 17 | // 18 | // Retrieved from: 19 | // https://developer.oculusvr.com/forums/viewtopic.php?f=37&t=844#p28982 20 | 21 | Shader "Cardboard/SkyboxMesh" { 22 | Properties { 23 | _Color ("Main Color", Color) = (1,1,1,1) 24 | _MainTex ("Texture", 2D) = "white" {} 25 | } 26 | Category { 27 | Tags { "Queue"="Background" } 28 | ZWrite Off 29 | Lighting Off 30 | Fog {Mode Off} 31 | BindChannels { 32 | Bind "Color", color 33 | Bind "Vertex", vertex 34 | Bind "TexCoord", texcoord 35 | } 36 | SubShader { 37 | Pass { 38 | SetTexture [_MainTex] { 39 | Combine texture 40 | } 41 | SetTexture [_MainTex] { 42 | constantColor [_Color] 43 | combine previous * constant 44 | } 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Resources/SkyboxMesh.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c22be0408cec74248b876d70c820053c 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fcce2d2855e9448f84d882e29f3e252 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/CardboardOnGUI.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | 17 | /// @ingroup LegacyScripts 18 | /// A utility class for redirecting OnGUI()-based UI elements onto a texture, 19 | /// which can be drawn on a surface in the scene and thus appear in stereo. 20 | /// The auxiliary CardboardOnGUIWindow class handles displaying the texture 21 | /// in the scene. CardboardOnGUI captures the OnGUI() calls, which need to be 22 | /// modified slightly for this to work, and handles feeding back fake mouse 23 | /// events into the Unity player based on the user's head and trigger actions. 24 | /// 25 | /// If the option is available, it is probably better to use a real 3D 26 | /// GUI such as the new Unity4.6+ system. But if you just want to get 27 | /// existing projects based on OnGUI() to work in Cardboard, this class 28 | /// can help. 29 | /// 30 | /// Position the GUI mesh in 3D space using the gameobject's transform. Note: do 31 | /// not place the object as a child of the CardboardHead, or the user will not be 32 | /// able to look at different parts of the UI because it will move with them. It is 33 | /// better to place it as a sibling of the Head object. 34 | public class CardboardOnGUI : MonoBehaviour { 35 | 36 | /// The .NET type of an `OnGUI()` method. 37 | public delegate void OnGUICallback(); 38 | 39 | /// The list of `OnGUI()` calls that will be captured in the texture. Add your 40 | /// script's OnGUI method to enable the script's GUI in the CardboardOnGUI window. 41 | public static event OnGUICallback onGUICallback; 42 | 43 | /// Unity is going to call OnGUI() methods as usual, in addition to them 44 | /// being called by the onGUICallback event. To prevent this double 45 | /// call from affecting game logic, modify the OnGUI() method. At the 46 | /// very top, add "if (!CardboardOnGUI.OKToDraw(this)) return;". 47 | /// This will ensure only one OnGUI() call sequence occurs per frame, 48 | /// whether in VR Mode or not. 49 | public static bool OKToDraw(MonoBehaviour mb) { 50 | return okToDraw && (mb == null || mb.enabled && mb.gameObject.activeInHierarchy); 51 | } 52 | private static bool okToDraw; 53 | 54 | /// This is your global visibility control for whether CardboardOnGUI shows anything 55 | /// in the scene. Set it to _true_ to allow the GUI to draw, and _false_ to hide 56 | /// it. The purpose is so you can move GUI elements away from the edges of the 57 | /// screen (which are hard to see in VR Mode), and instead pop up the GUI when it 58 | /// is needed, and dismiss it when not. 59 | public static bool IsGUIVisible { 60 | get { 61 | return isGUIVisible && Cardboard.SDK.VRModeEnabled && SystemInfo.supportsRenderTextures; 62 | } 63 | set { 64 | isGUIVisible = value; 65 | } 66 | } 67 | private static bool isGUIVisible; 68 | 69 | /// A wrapper around Cardboard#Triggered that hides the trigger event 70 | /// when the GUI is visible (i.e. when you set #IsGUIVisible to true). 71 | /// By using this flag in your scripts rather than Cardboard#Triggered, 72 | /// you allow the GUI to take the trigger events when it is visible. 73 | /// This is when the trigger is needed for clicking buttons. 74 | /// When the GUI is hidden, the trigger events pass through. 75 | public static bool Triggered { 76 | get { 77 | return !IsGUIVisible && Cardboard.SDK.Triggered; 78 | } 79 | } 80 | 81 | /// The GUI texture is cleared to this color before any OnGUI methods are called 82 | /// during the capture phase. 83 | [Tooltip("The color and transparency of the overall GUI screen.")] 84 | public Color background = Color.clear; 85 | 86 | // Texture that captures the OnGUI rendering. 87 | private RenderTexture guiScreen; 88 | 89 | void Awake() { 90 | if (!SystemInfo.supportsRenderTextures) { 91 | Debug.LogWarning("CardboardOnGUI disabled. RenderTextures are not supported, " 92 | + "either due to license or platform."); 93 | enabled = false; 94 | } 95 | } 96 | 97 | void Start() { 98 | Create(); 99 | } 100 | 101 | /// Sets up the render texture and all the windows that will show parts of it. 102 | public void Create() { 103 | if (guiScreen != null) { 104 | guiScreen.Release(); 105 | } 106 | RenderTexture stereoScreen = Cardboard.SDK.StereoScreen; 107 | int width = stereoScreen ? stereoScreen.width : Screen.width; 108 | int height = stereoScreen ? stereoScreen.height : Screen.height; 109 | guiScreen = new RenderTexture(width, height, 0, RenderTextureFormat.ARGB32); 110 | guiScreen.Create(); 111 | foreach (var guiWindow in GetComponentsInChildren(true)) { 112 | guiWindow.Create(guiScreen); 113 | } 114 | } 115 | 116 | void LateUpdate() { 117 | // When not in VR Mode, let normal OnGUI() calls proceed. 118 | okToDraw = !Cardboard.SDK.VRModeEnabled; 119 | } 120 | 121 | void OnGUI() { 122 | if (!IsGUIVisible) { 123 | return; // Nothing to do. 124 | } 125 | // OnGUI() is called multiple times per frame: once with event type "Layout", 126 | // then once for each user input (key, mouse, touch, etc) that occurred in this 127 | // frame, then finally once with event type "Repaint", during which the actual 128 | // GUI drawing is done. This last phase is the one we have to capture. 129 | RenderTexture prevRT = null; 130 | if (Event.current.type == EventType.Repaint) { 131 | // Redirect rendering to our texture. 132 | prevRT = RenderTexture.active; 133 | RenderTexture.active = guiScreen; 134 | GL.Clear(false, true, background); 135 | } 136 | if (onGUICallback != null) { 137 | // Call all the OnGUI methods that have registered. 138 | okToDraw = true; 139 | onGUICallback(); 140 | okToDraw = false; 141 | } 142 | if (Event.current.type == EventType.Repaint) { 143 | CardboardOnGUIMouse cgm = GetComponent(); 144 | if (cgm != null) { 145 | cgm.DrawPointerImage(); 146 | } 147 | // Clean up. 148 | RenderTexture.active = prevRT; 149 | } 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/CardboardOnGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46945e3ed78924bdea8171f8de038346 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/CardboardOnGUIMouse.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | using System.Collections; 17 | 18 | /// @ingroup LegacyScripts 19 | /// Attach this script to the same object as CardboardOnGUI itself. It can draw a 20 | /// cursor image into the GUI texture to show the location of the mouse pointer. It 21 | /// supports moving the mouse with the user's gaze, and clicking on the UI with the 22 | /// trigger, but other mouse-controlling devices, such as gamepads, will work as well. 23 | public class CardboardOnGUIMouse : MonoBehaviour { 24 | 25 | /// If the app supports the use of some other pointing device, e.g. a gamepad 26 | /// or bluetooth mouse, then this field can be left null. When set to a 27 | /// CardboardHead instance, then the user's head in effect becomes the mouse 28 | /// pointer and the Cardboard trigger becomes the mouse button. The user 29 | /// looks at a GUI button and pulls the trigger to click it. 30 | [Tooltip("The CardboardHead which drives the simulated mouse.")] 31 | public CardboardHead head; 32 | 33 | /// The image to draw into the captured GUI texture representing the current 34 | /// pointer position. 35 | [Tooltip("What to draw on the GUI surface for the simulated mouse pointer.")] 36 | public Texture pointerImage; 37 | 38 | /// The size of the pointer image in _screen coordinates_, that is, the same 39 | /// coordinates used in your OnGUI functions to place UI elements on the screen 40 | /// when the app is not in VR Mode. It is independent of the actual resolution of 41 | /// the image. Leave at 0,0 to use actual image size. 42 | [Tooltip("The size to draw the pointer in screen coordinates. " + 43 | "Leave at 0,0 to use actual image size.")] 44 | public Vector2 pointerSize; 45 | 46 | /// The location of the pointer's _hot spot_ relative to the top left corner of 47 | /// the pointer image. This is in _screen coordinates_, and does not 48 | /// depend on the actual resolution of the pointer image. 49 | [Tooltip("The screen pixel of the image to position over the mouse point.")] 50 | public Vector2 pointerSpot; 51 | 52 | // Whether to draw a pointer on the GUI surface, so the user can see 53 | // where they are about to click. 54 | private bool pointerVisible; 55 | private int pointerX; 56 | private int pointerY; 57 | 58 | void LateUpdate() { 59 | if (head == null) { // Pointer not being controlled by user's head, so we bail. 60 | pointerVisible = true; // Draw pointer wherever Unity thinks the mouse is. 61 | return; 62 | } 63 | if (!CardboardOnGUI.IsGUIVisible) { 64 | pointerVisible = false; // No GUI == no pointer to worry about. 65 | return; 66 | } 67 | // Find which CardboardOnGUIWindow the user's gaze intersects first, if any. 68 | Ray ray = head.Gaze; 69 | CardboardOnGUIWindow hitWindow = null; 70 | float minDist = Mathf.Infinity; 71 | Vector2 pos = Vector2.zero; 72 | foreach (var guiWindow in GetComponentsInChildren()) { 73 | RaycastHit hit; 74 | if (guiWindow.GetComponent().Raycast(ray, out hit, Mathf.Infinity) 75 | && hit.distance < minDist) { 76 | minDist = hit.distance; 77 | hitWindow = guiWindow; 78 | pos = hit.textureCoord; 79 | } 80 | } 81 | if (hitWindow == null) { 82 | // Don't draw the pointer unless the user is looking at a pixel of the GUI screen. 83 | pointerVisible = false; 84 | return; 85 | } 86 | // Convert from the intersected window's texture coordinates to screen coordinates. 87 | pos.x = hitWindow.rect.xMin + hitWindow.rect.width * pos.x; 88 | pos.y = hitWindow.rect.yMin + hitWindow.rect.height * pos.y; 89 | pointerX = (int)(pos.x * Screen.width); 90 | pointerY = (int)(pos.y * Screen.height); 91 | // Move the mouse/touch point to the determined screen point. 92 | // Unity GUI Y-coordinates ascend top-to-bottom, as do the quad's texture coordinates, 93 | // while screen Y-coordinates ascend bottom-to-top. 94 | Cardboard.SDK.SetTouchCoordinates(pointerX, Screen.height - pointerY); 95 | // OK to draw the pointer image. 96 | pointerVisible = true; 97 | } 98 | 99 | // Draw the fake mouse pointer. Called by CardboardOnGUI after the rest of the UI is done. 100 | public void DrawPointerImage() { 101 | if (pointerImage == null || !pointerVisible || !enabled) { 102 | return; 103 | } 104 | Vector2 pos = new Vector2(pointerX, pointerY); 105 | Vector2 spot = pointerSpot; 106 | Vector2 size = pointerSize; 107 | if (size.sqrMagnitude < 1) { // If pointerSize was left == 0, just use size of image. 108 | size.x = pointerImage.width; 109 | size.y = pointerImage.height; 110 | } 111 | GUI.DrawTexture(new Rect(pos.x - spot.x, Screen.height - pos.y - spot.y, size.x, size.y), 112 | pointerImage, ScaleMode.StretchToFill); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/CardboardOnGUIMouse.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f06724eec91fb4704a525c71a8e8deea 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/CardboardOnGUIWindow.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | 17 | /// @ingroup LegacyScripts 18 | /// Works with CardboardOnGUI to show all or part of the OnGUI-rendered 19 | /// UI on a mesh in the scene. There should be one or more of these 20 | /// as children of the CardboardOnGUI gameobject. Each one specifies 21 | /// the region of the captured OnGUI screen to show on its own mesh. 22 | /// This allows you to place pieces of the GUI in the scene at different 23 | /// distances and angles to the user without having to change any of the 24 | /// OnGUI methods themselves. 25 | /// 26 | /// Each instance can pick out a different region of the GUI texture to show (see 27 | /// #rect). Use the object's transform to position and orient this region in 28 | /// space relative to the parent CardboardOnGUI object. The mesh is automatically 29 | /// scaled to account for the aspect ratio of the overall GUI. 30 | /// 31 | /// This layout is independent of the normal OnGUI layout when the app is not in VR Mode. 32 | /// The #enabled flag on individual CardboardOnGUIWindows can be used to turn on or 33 | /// off the separate regions of the GUI. 34 | /// 35 | /// It must be attached on a child gameobject of the CardboardOnGUI, 36 | /// accompanied by a `MeshFilter`, a `MeshRenderer`, and `Collider` components. 37 | /// The mesh will be used to draw the texture, and the collider used to check for 38 | /// intersections with the user's gaze for mouse positioning. 39 | /// 40 | /// The rendering code here takes care of shader and texture setup. The 41 | /// choice of mesh is yours, but a quad looks good. The mesh is scaled to 42 | /// match the aspect ratio of the screen region shown. The attached 43 | /// collider is used for ray instersection with the user's gaze, so it 44 | /// should return texture coordinates that match those of the meshfilter. 45 | [RequireComponent(typeof(MeshFilter))] 46 | [RequireComponent(typeof(MeshRenderer))] 47 | [RequireComponent(typeof(Collider))] 48 | public class CardboardOnGUIWindow : MonoBehaviour { 49 | private MeshRenderer meshRenderer; 50 | 51 | void Reset() { 52 | rect = new Rect(0,0,1,1); // Make window show the full GUI screen. 53 | } 54 | 55 | /// Determines the portion of the CardboardOnGUI texture to draw on the attached 56 | /// mesh. The units are exactly the same as a Camera component's `Viewport Rect`: 57 | /// `(0,0)` is the bottom left corner and `(1,1)` the top right. Use it to pick out 58 | /// the region of the GUI to draw on this mesh. 59 | [Tooltip("The portion of the OnGUI screen to show in this window. " + 60 | "Use the same units as for Camera viewports.")] 61 | public Rect rect; 62 | 63 | void Awake() { 64 | meshRenderer = GetComponent(); 65 | if (!SystemInfo.supportsRenderTextures) { 66 | enabled = false; 67 | } 68 | } 69 | 70 | /// Make a material that points to the target texture. Texture scale 71 | /// and offset will be controlled by #rect. 72 | public void Create(RenderTexture target) { 73 | meshRenderer.material = new Material(Shader.Find("Cardboard/GUIScreen")) { 74 | mainTexture = target, 75 | mainTextureOffset = rect.position, 76 | mainTextureScale = rect.size 77 | }; 78 | } 79 | 80 | // Turn off this window. 81 | void OnDisable() { 82 | meshRenderer.enabled = false; 83 | } 84 | 85 | void LateUpdate() { 86 | // Only render window when the overall GUI is enabled. 87 | meshRenderer.enabled = CardboardOnGUI.IsGUIVisible; 88 | // Keep material and object scale in sync with rect. 89 | meshRenderer.material.mainTextureOffset = rect.position; 90 | meshRenderer.material.mainTextureScale = rect.size; 91 | float aspect = (Screen.width * rect.width) / 92 | (Screen.height * rect.height); 93 | transform.localScale = new Vector3(aspect, 1, 1); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/CardboardOnGUIWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b076d97177f8c446c97ffb15e968d1af 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/LegacyCardboardAndroidDevice.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #if UNITY_ANDROID 15 | 16 | using System.Runtime.InteropServices; 17 | using UnityEngine; 18 | 19 | // Android device using the Google Cardboard SDK for Android. 20 | public class LegacyCardboardAndroidDevice : BaseAndroidDevice { 21 | [DllImport("RenderingPlugin")] 22 | private static extern void InitFromUnity(int textureID); 23 | 24 | // Event IDs supported by our native render plugin. 25 | private const int kPerformDistortionCorrection = 1; 26 | private const int kDrawCardboardUILayer = 2; 27 | 28 | private const string cardboardClass = 29 | "com.google.vrtoolkit.cardboard.plugins.unity.UnityCardboardActivity"; 30 | 31 | private Matrix4x4 headView = new Matrix4x4(); 32 | private Matrix4x4 leftEyeView = new Matrix4x4(); 33 | private Matrix4x4 rightEyeView = new Matrix4x4(); 34 | 35 | private float[] frameInfo = null; 36 | 37 | public override void Init() { 38 | ConnectToActivity(); 39 | } 40 | 41 | protected override void ConnectToActivity() { 42 | try { 43 | using (AndroidJavaClass player = new AndroidJavaClass(cardboardClass)) { 44 | androidActivity = player.CallStatic("getActivity"); 45 | } 46 | } catch (AndroidJavaException e) { 47 | androidActivity = null; 48 | Debug.LogError("Cannot access UnityCardboardActivity. " 49 | + "Verify that the jar is in Assets/Plugins/Android. " + e); 50 | } 51 | } 52 | 53 | public override void SetDistortionCorrectionEnabled(bool enabled) { 54 | CallObjectMethod(androidActivity, "setDistortionCorrectionEnabled", enabled); 55 | } 56 | 57 | public override void SetVRModeEnabled(bool enabled) { 58 | CallObjectMethod(androidActivity, "setVRModeEnabled", enabled); 59 | } 60 | 61 | public override void SetAlignmentMarkerEnabled(bool enabled) { 62 | CallObjectMethod(androidActivity, "setAlignmentMarkerEnabled", enabled); 63 | } 64 | 65 | public override void SetSettingsButtonEnabled(bool enabled) { 66 | CallObjectMethod(androidActivity, "setSettingsButtonEnabled", enabled); 67 | } 68 | 69 | public override void SetTapIsTrigger(bool enabled) { 70 | CallObjectMethod(androidActivity, "setTapIsTrigger", enabled); 71 | } 72 | 73 | public override void SetNeckModelScale(float scale) { 74 | CallObjectMethod(androidActivity, "setNeckModelFactor", scale); 75 | } 76 | 77 | public override void SetAutoDriftCorrectionEnabled(bool enabled) { 78 | CallObjectMethod(androidActivity, "setGyroBiasEstimationEnabled", enabled); 79 | } 80 | 81 | public override void SetStereoScreen(RenderTexture stereoScreen) { 82 | if (androidActivity != null) { 83 | InitFromUnity(stereoScreen != null ? stereoScreen.GetNativeTextureID() : 0); 84 | } 85 | } 86 | 87 | public override void UpdateState() { 88 | // Pass nominal clip distances - will correct later for each camera. 89 | if (!CallObjectMethod(ref frameInfo, androidActivity, "getFrameParams", 1.0f /* near */, 1000.0f /* far */)) { 90 | return; 91 | } 92 | 93 | // Extract the matrices (currently that's all we get back). 94 | int j = 0; 95 | for (int i = 0; i < 16; ++i, ++j) { 96 | headView[i] = frameInfo[j]; 97 | } 98 | for (int i = 0; i < 16; ++i, ++j) { 99 | leftEyeView[i] = frameInfo[j]; 100 | } 101 | for (int i = 0; i < 16; ++i, ++j) { 102 | leftEyeDistortedProjection[i] = frameInfo[j]; 103 | } 104 | for (int i = 0; i < 16; ++i, ++j) { 105 | rightEyeView[i] = frameInfo[j]; 106 | } 107 | for (int i = 0; i < 16; ++i, ++j) { 108 | rightEyeDistortedProjection[i] = frameInfo[j]; 109 | } 110 | for (int i = 0; i < 16; ++i, ++j) { 111 | leftEyeUndistortedProjection[i] = frameInfo[j]; 112 | } 113 | for (int i = 0; i < 16; ++i, ++j) { 114 | rightEyeUndistortedProjection[i] = frameInfo[j]; 115 | } 116 | 117 | leftEyeUndistortedViewport = new Rect(frameInfo[j], frameInfo[j+1], 118 | frameInfo[j+2], frameInfo[j+3]); 119 | leftEyeDistortedViewport = leftEyeUndistortedViewport; 120 | j += 4; 121 | rightEyeUndistortedViewport = new Rect(frameInfo[j], frameInfo[j+1], 122 | frameInfo[j+2], frameInfo[j+3]); 123 | rightEyeDistortedViewport = rightEyeUndistortedViewport; 124 | 125 | // Convert views to left-handed coordinates because Unity uses them 126 | // for Transforms, which is what we will update from the views. 127 | // Also invert because the incoming matrices go from camera space to 128 | // cardboard space, and we want the opposite. 129 | // Lastly, cancel out the head rotation from the eye views, 130 | // because we are applying that on a parent object. 131 | leftEyePose.SetRightHanded(headView * leftEyeView.inverse); 132 | rightEyePose.SetRightHanded(headView * rightEyeView.inverse); 133 | headPose.SetRightHanded(headView.inverse); 134 | } 135 | 136 | override public void UpdateScreenData() { 137 | CardboardProfile.Device device = new CardboardProfile.Device(); 138 | CardboardProfile.Screen screen = new CardboardProfile.Screen(); 139 | 140 | float[] lensData = null; 141 | if (CallObjectMethod(ref lensData, androidActivity, "getLensParameters")) { 142 | device.lenses.separation = lensData[0]; 143 | device.lenses.offset = lensData[1]; 144 | device.lenses.screenDistance = lensData[2]; 145 | device.lenses.alignment = (int)lensData[3]; 146 | } 147 | 148 | float[] screenSize = null; 149 | if (CallObjectMethod(ref screenSize, androidActivity, "getScreenSizeMeters")) { 150 | screen.width = screenSize[0]; 151 | screen.height = screenSize[1]; 152 | screen.border = screenSize[2]; 153 | } 154 | 155 | float[] distCoeff = null; 156 | if (CallObjectMethod(ref distCoeff, androidActivity, "getDistortionCoefficients")) { 157 | device.distortion.k1 = distCoeff[0]; 158 | device.distortion.k2 = distCoeff[1]; 159 | } 160 | 161 | float[] invDistCoeff = null; 162 | if (CallObjectMethod(ref invDistCoeff, androidActivity, "getInverseDistortionCoefficients")) { 163 | device.inverse.k1 = invDistCoeff[0]; 164 | device.inverse.k2 = invDistCoeff[1]; 165 | } 166 | 167 | float[] maxFov = null; 168 | if (CallObjectMethod(ref maxFov, androidActivity, "getLeftEyeMaximumFOV")) { 169 | device.maxFOV.outer = maxFov[0]; 170 | device.maxFOV.upper = maxFov[1]; 171 | device.maxFOV.inner = maxFov[2]; 172 | device.maxFOV.lower = maxFov[3]; 173 | } 174 | 175 | Profile.screen = screen; 176 | Profile.device = device; 177 | } 178 | 179 | public override void Recenter() { 180 | CallObjectMethod(androidActivity, "resetHeadTracker"); 181 | } 182 | 183 | public override void SetTouchCoordinates(int x, int y) { 184 | CallObjectMethod(androidActivity, "setTouchCoordinates", x, y); 185 | } 186 | 187 | public override void PostRender(bool vrMode) { 188 | if (vrMode) { 189 | if (Cardboard.SDK.DistortionCorrection && Cardboard.SDK.NativeDistortionCorrectionSupported) { 190 | GL.IssuePluginEvent(kPerformDistortionCorrection); 191 | } 192 | if (Cardboard.SDK.EnableAlignmentMarker || Cardboard.SDK.EnableSettingsButton) { 193 | GL.IssuePluginEvent(kDrawCardboardUILayer); 194 | } 195 | GL.InvalidateState(); 196 | } 197 | } 198 | } 199 | 200 | #endif 201 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/LegacyCardboardAndroidDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db872f1aa734f41e7a966fee8092e251 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/SkyboxMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1842d86d69a644a109b06ba5a5935819 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/StereoLensFlare.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | using System.Collections; 17 | 18 | /// @ingroup LegacyScripts 19 | /// Unity 4's built-in lens flares do not work correctly for stereo rendering when in 20 | /// Directional mode, for similar reasons as the skybox mentioned previously. This 21 | /// script can be attached to a Lens Flare to make it stereo-aware directional. 22 | /// 23 | /// To use it, add the script to a Lens Flare and clear the flare's Directional flag 24 | /// so that the flare is actually positional. This script keeps the flare at a 25 | /// distance well away from the mono camera along the flare's own forward vector, 26 | /// thus recreating the directional behavior, but with proper stereo parallax. The 27 | /// flare is repositioned relative to each camera that renders it. 28 | [RequireComponent(typeof(LensFlare))] 29 | public class StereoLensFlare : MonoBehaviour { 30 | #if UNITY_5 31 | void Awake() { 32 | Debug.Log("StereoLensFlare is not needed in Unity 5."); 33 | Component.Destroy(this); 34 | } 35 | #else 36 | /// Sets the distance to the flare as a fraction of the camera's far clipping distance. 37 | [Tooltip("Fraction of the camera's far clip distance " + 38 | "at which to position the flare.")] 39 | [Range(0,1)] 40 | public float range = 0.75f; 41 | 42 | // Position the flare relative to the camera about to render it. 43 | void OnWillRenderObject() { 44 | transform.position = Camera.current.transform.position - 45 | range * Camera.current.farClipPlane * transform.forward; 46 | } 47 | #endif 48 | } 49 | -------------------------------------------------------------------------------- /Assets/Cardboard/Legacy/Scripts/StereoLensFlare.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c99539c899ef4de09438c9a626c0c91 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80e6cdf429de247a792161c31b9b2ce2 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Prefabs/CardboardAdapter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 20: {fileID: 2000000} 12 | - 92: {fileID: 9200000} 13 | - 124: {fileID: 12400000} 14 | - 114: {fileID: 11400000} 15 | m_Layer: 0 16 | m_Name: Camera Right 17 | m_TagString: Untagged 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!1 &100002 23 | GameObject: 24 | m_ObjectHideFlags: 0 25 | m_PrefabParentObject: {fileID: 0} 26 | m_PrefabInternal: {fileID: 100100000} 27 | serializedVersion: 4 28 | m_Component: 29 | - 4: {fileID: 400002} 30 | - 20: {fileID: 2000002} 31 | - 92: {fileID: 9200002} 32 | - 124: {fileID: 12400002} 33 | - 114: {fileID: 11400002} 34 | m_Layer: 0 35 | m_Name: Camera Left 36 | m_TagString: Untagged 37 | m_Icon: {fileID: 0} 38 | m_NavMeshLayer: 0 39 | m_StaticEditorFlags: 0 40 | m_IsActive: 1 41 | --- !u!1 &100004 42 | GameObject: 43 | m_ObjectHideFlags: 0 44 | m_PrefabParentObject: {fileID: 0} 45 | m_PrefabInternal: {fileID: 100100000} 46 | serializedVersion: 4 47 | m_Component: 48 | - 4: {fileID: 400004} 49 | - 114: {fileID: 11400004} 50 | m_Layer: 0 51 | m_Name: CardboardAdapter 52 | m_TagString: Untagged 53 | m_Icon: {fileID: 0} 54 | m_NavMeshLayer: 0 55 | m_StaticEditorFlags: 0 56 | m_IsActive: 1 57 | --- !u!4 &400000 58 | Transform: 59 | m_ObjectHideFlags: 1 60 | m_PrefabParentObject: {fileID: 0} 61 | m_PrefabInternal: {fileID: 100100000} 62 | m_GameObject: {fileID: 100000} 63 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 64 | m_LocalPosition: {x: .0299999993, y: 0, z: 0} 65 | m_LocalScale: {x: 1, y: 1, z: 1} 66 | m_Children: [] 67 | m_Father: {fileID: 400004} 68 | m_RootOrder: 0 69 | --- !u!4 &400002 70 | Transform: 71 | m_ObjectHideFlags: 1 72 | m_PrefabParentObject: {fileID: 0} 73 | m_PrefabInternal: {fileID: 100100000} 74 | m_GameObject: {fileID: 100002} 75 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 76 | m_LocalPosition: {x: -.0299999993, y: 0, z: 0} 77 | m_LocalScale: {x: 1, y: 1, z: 1} 78 | m_Children: [] 79 | m_Father: {fileID: 400004} 80 | m_RootOrder: 1 81 | --- !u!4 &400004 82 | Transform: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 100004} 87 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 88 | m_LocalPosition: {x: 0, y: 0, z: 0} 89 | m_LocalScale: {x: 1, y: 1, z: 1} 90 | m_Children: 91 | - {fileID: 400000} 92 | - {fileID: 400002} 93 | m_Father: {fileID: 0} 94 | m_RootOrder: 0 95 | --- !u!20 &2000000 96 | Camera: 97 | m_ObjectHideFlags: 1 98 | m_PrefabParentObject: {fileID: 0} 99 | m_PrefabInternal: {fileID: 100100000} 100 | m_GameObject: {fileID: 100000} 101 | m_Enabled: 0 102 | serializedVersion: 2 103 | m_ClearFlags: 1 104 | m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} 105 | m_NormalizedViewPortRect: 106 | serializedVersion: 2 107 | x: .5 108 | y: 0 109 | width: .5 110 | height: 1 111 | near clip plane: .300000012 112 | far clip plane: 1000 113 | field of view: 60 114 | orthographic: 0 115 | orthographic size: 5 116 | m_Depth: 0 117 | m_CullingMask: 118 | serializedVersion: 2 119 | m_Bits: 4294967295 120 | m_RenderingPath: -1 121 | m_TargetTexture: {fileID: 0} 122 | m_TargetDisplay: 0 123 | m_HDR: 0 124 | m_OcclusionCulling: 1 125 | m_StereoConvergence: 10 126 | m_StereoSeparation: .0219999999 127 | --- !u!20 &2000002 128 | Camera: 129 | m_ObjectHideFlags: 1 130 | m_PrefabParentObject: {fileID: 0} 131 | m_PrefabInternal: {fileID: 100100000} 132 | m_GameObject: {fileID: 100002} 133 | m_Enabled: 0 134 | serializedVersion: 2 135 | m_ClearFlags: 1 136 | m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} 137 | m_NormalizedViewPortRect: 138 | serializedVersion: 2 139 | x: 0 140 | y: 0 141 | width: .5 142 | height: 1 143 | near clip plane: .300000012 144 | far clip plane: 1000 145 | field of view: 60 146 | orthographic: 0 147 | orthographic size: 5 148 | m_Depth: 0 149 | m_CullingMask: 150 | serializedVersion: 2 151 | m_Bits: 4294967295 152 | m_RenderingPath: -1 153 | m_TargetTexture: {fileID: 0} 154 | m_TargetDisplay: 0 155 | m_HDR: 0 156 | m_OcclusionCulling: 1 157 | m_StereoConvergence: 10 158 | m_StereoSeparation: .0219999999 159 | --- !u!92 &9200000 160 | Behaviour: 161 | m_ObjectHideFlags: 1 162 | m_PrefabParentObject: {fileID: 0} 163 | m_PrefabInternal: {fileID: 100100000} 164 | m_GameObject: {fileID: 100000} 165 | m_Enabled: 1 166 | --- !u!92 &9200002 167 | Behaviour: 168 | m_ObjectHideFlags: 1 169 | m_PrefabParentObject: {fileID: 0} 170 | m_PrefabInternal: {fileID: 100100000} 171 | m_GameObject: {fileID: 100002} 172 | m_Enabled: 1 173 | --- !u!114 &11400000 174 | MonoBehaviour: 175 | m_ObjectHideFlags: 1 176 | m_PrefabParentObject: {fileID: 0} 177 | m_PrefabInternal: {fileID: 100100000} 178 | m_GameObject: {fileID: 100000} 179 | m_Enabled: 1 180 | m_EditorHideFlags: 0 181 | m_Script: {fileID: 11500000, guid: 5c9cfdc6c389e2742aa40f991195d828, type: 3} 182 | m_Name: 183 | m_EditorClassIdentifier: 184 | eye: 1 185 | --- !u!114 &11400002 186 | MonoBehaviour: 187 | m_ObjectHideFlags: 1 188 | m_PrefabParentObject: {fileID: 0} 189 | m_PrefabInternal: {fileID: 100100000} 190 | m_GameObject: {fileID: 100002} 191 | m_Enabled: 1 192 | m_EditorHideFlags: 0 193 | m_Script: {fileID: 11500000, guid: 5c9cfdc6c389e2742aa40f991195d828, type: 3} 194 | m_Name: 195 | m_EditorClassIdentifier: 196 | eye: 0 197 | --- !u!114 &11400004 198 | MonoBehaviour: 199 | m_ObjectHideFlags: 1 200 | m_PrefabParentObject: {fileID: 0} 201 | m_PrefabInternal: {fileID: 100100000} 202 | m_GameObject: {fileID: 100004} 203 | m_Enabled: 1 204 | m_EditorHideFlags: 0 205 | m_Script: {fileID: 11500000, guid: f1578549c7fcc4f6fa1b063992091672, type: 3} 206 | m_Name: 207 | m_EditorClassIdentifier: 208 | target: {fileID: 0} 209 | updateEarly: 0 210 | --- !u!124 &12400000 211 | Behaviour: 212 | m_ObjectHideFlags: 1 213 | m_PrefabParentObject: {fileID: 0} 214 | m_PrefabInternal: {fileID: 100100000} 215 | m_GameObject: {fileID: 100000} 216 | m_Enabled: 1 217 | --- !u!124 &12400002 218 | Behaviour: 219 | m_ObjectHideFlags: 1 220 | m_PrefabParentObject: {fileID: 0} 221 | m_PrefabInternal: {fileID: 100100000} 222 | m_GameObject: {fileID: 100002} 223 | m_Enabled: 1 224 | --- !u!1001 &100100000 225 | Prefab: 226 | m_ObjectHideFlags: 1 227 | serializedVersion: 2 228 | m_Modification: 229 | m_TransformParent: {fileID: 0} 230 | m_Modifications: [] 231 | m_RemovedComponents: [] 232 | m_ParentPrefab: {fileID: 0} 233 | m_RootGameObject: {fileID: 100004} 234 | m_IsPrefabParent: 1 235 | m_IsExploded: 1 236 | -------------------------------------------------------------------------------- /Assets/Cardboard/Prefabs/CardboardAdapter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2caa624e4c89492dbb6df8d93901ef9 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Cardboard/Prefabs/CardboardHead.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 691bf3e71b387435bb6304e28d671b2f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Cardboard/Prefabs/CardboardMain.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8b03d395f5734e98af91ccf44f9bf47 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Cardboard/Prefabs/Prefabs.md: -------------------------------------------------------------------------------- 1 | # Prefabs 2 | 3 | This section describes the prefabs that are provided by the package. 4 | 5 | ## CardboardMain 6 | 7 | This prefab is intended to be a drop-in replacement for a normal Unity camera, 8 | such as _Main Camera_, primarily when the camera is simple, i.e. not already 9 | festooned with scripts. A brand new Unity project is a good time to use it. To 10 | apply it in the Editor, delete the camera in question and replace it with an 11 | instance of this prefab. 12 | 13 | The prefab contains a top-level object called _CardboardMain_, which has a 14 | Cardboard script attached to it for controlling VR Mode settings. Under this is 15 | the _Head_ object, which has a _%CardboardHead_ attached for tracking the user's 16 | head motion. That in turn has a _Main Camera_ child object, with the 17 | StereoController script attached. This camera is tagged as a _MainCamera_ so 18 | that the Unity property `Camera.main` will find it. Finally there are the Left 19 | and Right stereo eye cameras at the bottom of the hierarchy. 20 | 21 | ## %CardboardHead 22 | 23 | This prefab is a replacement for other cameras in the scene that also need 24 | head-tracking. It has a top-level object called _Head_ with a CardboardHead 25 | script. Under that is the _Camera_ child which has the StereoController script, 26 | and then the Left and Right stereo eye cameras. Unlike _CardboardMain_, the 27 | camera in this prefab is not tagged _MainCamera_. 28 | 29 | ## CardboardAdapter 30 | 31 | This prefab is for when you wish to keep your existing Camera object, usually 32 | because it is heavily wired with game logic and already moves exactly as needed 33 | for non-VR game play. Place this prefab as a child of the camera, and then 34 | execute _Update Stereo Cameras_ (or manually attach StereoController to the 35 | camera) to complete the rig. 36 | 37 | Unlike the other prefabs, this setup places the head-tracked node below the Main 38 | Camera. Therefore, only the stereo cameras are affected by the user's head 39 | motion. 40 | 41 | ## General Prefab Notes 42 | 43 | Each prefab is provided as a starting point for customization. It is a 44 | framework on which to attach additional scripts for your own needs. Elements 45 | under a Head node will maintain a fixed position on screen, thus acting like a 46 | Heads-up Display (HUD). Elements that are siblings of Head will maintain a 47 | fixed position and orientation relative to the overall point of view, thus 48 | acting more like a cockpit instrument panel. 49 | -------------------------------------------------------------------------------- /Assets/Cardboard/Prefabs/Prefabs.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f8c22db860c74992b7504478c45c8d3 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Cardboard/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5cce34e4c5954a0b8bdf30ff6a18430 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Resources/CardboardSettingsButton.png.bytes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Cardboard/Resources/CardboardSettingsButton.png.bytes -------------------------------------------------------------------------------- /Assets/Cardboard/Resources/CardboardSettingsButton.png.bytes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 205a8735b72af4a9d8602dda9a983f2f 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Cardboard/Resources/RadialUndistortionEffect.shader: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | Shader "Cardboard/Radial Undistortion" { 16 | 17 | Properties { 18 | _MainTex ("Base (RGB)", 2D) = "white" {} 19 | } 20 | 21 | SubShader { 22 | Tags { "RenderType" = "Opaque" } 23 | LOD 150 24 | 25 | Pass { 26 | CGPROGRAM 27 | #include "UnityCG.cginc" 28 | #pragma vertex vert 29 | #pragma fragment frag 30 | 31 | struct v2f { 32 | float4 vertex : SV_POSITION; 33 | half2 texcoord : TEXCOORD0; 34 | }; 35 | 36 | sampler2D _MainTex; 37 | float4 _MainTex_ST; 38 | 39 | float4 _Distortion; // Radial distortion coefficients. 40 | float4 _Projection; // Bits of the lens-affected projection matrix. 41 | float4 _Unprojection; // Bits of the no-lens projection matrix. 42 | 43 | v2f vert (appdata_base v) { 44 | // This is totally standard code, including the _MainTex transform. 45 | v2f o; 46 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 47 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 48 | return o; 49 | } 50 | 51 | fixed4 frag (v2f i) : SV_Target { 52 | // i.texcoord refers to the onscreen pixel we want to color. We have to find the 53 | // corresponding pixel in the rendered texture, which means going through the lens' 54 | // distortion transformation. 55 | // First: go from these onscreen texture coordinates back into camera space, using parts 56 | // of the projection matrix for the "no lens" frustum. (We don't need the whole matrix 57 | // because we don't care about Z.) 58 | float2 tex = (i.texcoord + _Unprojection.zw) / _Unprojection.xy; 59 | // Second: Radially distort the vector according to the lens' coefficients (pincushion). 60 | float r2 = dot(tex, tex); 61 | tex *= 1 + (_Distortion.x + _Distortion.y * r2) * r2; 62 | // Reproject the vector into the lens-affected frustum to get the texture coordinates 63 | // to look up. 64 | tex = saturate(tex * _Projection.xy - _Projection.zw); 65 | // Get the color. 66 | fixed vignette = saturate(min(min(tex.x, 1-tex.x), min(tex.y, 1-tex.y)) / 0.03); 67 | fixed4 col = lerp(fixed4(0,0,0,1), tex2D(_MainTex, tex), vignette); 68 | return col; 69 | } 70 | ENDCG 71 | } 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /Assets/Cardboard/Resources/RadialUndistortionEffect.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 666b803d917634f0fa8bc0cbfbbf1604 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Cardboard/Resources/SolidColor.shader: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | Shader "Cardboard/SolidColor" { 16 | Properties { 17 | _Color ("Main Color", COLOR) = (1,1,1,1) 18 | } 19 | SubShader { 20 | Pass { Color [_Color] } 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/Cardboard/Resources/SolidColor.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: beaebe8e7b47e4c0b93b51fad8fb14a2 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f01aa5c8e7de4973aa7785e6b4dc993 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/Cardboard.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a40b544b8c3553c40852ae7ad35a9343 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/CardboardEye.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c9cfdc6c389e2742aa40f991195d828 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/CardboardHead.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | 17 | /// @ingroup Scripts 18 | /// Attach this script to any game object that should match the user's head motion. 19 | /// By default, it continuously updates the local transform to Cardboard.HeadView. 20 | /// A target object may be specified to provide an alternate reference frame for the motion. 21 | /// 22 | /// This script will typically be attached to directly to a Camera object, or to its 23 | /// parent if you need to offset the camera from the origin. 24 | /// Alternatively it can be inserted as a child of the Camera and parent of the 25 | /// CardboardEye camera. Do this if you already have steering logic driving the 26 | /// mono Camera and wish to have the user's head motion be relative to that. Note 27 | /// that in the latter setup, head tracking is visible only when VR Mode is enabled. 28 | /// 29 | /// In some cases you may need two instances of CardboardHead, referring to two 30 | /// different targets (one of which may be the parent), in order to split where 31 | /// the rotation is applied from where the positional offset is applied. Use the 32 | /// #trackRotation and #trackPosition properties in this case. 33 | public class CardboardHead : MonoBehaviour { 34 | /// Determines whether to apply the user's head rotation to this gameobject's 35 | /// orientation. 36 | public bool trackRotation = true; 37 | 38 | /// Determines whether to apply ther user's head offset to this gameobject's 39 | /// position. 40 | public bool trackPosition = true; 41 | 42 | /// The user's head motion will be applied in this object's reference frame 43 | /// instead of the head object's parent. A good use case is for head-based 44 | /// steering. Normally, turning the parent object (i.e. the body or vehicle) 45 | /// towards the direction the user is looking would carry the head along with it, 46 | /// thus creating a positive feedback loop. Use an external target object as a 47 | /// fixed point of reference for the direction the user is looking. Often, the 48 | /// grandparent or higher ancestor is a suitable target. 49 | public Transform target; 50 | 51 | 52 | /// Determines whether the head tracking is applied during `LateUpdate()` or 53 | /// `Update()`. The default is `LateUpdate()` to reduce latency. However, some 54 | /// scripts need to use the camera's direction to affect the game play, e.g by 55 | /// casting rays or steering a vehicle, during the `LateUpdate()` phase. 56 | /// 57 | /// This can cause an annoying jitter because Unity, during this `LateUpdate()` 58 | /// phase, will update the head object first on some frames but second on others. 59 | /// If this is the case for your game, try switching the head to use `Update()` 60 | /// by setting this to true. 61 | public bool updateEarly = false; 62 | 63 | /// Returns a ray based on the heads position and forward direction, after making 64 | /// sure the transform is up to date. Use to raycast into the scene to determine 65 | /// objects that the user is looking at. 66 | public Ray Gaze { 67 | get { 68 | UpdateHead(); 69 | return new Ray(transform.position, transform.forward); 70 | } 71 | } 72 | 73 | private bool updated; 74 | 75 | void Update() { 76 | updated = false; // OK to recompute head pose. 77 | if (updateEarly) { 78 | UpdateHead(); 79 | } 80 | } 81 | 82 | // Normally, update head pose now. 83 | void LateUpdate() { 84 | UpdateHead(); 85 | } 86 | 87 | // Compute new head pose. 88 | private void UpdateHead() { 89 | if (updated) { // Only one update per frame, please. 90 | return; 91 | } 92 | updated = true; 93 | Cardboard.SDK.UpdateState(); 94 | 95 | if (trackRotation) { 96 | var rot = Cardboard.SDK.HeadPose.Orientation; 97 | if (target == null) { 98 | transform.localRotation = rot; 99 | } else { 100 | transform.rotation = rot * target.rotation; 101 | } 102 | } 103 | 104 | if (trackPosition) { 105 | Vector3 pos = Cardboard.SDK.HeadPose.Position; 106 | if (target == null) { 107 | transform.localPosition = pos; 108 | } else { 109 | transform.position = target.position + target.rotation * pos; 110 | } 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/CardboardHead.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1578549c7fcc4f6fa1b063992091672 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/CardboardProfile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cc48090f46d244bba130fef5ad58876 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/CardboardUILayer.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | 17 | /// @ingroup Scripts 18 | public class CardboardUILayer { 19 | // The gear has 6 identical sections, each spanning 60 degrees. 20 | const float kAnglePerGearSection = 60; 21 | 22 | // Half-angle of the span of the outer rim. 23 | const float kOuterRimEndAngle = 12; 24 | 25 | // Angle between the middle of the outer rim and the start of the inner rim. 26 | const float kInnerRimBeginAngle = 20; 27 | 28 | // Distance from center to outer rim, normalized so that the entire model 29 | // fits in a [-1, 1] x [-1, 1] square. 30 | const float kOuterRadius = 1; 31 | 32 | // Distance from center to depressed rim, in model units. 33 | const float kMiddleRadius = 0.75f; 34 | 35 | // Radius of the inner hollow circle, in model units. 36 | const float kInnerRadius = 0.3125f; 37 | 38 | // Center line thickness in DP. 39 | const float kCenterLineThicknessDp = 4; 40 | 41 | // Button width in DP. 42 | const int kButtonWidthDp = 28; 43 | 44 | // Factor to scale the touch area that responds to the touch. 45 | const float kTouchSlopFactor = 1.5f; 46 | 47 | static readonly float[] Angles = { 48 | 0, kOuterRimEndAngle, kInnerRimBeginAngle, 49 | kAnglePerGearSection - kInnerRimBeginAngle, kAnglePerGearSection - kOuterRimEndAngle 50 | }; 51 | 52 | private Material material; 53 | private float centerWidthPx; 54 | private float buttonWidthPx; 55 | private float xScale; 56 | private float yScale; 57 | private Matrix4x4 xfm; 58 | 59 | private void ComputeMatrix() { 60 | centerWidthPx = kCenterLineThicknessDp / 160.0f * Screen.dpi / 2; 61 | buttonWidthPx = kButtonWidthDp / 160.0f * Screen.dpi / 2; 62 | xScale = buttonWidthPx / Screen.width; 63 | yScale = buttonWidthPx / Screen.height; 64 | xfm = Matrix4x4.TRS(new Vector3(0.5f, yScale, 0), Quaternion.identity, 65 | new Vector3(xScale, yScale, 1)); 66 | } 67 | 68 | public CardboardUILayer() { 69 | material = new Material(Shader.Find("Cardboard/SolidColor")); 70 | material.color = new Color(0.8f, 0.8f, 0.8f); 71 | if (!Application.isEditor) { 72 | ComputeMatrix(); 73 | } 74 | } 75 | 76 | public void Draw() { 77 | if (Cardboard.SDK.NativeUILayerSupported) { 78 | return; 79 | } 80 | GL.Clear(true, false, Color.black); 81 | material.SetPass(0); 82 | if (Application.isEditor) { 83 | ComputeMatrix(); 84 | } 85 | if (Cardboard.SDK.EnableAlignmentMarker) { 86 | int x = Screen.width / 2; 87 | int w = (int)centerWidthPx; 88 | int h = (int)(2 * kTouchSlopFactor * buttonWidthPx); 89 | GL.PushMatrix(); 90 | GL.LoadPixelMatrix(); 91 | GL.Begin(GL.QUADS); 92 | GL.Vertex3(x - w, h, 0); 93 | GL.Vertex3(x - w, Screen.height - h, 0); 94 | GL.Vertex3(x + w, Screen.height - h, 0); 95 | GL.Vertex3(x + w, h, 0); 96 | GL.End(); 97 | GL.PopMatrix(); 98 | } 99 | #if UNITY_EDITOR 100 | if (Cardboard.SDK.EnableSettingsButton) { 101 | GL.PushMatrix(); 102 | GL.LoadOrtho(); 103 | GL.MultMatrix(xfm); 104 | GL.Begin(GL.TRIANGLE_STRIP); 105 | for (int i = 0, n = Angles.Length * 6; i <= n; i++) { 106 | float theta = (i / Angles.Length) * kAnglePerGearSection + Angles[i % Angles.Length]; 107 | float angle = (90 - theta) * Mathf.Deg2Rad; 108 | float x = Mathf.Cos(angle); 109 | float y = Mathf.Sin(angle); 110 | float mod = Mathf.PingPong(theta, kAnglePerGearSection / 2); 111 | float lerp = (mod - kOuterRimEndAngle) / (kInnerRimBeginAngle - kOuterRimEndAngle); 112 | float r = Mathf.Lerp(kOuterRadius, kMiddleRadius, lerp); 113 | GL.Vertex3(kInnerRadius * x, kInnerRadius * y, 0); 114 | GL.Vertex3(r * x, r * y, 0); 115 | } 116 | GL.End(); 117 | GL.PopMatrix(); 118 | } 119 | #endif 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/CardboardUILayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afe1f3fe45686401589f854166d4989e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/GazeInputModule.cs: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2014, Unity Technologies & Google, Inc. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | using UnityEngine; 24 | using UnityEngine.EventSystems; 25 | 26 | /// @ingroup Scripts 27 | /// This script provides an implemention of Unity's `BaseInputModule` class, so 28 | /// that Canvas-based UI elements (_uGUI_) can be selected by looking at them and 29 | /// pulling the trigger or touching the screen. 30 | /// This uses the player's gaze and the magnet trigger as a raycast generator. 31 | /// 32 | /// To use, attach to the scene's EventSystem object. Set the Canvas 33 | /// object's Render Mode to World Space, and set its Event Camera to a (mono) camera that is 34 | /// controlled by a CardboardHead. If you'd like gaze to work with 3D scene objects, add a 35 | /// PhysicsRaycaster to the gazing camera, and add a component that implements one of the Event 36 | /// interfaces (EventTrigger will work nicely). The objects must have colliders too. 37 | /// 38 | /// GazeInputModule emits the following events: _Enter_, _Exit_, _Down_, _Up_, 39 | /// _Click_, _Select_, _Deselect_, and _UpdateSelected_. Scroll, drag and drop, 40 | /// move, and submit/cancel events are not emitted. 41 | public class GazeInputModule : BaseInputModule { 42 | /// Determines whether gaze input is active in VR Mode only (`true`), or all of the 43 | /// time (`false`). Set to false if you plan to use direct screen taps or other 44 | /// input when not in VR Mode. 45 | [Tooltip("Whether gaze input is active in VR Mode only (true), or all the time (false).")] 46 | public bool vrModeOnly = false; 47 | 48 | /// An optional object to be placed at a raycast intersection, acting as a 3D 49 | /// cursor. **Important:** Be sure to set any raycasters to ignore the layer that 50 | /// this object is in. 51 | [Tooltip("Optional object to place at raycast intersections as a 3D cursor. " + 52 | "Be sure it is on a layer that raycasts will ignore.")] 53 | public GameObject cursor; 54 | 55 | /// Time in seconds between the pointer down and up events sent by a magnet click. 56 | /// Allows time for the UI elements to make their state transitions. 57 | [HideInInspector] 58 | public float clickTime = 0.1f; // Based on default time for a button to animate to Pressed. 59 | 60 | /// The pixel through which to cast rays, in viewport coordinates. Generally, the center 61 | /// pixel is best, assuming a monoscopic camera is selected as the `Canvas`' event camera. 62 | [HideInInspector] 63 | public Vector2 hotspot = new Vector2(0.5f, 0.5f); 64 | 65 | private PointerEventData pointerData; 66 | 67 | public override bool ShouldActivateModule() { 68 | if (!base.ShouldActivateModule()) { 69 | return false; 70 | } 71 | return Cardboard.SDK.VRModeEnabled || !vrModeOnly; 72 | } 73 | 74 | public override void DeactivateModule() { 75 | base.DeactivateModule(); 76 | if (pointerData != null) { 77 | HandlePendingClick(); 78 | HandlePointerExitAndEnter(pointerData, null); 79 | pointerData = null; 80 | } 81 | eventSystem.SetSelectedGameObject(null, GetBaseEventData()); 82 | if (cursor != null) { 83 | cursor.SetActive(false); 84 | } 85 | } 86 | 87 | public override bool IsPointerOverGameObject(int pointerId) { 88 | return pointerData != null && pointerData.pointerEnter != null; 89 | } 90 | 91 | public override void Process() { 92 | CastRayFromGaze(); 93 | UpdateCurrentObject(); 94 | PlaceCursor(); 95 | HandlePendingClick(); 96 | HandleTrigger(); 97 | } 98 | 99 | private void CastRayFromGaze() { 100 | if (pointerData == null) { 101 | pointerData = new PointerEventData(eventSystem); 102 | } 103 | pointerData.Reset(); 104 | pointerData.position = new Vector2(hotspot.x * Screen.width, hotspot.y * Screen.height); 105 | eventSystem.RaycastAll(pointerData, m_RaycastResultCache); 106 | pointerData.pointerCurrentRaycast = FindFirstRaycast(m_RaycastResultCache); 107 | m_RaycastResultCache.Clear(); 108 | } 109 | 110 | private void UpdateCurrentObject() { 111 | // Send enter events and update the highlight. 112 | var go = pointerData.pointerCurrentRaycast.gameObject; 113 | HandlePointerExitAndEnter(pointerData, go); 114 | // Update the current selection, or clear if it is no longer the current object. 115 | var selected = ExecuteEvents.GetEventHandler(go); 116 | if (selected == eventSystem.currentSelectedGameObject) { 117 | ExecuteEvents.Execute(eventSystem.currentSelectedGameObject, GetBaseEventData(), 118 | ExecuteEvents.updateSelectedHandler); 119 | } 120 | else { 121 | eventSystem.SetSelectedGameObject(null, pointerData); 122 | } 123 | } 124 | 125 | private void PlaceCursor() { 126 | if (cursor == null) 127 | return; 128 | var go = pointerData.pointerCurrentRaycast.gameObject; 129 | cursor.SetActive(go != null); 130 | if (cursor.activeInHierarchy) { 131 | Camera cam = pointerData.enterEventCamera; 132 | // Note: rays through screen start at near clipping plane. 133 | float dist = pointerData.pointerCurrentRaycast.distance + cam.nearClipPlane; 134 | cursor.transform.position = cam.transform.position + cam.transform.forward * dist; 135 | } 136 | } 137 | 138 | private void HandlePendingClick() { 139 | if (!pointerData.eligibleForClick) { 140 | return; 141 | } 142 | bool triggerStillDown = !Cardboard.SDK.Triggered 143 | && Time.unscaledTime - pointerData.clickTime < clickTime; 144 | if (!Cardboard.SDK.TapIsTrigger) { 145 | // Screen touch also counts, as long as it didn't start on this frame. 146 | triggerStillDown |= !Input.GetMouseButtonDown(0) && Input.GetMouseButton(0); 147 | } 148 | if (triggerStillDown) { 149 | return; 150 | } 151 | 152 | // Send pointer up and click events. 153 | ExecuteEvents.Execute(pointerData.pointerPress, pointerData, ExecuteEvents.pointerUpHandler); 154 | ExecuteEvents.Execute(pointerData.pointerPress, pointerData, ExecuteEvents.pointerClickHandler); 155 | 156 | // Clear the click state. 157 | pointerData.pointerPress = null; 158 | pointerData.rawPointerPress = null; 159 | pointerData.eligibleForClick = false; 160 | pointerData.clickCount = 0; 161 | } 162 | 163 | private void HandleTrigger() { 164 | bool triggered = Cardboard.SDK.Triggered 165 | || !Cardboard.SDK.TapIsTrigger && Input.GetMouseButtonDown(0); 166 | if (!triggered) { 167 | return; 168 | } 169 | var go = pointerData.pointerCurrentRaycast.gameObject; 170 | 171 | // Send pointer down event. 172 | pointerData.pressPosition = pointerData.position; 173 | pointerData.pointerPressRaycast = pointerData.pointerCurrentRaycast; 174 | pointerData.pointerPress = 175 | ExecuteEvents.ExecuteHierarchy(go, pointerData, ExecuteEvents.pointerDownHandler) 176 | ?? ExecuteEvents.GetEventHandler(go); 177 | 178 | // Save the pending click state. 179 | pointerData.rawPointerPress = go; 180 | pointerData.eligibleForClick = true; 181 | pointerData.clickCount = 1; 182 | pointerData.clickTime = Time.unscaledTime; 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/GazeInputModule.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1bb4e1b2a0a04d2ea3b96ff7e05685c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/Pose3D.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | using UnityEngine; 15 | 16 | /// @ingroup Scripts 17 | /// Encapsulates a rotation and a translation. This is a convenience class that allows 18 | /// construction and value access either by Matrix4x4 or Quaternion+Vector3 types. 19 | public class Pose3D { 20 | /// Right-handed to left-handed matrix converter (and vice versa). 21 | protected static readonly Matrix4x4 flipZ = Matrix4x4.Scale(new Vector3(1, 1, -1)); 22 | 23 | /// The translation component of the pose. 24 | public Vector3 Position { get; protected set; } 25 | 26 | /// The rotation component of the pose. 27 | public Quaternion Orientation { get; protected set; } 28 | 29 | /// The pose as a matrix in Unity gameobject convention (left-handed). 30 | public Matrix4x4 Matrix { get; protected set; } 31 | 32 | /// The pose as a matrix in right-handed coordinates. 33 | public Matrix4x4 RightHandedMatrix { 34 | get { 35 | return flipZ * Matrix * flipZ; 36 | } 37 | } 38 | 39 | public Pose3D() { 40 | Position = Vector3.zero; 41 | Orientation = Quaternion.identity; 42 | Matrix = Matrix4x4.identity; 43 | } 44 | 45 | public Pose3D(Vector3 position, Quaternion orientation) { 46 | Set(position, orientation); 47 | } 48 | 49 | public Pose3D(Matrix4x4 matrix) { 50 | Set(matrix); 51 | } 52 | 53 | protected void Set(Vector3 position, Quaternion orientation) { 54 | Position = position; 55 | Orientation = orientation; 56 | Matrix = Matrix4x4.TRS(position, orientation, Vector3.one); 57 | } 58 | 59 | protected void Set(Matrix4x4 matrix) { 60 | Matrix = matrix; 61 | Position = matrix.GetColumn(3); 62 | Orientation = Quaternion.LookRotation(matrix.GetColumn(2), matrix.GetColumn(1)); 63 | } 64 | } 65 | 66 | /// Mutable version of Pose3D. 67 | public class MutablePose3D : Pose3D { 68 | public new void Set(Vector3 position, Quaternion orientation) { 69 | base.Set(position, orientation); 70 | } 71 | 72 | public new void Set(Matrix4x4 matrix) { 73 | base.Set(matrix); 74 | } 75 | 76 | public void SetRightHanded(Matrix4x4 matrix) { 77 | Set(flipZ * matrix * flipZ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/Pose3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6dc4d56dabb6444a8fda878f2e8acc1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/RadialUndistortionEffect.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | using UnityEngine; 16 | using System.Collections; 17 | 18 | /// @ingroup Scripts 19 | /// Applies the inverse of the lens distortion to the image. The image is "undistorted" so 20 | /// that when viewed through the lenses (which redistort), the image looks normal. In the case 21 | /// of Cardboard, the lenses apply a pincushion distortion, so this effect applies a barrel 22 | /// distortion to counteract that. 23 | /// 24 | /// It is used to show the effect of distortion correction when playing the 25 | /// scene in the Editor, and as the fall back when the native code distortion 26 | /// is not available or disabled. 27 | [RequireComponent(typeof(Camera))] 28 | public class RadialUndistortionEffect : MonoBehaviour { 29 | 30 | #if UNITY_EDITOR 31 | private StereoController controller; 32 | #endif 33 | private Material material; 34 | 35 | void Awake() { 36 | if (!SystemInfo.supportsRenderTextures) { 37 | Debug.Log("Radial Undistortion disabled: render textures not supported."); 38 | return; 39 | } 40 | Shader shader = Shader.Find("Cardboard/Radial Undistortion"); 41 | if (shader == null) { 42 | Debug.Log("Radial Undistortion disabled: shader not found."); 43 | return; 44 | } 45 | material = new Material(shader); 46 | } 47 | 48 | #if UNITY_EDITOR 49 | void Start() { 50 | var eye = GetComponent(); 51 | if (eye != null) { 52 | controller = eye.Controller; 53 | } 54 | } 55 | #endif 56 | 57 | void OnRenderImage(RenderTexture source, RenderTexture dest) { 58 | // Check if we found our shader, and that native distortion correction is OFF (except maybe in 59 | // the editor, since native is not available here). 60 | bool disabled = material == null || !Cardboard.SDK.UseDistortionEffect; 61 | #if UNITY_EDITOR 62 | bool mainCamera = controller != null && controller.GetComponent().tag == "MainCamera"; 63 | disabled |= !mainCamera; 64 | #endif 65 | if (disabled) { 66 | // Pass through, no effect. 67 | Graphics.Blit(source, dest); 68 | } else { 69 | // Undistort the image. 70 | Graphics.Blit(source, dest, material); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/RadialUndistortionEffect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5888e93dcbacc470d9a54e48cddb00d2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/StereoController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6788e8e1b3f7447db6657ef0959d3ce 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fc5956d227e846e19090513e884a2b2 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/BaseAndroidDevice.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #if UNITY_ANDROID 15 | 16 | using UnityEngine; 17 | using System.Collections.Generic; 18 | 19 | public abstract class BaseAndroidDevice : BaseVRDevice { 20 | protected AndroidJavaObject androidActivity; 21 | 22 | public override bool SupportsNativeDistortionCorrection(List diagnostics) { 23 | bool support = base.SupportsNativeDistortionCorrection(diagnostics); 24 | if (androidActivity == null) { 25 | diagnostics.Add("Cannot access Activity"); 26 | } 27 | return support; 28 | } 29 | 30 | public override void Destroy() { 31 | if (androidActivity != null) { 32 | androidActivity.Dispose(); 33 | androidActivity = null; 34 | } 35 | base.Destroy(); 36 | } 37 | 38 | protected virtual void ConnectToActivity() { 39 | try { 40 | using (AndroidJavaClass player = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) { 41 | androidActivity = player.GetStatic("currentActivity"); 42 | } 43 | } catch (AndroidJavaException e) { 44 | androidActivity = null; 45 | Debug.LogError("Exception while connecting to the Activity: " + e); 46 | } 47 | } 48 | 49 | protected AndroidJavaObject Create(string className, params object[] args) { 50 | try { 51 | return new AndroidJavaObject(className, args); 52 | } catch (AndroidJavaException e) { 53 | Debug.LogError("Exception creating object " + className + ": " + e); 54 | return null; 55 | } 56 | } 57 | 58 | protected static bool CallObjectMethod(AndroidJavaObject jo, string name, params object[] args) { 59 | if (jo == null) { 60 | Debug.LogError("Object is null when calling method " + name); 61 | return false; 62 | } 63 | try { 64 | jo.Call(name, args); 65 | return true; 66 | } catch (AndroidJavaException e) { 67 | Debug.LogError("Exception calling method " + name + ": " + e); 68 | return false; 69 | } 70 | } 71 | 72 | protected static bool CallObjectMethod(ref T result, AndroidJavaObject jo, string name, 73 | params object[] args) { 74 | if (jo == null) { 75 | Debug.LogError("Object is null when calling method " + name); 76 | return false; 77 | } 78 | try { 79 | result = jo.Call(name, args); 80 | return true; 81 | } catch (AndroidJavaException e) { 82 | Debug.LogError("Exception calling method " + name + ": " + e); 83 | return false; 84 | } 85 | } 86 | } 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/BaseAndroidDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b19e0579f891c45dc9c0d95559907f46 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/BaseCardboardDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f9c4177b68054245a3e636a43bd364b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/BaseVRDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 793ce984b7b0b468c98791a4649eaa03 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/CardboardAndroidDevice.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #if UNITY_ANDROID 15 | 16 | using UnityEngine; 17 | 18 | public class CardboardAndroidDevice : BaseCardboardDevice { 19 | private static AndroidJavaObject activityListener; 20 | 21 | public override void Init() { 22 | base.Init(); 23 | ConnectToActivity(); 24 | } 25 | 26 | protected override void ConnectToActivity() { 27 | base.ConnectToActivity(); 28 | if (androidActivity != null && activityListener == null) { 29 | TextAsset button = Resources.Load("CardboardSettingsButton.png"); 30 | activityListener = Create("com.google.vr.platform.unity.UnityVrActivityListener", 31 | button.bytes); 32 | } 33 | } 34 | 35 | public override void SetVRModeEnabled(bool enabled) { 36 | CallObjectMethod(activityListener, "setVRModeEnabled", enabled); 37 | } 38 | 39 | public override void SetSettingsButtonEnabled(bool enabled) { 40 | CallObjectMethod(activityListener, "setSettingsButtonEnabled", enabled); 41 | } 42 | 43 | public override void SetTapIsTrigger(bool enabled) { 44 | CallObjectMethod(activityListener, "setTapIsTrigger", enabled); 45 | } 46 | 47 | public override void SetTouchCoordinates(int x, int y) { 48 | CallObjectMethod(activityListener, "setTouchCoordinates", x, y); 49 | } 50 | 51 | public override bool SetDefaultDeviceProfile(System.Uri uri) { 52 | bool result = false; 53 | CallObjectMethod(ref result, activityListener, "setDefaultDeviceProfile", uri.ToString()); 54 | return result; 55 | } 56 | 57 | public override void ShowSettingsDialog() { 58 | CallObjectMethod(activityListener, "launchConfigureActivity"); 59 | } 60 | 61 | protected override void ProcessEvents() { 62 | base.ProcessEvents(); 63 | if (!Cardboard.SDK.TapIsTrigger) { 64 | if (triggered) { 65 | CallObjectMethod(activityListener, "injectSingleTap"); 66 | } 67 | if (tilted) { 68 | CallObjectMethod(activityListener, "injectKeyPress", 111); // Escape key. 69 | } 70 | } 71 | } 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/CardboardAndroidDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41679d3338266415f88d226e6bf3d0be 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/CardboardiOSDevice.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #if UNITY_IOS 15 | 16 | using System.Runtime.InteropServices; 17 | using System.Collections.Generic; 18 | 19 | public class CardboardiOSDevice : BaseCardboardDevice { 20 | // Native code libraries use OpenGL, but Unity picks Metal for iOS by default. 21 | bool isOpenGL = false; 22 | 23 | public override bool SupportsNativeDistortionCorrection(List diagnostics) { 24 | bool support = base.SupportsNativeDistortionCorrection(diagnostics); 25 | if (!isOpenGL) { 26 | diagnostics.Add("Requires OpenGL"); 27 | support = false; 28 | } 29 | return support; 30 | } 31 | 32 | public override bool SupportsNativeUILayer(List diagnostics) { 33 | bool support = base.SupportsNativeUILayer(diagnostics); 34 | if (!isOpenGL) { 35 | diagnostics.Add("Requires OpenGL"); 36 | support = false; 37 | } 38 | return support; 39 | } 40 | 41 | public override void SetVRModeEnabled(bool enabled) { 42 | setVRModeEnabled(enabled); 43 | } 44 | 45 | public override void SetSettingsButtonEnabled(bool enabled) { 46 | setSettingsButtonEnabled(enabled); 47 | } 48 | 49 | public override void SetAutoDriftCorrectionEnabled(bool enabled){ 50 | // For iOS don't use Drift Correction. 51 | base.SetAutoDriftCorrectionEnabled(false); 52 | } 53 | 54 | public override void SetTapIsTrigger(bool enabled) { 55 | // Not supported on iOS. 56 | } 57 | 58 | public override bool SetDefaultDeviceProfile(System.Uri uri) { 59 | byte[] profile = System.Text.Encoding.UTF8.GetBytes(uri.ToString()); 60 | return setDefaultDeviceProfile(profile, profile.Length); 61 | } 62 | 63 | public override void Init() { 64 | isOpenGL = isOpenGLAPI(); 65 | setSyncWithCardboardEnabled(Cardboard.SDK.SyncWithCardboardApp); 66 | base.Init(); 67 | // For iOS don't use Drift Correction. 68 | SetAutoDriftCorrectionEnabled(false); 69 | } 70 | 71 | public override void PostRender(bool vrMode) { 72 | // Do not call GL.IssuePluginEvent() unless OpenGL is the graphics API. 73 | base.PostRender(vrMode && isOpenGL); 74 | } 75 | 76 | private bool debugOnboarding = false; 77 | 78 | public override void OnFocus(bool focus) { 79 | if (focus && (debugOnboarding || !isOnboardingDone())) { 80 | debugOnboarding = false; 81 | launchOnboardingDialog(); 82 | } 83 | } 84 | 85 | public override void OnPause(bool pause) { 86 | if (!pause) { 87 | readProfile(); 88 | } 89 | } 90 | 91 | public override void ShowSettingsDialog() { 92 | launchSettingsDialog(); 93 | } 94 | 95 | [DllImport("__Internal")] 96 | private static extern bool isOpenGLAPI(); 97 | 98 | [DllImport("__Internal")] 99 | private static extern void setVRModeEnabled(bool enabled); 100 | 101 | [DllImport("__Internal")] 102 | private static extern void setSettingsButtonEnabled(bool enabled); 103 | 104 | [DllImport("__Internal")] 105 | private static extern void setSyncWithCardboardEnabled(bool enabled); 106 | 107 | [DllImport("__Internal")] 108 | private static extern void readProfile(); 109 | 110 | [DllImport("__Internal")] 111 | private static extern bool setDefaultDeviceProfile(byte[] profileData, int size); 112 | 113 | [DllImport("__Internal")] 114 | private static extern bool isOnboardingDone(); 115 | 116 | [DllImport("__Internal")] 117 | private static extern void launchSettingsDialog(); 118 | 119 | [DllImport("__Internal")] 120 | private static extern void launchOnboardingDialog(); 121 | } 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/CardboardiOSDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60e9532687faa456e8e3e3feb4937307 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/UnityEditorDevice.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #if UNITY_EDITOR 15 | 16 | using UnityEngine; 17 | using System.Collections.Generic; 18 | 19 | // Sends simulated values for use when testing within the Unity Editor. 20 | public class UnityEditorDevice : BaseVRDevice { 21 | // Simulated neck model. 22 | private static readonly Vector3 neckOffset = new Vector3(0, 0.075f, -0.08f); 23 | 24 | // Use mouse to emulate head in the editor. 25 | private float mouseX = 0; 26 | private float mouseY = 0; 27 | private float mouseZ = 0; 28 | 29 | public override void Init() { 30 | Input.gyro.enabled = true; 31 | } 32 | 33 | public override bool SupportsNativeDistortionCorrection(List diagnostics) { 34 | return false; // No need for diagnostic message. 35 | } 36 | 37 | public override bool SupportsNativeUILayer(List diagnostics) { 38 | return false; // No need for diagnostic message. 39 | } 40 | 41 | public override RenderTexture CreateStereoScreen() { 42 | return null; // No need for it in the editor. 43 | } 44 | 45 | public override void SetDistortionCorrectionEnabled(bool enabled) {} 46 | public override void SetVRModeEnabled(bool enabled) {} 47 | public override void SetAlignmentMarkerEnabled(bool enabled) {} 48 | public override void SetSettingsButtonEnabled(bool enabled) {} 49 | public override void SetNeckModelScale(float scale) {} 50 | public override void SetAutoDriftCorrectionEnabled(bool enabled) {} 51 | public override void SetTapIsTrigger(bool enabled) {} 52 | public override void SetStereoScreen(RenderTexture stereoScreen) {} 53 | 54 | private Quaternion initialRotation = Quaternion.identity; 55 | 56 | private bool remoteCommunicating = false; 57 | private bool RemoteCommunicating { 58 | get { 59 | if (!remoteCommunicating) { 60 | #if UNITY5 61 | remoteCommunicating = EditorApplication.isRemoteConnected; 62 | #else 63 | remoteCommunicating = Vector3.Dot(Input.gyro.rotationRate, Input.gyro.rotationRate) > 0.05; 64 | #endif 65 | } 66 | return remoteCommunicating; 67 | } 68 | } 69 | 70 | public override void UpdateState() { 71 | Quaternion rot; 72 | if (Cardboard.SDK.UseUnityRemoteInput && RemoteCommunicating) { 73 | var att = Input.gyro.attitude * initialRotation; 74 | att = new Quaternion(att.x, att.y, -att.z, -att.w); 75 | rot = Quaternion.Euler(90, 0, 0) * att; 76 | } else { 77 | bool rolled = false; 78 | if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt)) { 79 | mouseX += Input.GetAxis("Mouse X") * 5; 80 | if (mouseX <= -180) { 81 | mouseX += 360; 82 | } else if (mouseX > 180) { 83 | mouseX -= 360; 84 | } 85 | mouseY -= Input.GetAxis("Mouse Y") * 2.4f; 86 | mouseY = Mathf.Clamp(mouseY, -85, 85); 87 | } else if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) { 88 | rolled = true; 89 | mouseZ += Input.GetAxis("Mouse X") * 5; 90 | mouseZ = Mathf.Clamp(mouseZ, -85, 85); 91 | } 92 | if (!rolled && Cardboard.SDK.autoUntiltHead) { 93 | // People don't usually leave their heads tilted to one side for long. 94 | mouseZ = Mathf.Lerp(mouseZ, 0, Time.deltaTime / (Time.deltaTime + 0.1f)); 95 | } 96 | rot = Quaternion.Euler(mouseY, mouseX, mouseZ); 97 | } 98 | var neck = (rot * neckOffset - neckOffset.y * Vector3.up) * Cardboard.SDK.NeckModelScale; 99 | headPose.Set(neck, rot); 100 | 101 | triggered = Input.GetMouseButtonUp(0); 102 | tilted = Input.GetKeyUp(KeyCode.Escape); 103 | } 104 | 105 | public override void PostRender(bool vrMode) { 106 | // Do nothing. 107 | } 108 | 109 | public override void UpdateScreenData() { 110 | Profile = CardboardProfile.GetKnownProfile(Cardboard.SDK.ScreenSize, Cardboard.SDK.DeviceType); 111 | ComputeEyesFromProfile(); 112 | } 113 | 114 | public override void Recenter() { 115 | mouseX = mouseZ = 0; // Do not reset pitch, which is how it works on the phone. 116 | if (RemoteCommunicating) { 117 | //initialRotation = Quaternion.Inverse(Input.gyro.attitude); 118 | } 119 | } 120 | } 121 | 122 | #endif 123 | -------------------------------------------------------------------------------- /Assets/Cardboard/Scripts/VRDevices/UnityEditorDevice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76756f042eedf44cdabdc071ded363bf 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1aa23387d9cba4107b5e3779f500ea4f 3 | folderAsset: yes 4 | timeCreated: 1427300454 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41e4f29e5dee9ec48a2538955ef1de71 3 | folderAsset: yes 4 | timeCreated: 1427300454 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | 5 | namespace UnityStandardAssets.CrossPlatformInput.Inspector 6 | { 7 | [InitializeOnLoad] 8 | public class CrossPlatformInitialize 9 | { 10 | // Custom compiler defines: 11 | // 12 | // CROSS_PLATFORM_INPUT : denotes that cross platform input package exists, so that other packages can use their CrossPlatformInput functions. 13 | // EDITOR_MOBILE_INPUT : denotes that mobile input should be used in editor, if a mobile build target is selected. (i.e. using Unity Remote app). 14 | // MOBILE_INPUT : denotes that mobile input should be used right now! 15 | 16 | static CrossPlatformInitialize() 17 | { 18 | var defines = GetDefinesList(buildTargetGroups[0]); 19 | if (!defines.Contains("CROSS_PLATFORM_INPUT")) 20 | { 21 | SetEnabled("CROSS_PLATFORM_INPUT", true, false); 22 | SetEnabled("MOBILE_INPUT", true, true); 23 | } 24 | } 25 | 26 | 27 | [MenuItem("Mobile Input/Enable")] 28 | private static void Enable() 29 | { 30 | SetEnabled("MOBILE_INPUT", true, true); 31 | switch (EditorUserBuildSettings.activeBuildTarget) 32 | { 33 | case BuildTarget.Android: 34 | case BuildTarget.iOS: 35 | case BuildTarget.WP8Player: 36 | case BuildTarget.BlackBerry: 37 | case BuildTarget.PSM: 38 | case BuildTarget.Tizen: 39 | case BuildTarget.WSAPlayer: 40 | EditorUtility.DisplayDialog("Mobile Input", 41 | "You have enabled Mobile Input. You'll need to use the Unity Remote app on a connected device to control your game in the Editor.", 42 | "OK"); 43 | break; 44 | 45 | default: 46 | EditorUtility.DisplayDialog("Mobile Input", 47 | "You have enabled Mobile Input, but you have a non-mobile build target selected in your build settings. The mobile control rigs won't be active or visible on-screen until you switch the build target to a mobile platform.", 48 | "OK"); 49 | break; 50 | } 51 | } 52 | 53 | 54 | [MenuItem("Mobile Input/Enable", true)] 55 | private static bool EnableValidate() 56 | { 57 | var defines = GetDefinesList(mobileBuildTargetGroups[0]); 58 | return !defines.Contains("MOBILE_INPUT"); 59 | } 60 | 61 | 62 | [MenuItem("Mobile Input/Disable")] 63 | private static void Disable() 64 | { 65 | SetEnabled("MOBILE_INPUT", false, true); 66 | switch (EditorUserBuildSettings.activeBuildTarget) 67 | { 68 | case BuildTarget.Android: 69 | case BuildTarget.iOS: 70 | case BuildTarget.WP8Player: 71 | case BuildTarget.BlackBerry: 72 | EditorUtility.DisplayDialog("Mobile Input", 73 | "You have disabled Mobile Input. Mobile control rigs won't be visible, and the Cross Platform Input functions will always return standalone controls.", 74 | "OK"); 75 | break; 76 | } 77 | } 78 | 79 | 80 | [MenuItem("Mobile Input/Disable", true)] 81 | private static bool DisableValidate() 82 | { 83 | var defines = GetDefinesList(mobileBuildTargetGroups[0]); 84 | return defines.Contains("MOBILE_INPUT"); 85 | } 86 | 87 | 88 | private static BuildTargetGroup[] buildTargetGroups = new BuildTargetGroup[] 89 | { 90 | BuildTargetGroup.Standalone, 91 | BuildTargetGroup.WebPlayer, 92 | BuildTargetGroup.Android, 93 | BuildTargetGroup.iOS, 94 | BuildTargetGroup.WP8, 95 | BuildTargetGroup.BlackBerry 96 | }; 97 | 98 | private static BuildTargetGroup[] mobileBuildTargetGroups = new BuildTargetGroup[] 99 | { 100 | BuildTargetGroup.Android, 101 | BuildTargetGroup.iOS, 102 | BuildTargetGroup.WP8, 103 | BuildTargetGroup.BlackBerry, 104 | BuildTargetGroup.PSM, 105 | BuildTargetGroup.Tizen, 106 | BuildTargetGroup.WSA 107 | }; 108 | 109 | 110 | private static void SetEnabled(string defineName, bool enable, bool mobile) 111 | { 112 | //Debug.Log("setting "+defineName+" to "+enable); 113 | foreach (var group in mobile ? mobileBuildTargetGroups : buildTargetGroups) 114 | { 115 | var defines = GetDefinesList(group); 116 | if (enable) 117 | { 118 | if (defines.Contains(defineName)) 119 | { 120 | return; 121 | } 122 | defines.Add(defineName); 123 | } 124 | else 125 | { 126 | if (!defines.Contains(defineName)) 127 | { 128 | return; 129 | } 130 | while (defines.Contains(defineName)) 131 | { 132 | defines.Remove(defineName); 133 | } 134 | } 135 | string definesString = string.Join(";", defines.ToArray()); 136 | PlayerSettings.SetScriptingDefineSymbolsForGroup(group, definesString); 137 | } 138 | } 139 | 140 | 141 | private static List GetDefinesList(BuildTargetGroup group) 142 | { 143 | return new List(PlayerSettings.GetScriptingDefineSymbolsForGroup(group).Split(';')); 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Assets/Editor/CrossPlatformInput/CrossPlatformInputInitialize.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db7667203062c644ea1877077e30ebd6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/InputDemo.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/InputDemo.unity -------------------------------------------------------------------------------- /Assets/InputDemo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afab9c459b3db49569c11208c05c2a2f 3 | timeCreated: 1427302451 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 074c5a944c308ad49b72fa6a5b155d1f 3 | folderAsset: yes 4 | timeCreated: 1427302020 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8ead1b0ebb867648ab4f4db855ec1e8 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/AndroidManifest.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 994f4c39b39b64b46bf40f48893781d0 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce5e36fafda2a4019a230192aaa8ee55 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/armeabi-v7a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9d1bf8d13f094943a2761f1c198f099 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/armeabi-v7a/libRenderingPlugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/Android/libs/armeabi-v7a/libRenderingPlugin.so -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/armeabi-v7a/libRenderingPlugin.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16208d31e31a145418f131f380c8e6d4 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/armeabi-v7a/libvrunity.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/Android/libs/armeabi-v7a/libvrunity.so -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/armeabi-v7a/libvrunity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73f056522c61242b587d3964f1681d94 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25db62f49bf2f400194beb1d205848d3 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/x86/libRenderingPlugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/Android/libs/x86/libRenderingPlugin.so -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/x86/libRenderingPlugin.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d27cb38b69c8d406ab5c7083e57db31c 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/x86/libvrunity.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/Android/libs/x86/libvrunity.so -------------------------------------------------------------------------------- /Assets/Plugins/Android/libs/x86/libvrunity.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d73a968b2894b4d748b3fb2b7dfa4154 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Android/unityvractivity.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/Android/unityvractivity.jar -------------------------------------------------------------------------------- /Assets/Plugins/Android/unityvractivity.jar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a236a8f81f1840af9189d32ac0a805f 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Legacy.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 474f21fa8443c4df0a044473cfde1f00 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 198722e8d4b8c4596b8576253d078b2c 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android/AndroidManifest.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d963a0cabd6142678a88296d6b89a11 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android/libprotobuf-java-2.6-nano.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/Legacy/Android/libprotobuf-java-2.6-nano.jar -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android/libprotobuf-java-2.6-nano.jar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42afc49dd430c43058390d7553dcaa79 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android/unitycardboardactivity.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/Legacy/Android/unitycardboardactivity.jar -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android/unitycardboardactivity.jar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a7196343a0c141968ee5ae19d5cdb38 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android/vrtoolkit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/Legacy/Android/vrtoolkit.jar -------------------------------------------------------------------------------- /Assets/Plugins/Legacy/Android/vrtoolkit.jar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd4cf01643b78458084a2eda490a63fc 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8675f027fb4cbbe4caf3660bd58484f9 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/CardboardAppController.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "UnityAppController.h" 16 | #import "UnityAppController+Rendering.h" 17 | #import "UnityAppController+ViewHandling.h" 18 | 19 | // Unity 4.6.2 added a category to the app controller. 20 | #if UNITY_VERSION < 462 21 | #import "UnityInterface.h" 22 | #else 23 | #import "UnityAppController+UnityInterface.h" 24 | #endif 25 | 26 | // Unity 4 used a different method name to create the UnityView. 27 | #if UNITY_VERSION < 500 28 | #define createUnityView initUnityViewImpl 29 | #endif 30 | 31 | @interface CardboardAppController : UnityAppController 32 | 33 | - (void)preStartUnity; 34 | 35 | - (UnityView *)createUnityView; 36 | 37 | - (void)launchSettingsDialog; 38 | 39 | - (void)startSettingsDialog:(UIViewController *)dialog; 40 | 41 | - (void)stopSettingsDialog; 42 | 43 | - (void)pause:(bool)paused; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/CardboardAppController.h.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 489f574cca6e1423a9872c6f0e97a819 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/CardboardAppController.mm: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "CardboardAppController.h" 16 | 17 | extern "C" { 18 | 19 | extern void readProfile(); 20 | extern void syncProfile(); 21 | 22 | extern void createSettingsButton(id app, UIView* view); 23 | extern UIViewController* createSettingsDialog(id app); 24 | extern UIViewController* createOnboardingDialog(id app); 25 | 26 | bool isOpenGLAPI() { 27 | #if UNITY_VERSION < 463 28 | return true; 29 | #else 30 | CardboardAppController* app = (CardboardAppController *)GetAppController(); 31 | UnityRenderingAPI api = [app renderingAPI]; 32 | return api == apiOpenGLES2 || api == apiOpenGLES3; 33 | #endif 34 | } 35 | 36 | void launchSettingsDialog() { 37 | CardboardAppController* app = (CardboardAppController *)GetAppController(); 38 | [app launchSettingsDialog]; 39 | } 40 | 41 | void launchOnboardingDialog() { 42 | CardboardAppController* app = (CardboardAppController *)GetAppController(); 43 | [app startSettingsDialog:createOnboardingDialog(app)]; 44 | } 45 | 46 | void endSettingsDialog() { 47 | CardboardAppController* app = (CardboardAppController *)GetAppController(); 48 | [app stopSettingsDialog]; 49 | } 50 | 51 | } // extern "C" 52 | 53 | @implementation CardboardAppController 54 | 55 | - (void)preStartUnity { 56 | [super preStartUnity]; 57 | syncProfile(); 58 | } 59 | 60 | - (UnityView *)createUnityView { 61 | UnityView* unity_view = [super createUnityView]; 62 | createSettingsButton(self, (UIView *)unity_view); 63 | return unity_view; 64 | } 65 | 66 | - (void)launchSettingsDialog { 67 | [self startSettingsDialog:createSettingsDialog(self)]; 68 | } 69 | 70 | - (void)startSettingsDialog:(UIViewController*)dialog { 71 | [self pause:YES]; 72 | [self.rootViewController presentViewController:dialog animated:NO completion:nil]; 73 | } 74 | 75 | - (void)stopSettingsDialog { 76 | [[self rootViewController] dismissViewControllerAnimated:NO completion:nil]; 77 | [self pause:NO]; 78 | } 79 | 80 | - (void)pause:(bool)paused { 81 | #if UNITY_VERSION < 462 82 | UnityPause(paused); 83 | #else 84 | self.paused = paused; 85 | #endif 86 | } 87 | 88 | @end 89 | 90 | IMPL_APP_CONTROLLER_SUBCLASS(CardboardAppController) 91 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/CardboardAppController.mm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83b212583c1ff4cc9bb170aaa7d262e4 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | * Localizable.strings 3 | * 4 | * Guidelines: 5 | * 6 | * 1/ Write keys as CamelCase. In the code, this will be prefixed with kStr: kStrThisIsAKey. 7 | * 8 | * 2/ For descriptions, use 100-column limit and align multiple lines on the first character. 9 | * For strings, do not break lines. 10 | * 11 | * 3/ Write a meaningful description, so the translator can know what exactly you are talking about. 12 | * 13 | * 4/ Without context, a single word is hard to translate. For instance, the word "search" can be a 14 | * noun or a verb and they have different translations in other languages. Add the grammar 15 | * class, the verb tense or any other information to distinguish between homonyms. 16 | * 17 | * 5/ Supply the maximum number of characters for strings in the comment. For example: 18 | * /# Button label which starts warp (i.e. faster than light travel) mode. (30 chars) #/ 19 | * "WarpModeButtonLabel" = "Warp Speed"; 20 | * 21 | * 6/ For accessibility items, include "ACCESSIBILITY" in the key and comments. Generally 22 | * accessibility strings do not have a limit, because they are spoken. Indicate this with (no 23 | * limit). 24 | */ 25 | 26 | // ==================================== 27 | // Strings on QR code scanning screen 28 | // ==================================== 29 | 30 | /* 31 | * TODO(bwuest): All of these string lengths, descriptions, and content should be reviewed 32 | * in a seperate CL. 33 | */ 34 | 35 | /* Back button label used to go back to the previous screen. (15 chars) */ 36 | "BackButtonLabel" = "Back"; 37 | /* Label of the app title bar when on the QR code scanner screen. (45 chars) */ 38 | "NavTitleLabel" = "QR Scan"; 39 | /* Message shown to the user while waiting to process the QR code. (60 chars) */ 40 | "LoadingMessag" = "Parsing configuration data"; 41 | /* Error message shown to the user if the QR code is invalid. (60 chars) */ 42 | "InvalidQRCode" = "The QR code is invalid"; 43 | /* Error message shown to the user if the QR code is not a valid device profile. (60 chars) */ 44 | "ParsingFailed" = "Problem in parsing the Url"; 45 | /* Format string used as a temporary message shown after a successful device profile is set. 46 | * (60 chars) */ 47 | "DataSynced" = "%1$@ detected"; 48 | /* Label shown next to example QR code. (40 chars) */ 49 | "FindSymbolOnViewer" = "Find this symbol on your viewer"; 50 | /* Label shown next to skip button that allows the user to skip the QR code step. (40 chars) */ 51 | "CanNotFindSymbol" = "Can't find this symbol?"; 52 | /* Button label for the control that allows the user to skip the QR code step. (40 chars) */ 53 | "SkipButtonLabel" = "SKIP"; 54 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/Localizable.strings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 323015d02618b4ce091e807e91b8fd9c 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/libvrunity.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/libvrunity.a -------------------------------------------------------------------------------- /Assets/Plugins/iOS/libvrunity.a.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f5a2fc8f12e143deb90d3cc1bc3b76d 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9c7210640783466e854cb8a55704963 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | PluginImporter: 7 | serializedVersion: 1 8 | iconMap: {} 9 | executionOrder: {} 10 | isPreloaded: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | userData: 16 | assetBundleName: 17 | assetBundleVariant: 18 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43a4b9bc16b9d40bbb4bbfe6cc165093 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/objects-8.0+.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/objects-8.0+.nib -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/objects-8.0+.nib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a528fe27e1b594930b4d8a6f2538ef97 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/objects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/objects.nib -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/objects.nib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a6f83edbeda74a05a1ec8d4ebd4456c 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/runtime.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/runtime.nib -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~ipad.nib/runtime.nib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 749f7d5084b774f4db50298262c2ee28 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c55f36b33e244d1783c4fc16e1260df 3 | folderAsset: yes 4 | timeCreated: 1440870764 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/objects-8.0+.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/objects-8.0+.nib -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/objects-8.0+.nib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32ae9c0dfd7c54113a44d8b781de82f5 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/objects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/objects.nib -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/objects.nib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53b3024d5a6a24b6c917f1654b78157f 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/runtime.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/runtime.nib -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/SyncConfigViewController~iphone.nib/runtime.nib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba66067deee264c7f89df5810be74ee4 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/cardboardLogotype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/cardboardLogotype.png -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/cardboardLogotype.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a92ae5e56b9141bd9a308a1d9edc049 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/continueButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/continueButton.png -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/continueButton.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe142173e8542447092e698f0dbb4536 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/gearButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/gearButton.png -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/gearButton.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eea7cafbfad9b42f686843e242bddf0d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/onboardingBackground.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/onboardingBackground.jpg -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/onboardingBackground.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e9a9a7e2d22e4cd39a135d5c3f04887 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/qrSample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/qrSample.png -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/qrSample.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4305dc81300ec4ed5b33618cdc2855bb 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/rotateInstructions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/rotateInstructions.png -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/rotateInstructions.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78d05d2766e1f47d7bf058b183097473 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/tickmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Plugins/iOS/resources.bundle/tickmarks.png -------------------------------------------------------------------------------- /Assets/Plugins/iOS/resources.bundle/tickmarks.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05cb64f431d8d4d4586e43cb604eab7c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0a82975401a84f6ba6f462f306f2388 3 | folderAsset: yes 4 | timeCreated: 1427309913 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prefabs/VRController.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Prefabs/VRController.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/VRController.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bf2530e5b9ee4199ae78575993522a9 3 | timeCreated: 1440878093 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/star.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Prefabs/star.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/star.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36157b71c3a5e4c59881ec5863d448fc 3 | timeCreated: 1427309920 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b10e763717d24836ad11908a505bf21 3 | folderAsset: yes 4 | timeCreated: 1427302808 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/FaceObject.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class FaceObject: MonoBehaviour { 5 | public Transform targetObj; 6 | //set this to true if you need to orient in the opposite dir. 7 | public bool flipY = true; 8 | 9 | 10 | // Use this for initialization 11 | void Start () { 12 | if (targetObj == null) { 13 | GameObject player = GameObject.FindGameObjectWithTag ("Player"); 14 | if (player != null) { 15 | targetObj = player.transform; 16 | } 17 | } 18 | } 19 | 20 | // Update is called once per frame 21 | void Update () { 22 | if (flipY) { 23 | transform.rotation = Quaternion.LookRotation (transform.position - targetObj.transform.position); 24 | } else { 25 | transform.LookAt (targetObj); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Assets/Scripts/FaceObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0aeeca0fc99e42e591b4f5634ad96ff 3 | timeCreated: 1427309246 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/Scripts/PickUp.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class PickUp : MonoBehaviour { 5 | 6 | void OnCollisionEnter(Collision other) { 7 | if (other.collider.tag.Equals("Player")){ 8 | Destroy(gameObject); 9 | } 10 | } 11 | 12 | // Use this for initialization 13 | void Start () { 14 | 15 | } 16 | 17 | // Update is called once per frame 18 | void Update () { 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Scripts/PickUp.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 784652d416a11497aae640b8b24eef0a 3 | timeCreated: 1427309566 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/Scripts/VRMoveController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | [RequireComponent(typeof(Rigidbody))] 5 | [RequireComponent(typeof(CapsuleCollider))] 6 | public class VRMoveController : MonoBehaviour 7 | { 8 | public Camera cam; 9 | public float groundCheckDistance = 0.01f; // distance for checking if the controller is grounded ( 0.01f seems to work best for this ) 10 | public float stickToGroundHelperDistance = 0.5f; // stops the character 11 | public float slowDownRate = 20f; // rate at which the controller comes to a stop when there is no input 12 | private Rigidbody m_RigidBody; 13 | private CapsuleCollider m_Capsule; 14 | private float m_YRotation; 15 | private Vector3 groundContactNormal; 16 | public float CurrentTargetSpeed = 0f; 17 | 18 | public Vector3 Velocity { 19 | get { return m_RigidBody.velocity; } 20 | } 21 | 22 | private void Start () 23 | { 24 | m_RigidBody = GetComponent (); 25 | m_Capsule = GetComponent (); 26 | } 27 | 28 | private void FixedUpdate () 29 | { 30 | Vector2 input = GetInput (); 31 | GroundCheck(); 32 | if ((Mathf.Abs (input.x) > float.Epsilon || Mathf.Abs (input.y) > float.Epsilon)) { 33 | //Debug.Log("got input "+input); 34 | // always move along the camera forward as it is the direction that it being aimed at 35 | Vector3 desiredMove = cam.transform.forward * input.y + cam.transform.right * input.x; 36 | desiredMove = Vector3.ProjectOnPlane (desiredMove, groundContactNormal).normalized; 37 | 38 | desiredMove.x = desiredMove.x * CurrentTargetSpeed; 39 | desiredMove.z = desiredMove.z * CurrentTargetSpeed; 40 | desiredMove.y = desiredMove.y * CurrentTargetSpeed; 41 | if (m_RigidBody.velocity.sqrMagnitude < 42 | (CurrentTargetSpeed * CurrentTargetSpeed)) { 43 | m_RigidBody.AddForce (desiredMove, ForceMode.Impulse); 44 | } 45 | StickToGroundHelper (); 46 | } 47 | } 48 | 49 | private void StickToGroundHelper () 50 | { 51 | RaycastHit hitInfo; 52 | if (Physics.SphereCast (transform.position, m_Capsule.radius, Vector3.down, out hitInfo, 53 | ((m_Capsule.height / 2f) - m_Capsule.radius) + 54 | stickToGroundHelperDistance)) { 55 | if (Mathf.Abs (Vector3.Angle (hitInfo.normal, Vector3.up)) < 85f) { 56 | m_RigidBody.velocity = Vector3.ProjectOnPlane (m_RigidBody.velocity, hitInfo.normal); 57 | } 58 | } 59 | } 60 | /// sphere cast down just beyond the bottom of the capsule to see if the capsule is colliding round the bottom 61 | private void GroundCheck() 62 | { 63 | RaycastHit hitInfo; 64 | if (Physics.SphereCast(transform.position, m_Capsule.radius, Vector3.down, out hitInfo, 65 | ((m_Capsule.height/2f) - m_Capsule.radius) + groundCheckDistance)) 66 | { 67 | groundContactNormal = hitInfo.normal; 68 | } 69 | else 70 | { 71 | groundContactNormal = Vector3.up; 72 | } 73 | } 74 | 75 | private Vector2 GetInput () 76 | { 77 | float x,y; 78 | if (Input.GetMouseButton(0)){ 79 | x=0; 80 | y = 1; 81 | } else { 82 | x = Input.GetAxis("Horizontal"); 83 | y = Input.GetAxis("Vertical"); 84 | } 85 | Vector2 input = new Vector2(x,y); 86 | return input; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Assets/Scripts/VRMoveController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48881262e89854a77850777d98739ee9 3 | timeCreated: 1427302838 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/Standard Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4a6d663739ac409fba9015cf60f112b 3 | folderAsset: yes 4 | timeCreated: 1427299881 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 153c77e0022ff3148beba89b18de3476 3 | folderAsset: yes 4 | timeCreated: 1427299881 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11fa60a4f5bdba144a008a674f32eb19 3 | folderAsset: yes 4 | timeCreated: 1427299881 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/NavyGrid.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Materials/NavyGrid.mat -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/NavyGrid.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76ff537c8e1a84345868e6aeee938ab3 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/NavySmooth.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 4 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: NavySmooth 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _UVSEC_UV1 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: 86e4aa9207c9e2740b6ace599d659c05, type: 3} 21 | m_Scale: {x: 4, y: 4} 22 | m_Offset: {x: 0, y: 0} 23 | data: 24 | first: 25 | name: _BumpMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | data: 31 | first: 32 | name: _DetailNormalMap 33 | second: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | data: 38 | first: 39 | name: _EmissionMap 40 | second: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | data: 45 | first: 46 | name: _ParallaxMap 47 | second: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | data: 52 | first: 53 | name: _SpecGlossMap 54 | second: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | data: 59 | first: 60 | name: _DetailMask 61 | second: 62 | m_Texture: {fileID: 0} 63 | m_Scale: {x: 1, y: 1} 64 | m_Offset: {x: 0, y: 0} 65 | data: 66 | first: 67 | name: _DetailAlbedoMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | data: 73 | first: 74 | name: _Occlusion 75 | second: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | data: 80 | first: 81 | name: _OcclusionMap 82 | second: 83 | m_Texture: {fileID: 0} 84 | m_Scale: {x: 1, y: 1} 85 | m_Offset: {x: 0, y: 0} 86 | data: 87 | first: 88 | name: _MetallicGlossMap 89 | second: 90 | m_Texture: {fileID: 0} 91 | m_Scale: {x: 1, y: 1} 92 | m_Offset: {x: 0, y: 0} 93 | m_Floats: 94 | data: 95 | first: 96 | name: _AlphaTestRef 97 | second: .5 98 | data: 99 | first: 100 | name: _Lightmapping 101 | second: 1 102 | data: 103 | first: 104 | name: _SrcBlend 105 | second: 1 106 | data: 107 | first: 108 | name: _DstBlend 109 | second: 0 110 | data: 111 | first: 112 | name: _Parallax 113 | second: .0199999996 114 | data: 115 | first: 116 | name: _ZWrite 117 | second: 1 118 | data: 119 | first: 120 | name: _Glossiness 121 | second: .100000001 122 | data: 123 | first: 124 | name: _BumpScale 125 | second: 1 126 | data: 127 | first: 128 | name: _OcclusionStrength 129 | second: 1 130 | data: 131 | first: 132 | name: _DetailNormalMapScale 133 | second: 1 134 | data: 135 | first: 136 | name: _UVSec 137 | second: 0 138 | data: 139 | first: 140 | name: _Mode 141 | second: 0 142 | data: 143 | first: 144 | name: _EmissionScaleUI 145 | second: 0 146 | data: 147 | first: 148 | name: _Metallic 149 | second: .100000001 150 | m_Colors: 151 | data: 152 | first: 153 | name: _EmissionColor 154 | second: {r: 0, g: 0, b: 0, a: 0} 155 | data: 156 | first: 157 | name: _Color 158 | second: {r: 1, g: 1, b: 1, a: 1} 159 | data: 160 | first: 161 | name: _SpecularColor 162 | second: {r: .156862751, g: .156862751, b: .156862751, a: 1} 163 | data: 164 | first: 165 | name: _EmissionColorUI 166 | second: {r: 0, g: 0, b: 0, a: 1} 167 | data: 168 | first: 169 | name: _EmissionColorWithMapUI 170 | second: {r: 1, g: 1, b: 1, a: 1} 171 | data: 172 | first: 173 | name: _SpecColor 174 | second: {r: .117647059, g: .117647059, b: .117647059, a: 1} 175 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/NavySmooth.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1032d41f900276c40a9dd24f55b7d420 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/PinkGrid.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Materials/PinkGrid.mat -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/PinkGrid.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c19a618a0bd9844583b91dca0875a34 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/PinkSmooth.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 4 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: PinkSmooth 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: 580615edf5e29d245af58fc5fe2b06ac, type: 3} 22 | m_Scale: {x: 4, y: 4} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _BumpMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | data: 32 | first: 33 | name: _DetailNormalMap 34 | second: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | data: 39 | first: 40 | name: _EmissionMap 41 | second: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | data: 46 | first: 47 | name: _ParallaxMap 48 | second: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | data: 53 | first: 54 | name: _SpecGlossMap 55 | second: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | data: 60 | first: 61 | name: _DetailMask 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | data: 67 | first: 68 | name: _DetailAlbedoMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | data: 74 | first: 75 | name: _Occlusion 76 | second: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | data: 81 | first: 82 | name: _OcclusionMap 83 | second: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | data: 88 | first: 89 | name: _MetallicGlossMap 90 | second: 91 | m_Texture: {fileID: 0} 92 | m_Scale: {x: 1, y: 1} 93 | m_Offset: {x: 0, y: 0} 94 | m_Floats: 95 | data: 96 | first: 97 | name: _AlphaTestRef 98 | second: .5 99 | data: 100 | first: 101 | name: _Lightmapping 102 | second: 1 103 | data: 104 | first: 105 | name: _SrcBlend 106 | second: 1 107 | data: 108 | first: 109 | name: _DstBlend 110 | second: 0 111 | data: 112 | first: 113 | name: _Parallax 114 | second: .0199999996 115 | data: 116 | first: 117 | name: _ZWrite 118 | second: 1 119 | data: 120 | first: 121 | name: _Glossiness 122 | second: .100000001 123 | data: 124 | first: 125 | name: _BumpScale 126 | second: 1 127 | data: 128 | first: 129 | name: _OcclusionStrength 130 | second: 1 131 | data: 132 | first: 133 | name: _DetailNormalMapScale 134 | second: 1 135 | data: 136 | first: 137 | name: _UVSec 138 | second: 0 139 | data: 140 | first: 141 | name: _Mode 142 | second: 0 143 | data: 144 | first: 145 | name: _EmissionScaleUI 146 | second: 2 147 | data: 148 | first: 149 | name: _Metallic 150 | second: .100000001 151 | m_Colors: 152 | data: 153 | first: 154 | name: _EmissionColor 155 | second: {r: 0, g: 0, b: 0, a: 1.33483374} 156 | data: 157 | first: 158 | name: _Color 159 | second: {r: 1, g: 1, b: 1, a: 1} 160 | data: 161 | first: 162 | name: _SpecularColor 163 | second: {r: .156862751, g: .156862751, b: .156862751, a: 1} 164 | data: 165 | first: 166 | name: _EmissionColorUI 167 | second: {r: 0, g: 0, b: 0, a: 1} 168 | data: 169 | first: 170 | name: _EmissionColorWithMapUI 171 | second: {r: 1, g: 1, b: 1, a: 1} 172 | data: 173 | first: 174 | name: _SpecColor 175 | second: {r: .117647059, g: .117647059, b: .117647059, a: 1} 176 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/PinkSmooth.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fed4e78bda2b3de45954637fee164b8c 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/YellowGrid.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 4 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: YellowGrid 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: b4646ae63b0bcca40b1bdde3b87e01bf, type: 3} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _BumpMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | data: 32 | first: 33 | name: _DetailNormalMap 34 | second: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | data: 39 | first: 40 | name: _EmissionMap 41 | second: 42 | m_Texture: {fileID: 2800000, guid: a196fd6788131ec459bfb26012466fc1, type: 3} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | data: 46 | first: 47 | name: _ParallaxMap 48 | second: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | data: 53 | first: 54 | name: _SpecGlossMap 55 | second: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | data: 60 | first: 61 | name: _DetailMask 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | data: 67 | first: 68 | name: _DetailAlbedoMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | data: 74 | first: 75 | name: _Occlusion 76 | second: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | data: 81 | first: 82 | name: _OcclusionMap 83 | second: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | data: 88 | first: 89 | name: _MetallicGlossMap 90 | second: 91 | m_Texture: {fileID: 0} 92 | m_Scale: {x: 1, y: 1} 93 | m_Offset: {x: 0, y: 0} 94 | m_Floats: 95 | data: 96 | first: 97 | name: _AlphaTestRef 98 | second: .5 99 | data: 100 | first: 101 | name: _Lightmapping 102 | second: 1 103 | data: 104 | first: 105 | name: _SrcBlend 106 | second: 1 107 | data: 108 | first: 109 | name: _DstBlend 110 | second: 0 111 | data: 112 | first: 113 | name: _Parallax 114 | second: .0199999996 115 | data: 116 | first: 117 | name: _ZWrite 118 | second: 1 119 | data: 120 | first: 121 | name: _Glossiness 122 | second: .100000001 123 | data: 124 | first: 125 | name: _BumpScale 126 | second: 1 127 | data: 128 | first: 129 | name: _OcclusionStrength 130 | second: 1 131 | data: 132 | first: 133 | name: _DetailNormalMapScale 134 | second: 1 135 | data: 136 | first: 137 | name: _UVSec 138 | second: 0 139 | data: 140 | first: 141 | name: _Mode 142 | second: 0 143 | data: 144 | first: 145 | name: _EmissionScaleUI 146 | second: 2 147 | data: 148 | first: 149 | name: _Metallic 150 | second: .100000001 151 | m_Colors: 152 | data: 153 | first: 154 | name: _EmissionColor 155 | second: {r: 1.33483374, g: 1.33483374, b: 1.33483374, a: 1.33483374} 156 | data: 157 | first: 158 | name: _Color 159 | second: {r: 1, g: 1, b: 1, a: 1} 160 | data: 161 | first: 162 | name: _SpecularColor 163 | second: {r: .156862751, g: .156862751, b: .156862751, a: 1} 164 | data: 165 | first: 166 | name: _EmissionColorUI 167 | second: {r: 0, g: 0, b: 0, a: 1} 168 | data: 169 | first: 170 | name: _EmissionColorWithMapUI 171 | second: {r: 1, g: 1, b: 1, a: 1} 172 | data: 173 | first: 174 | name: _SpecColor 175 | second: {r: .117647059, g: .117647059, b: .117647059, a: 1} 176 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/YellowGrid.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82096aab38f01cb40a1cbf8629a810ba 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/YellowSmooth.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 4 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: YellowSmooth 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSIONMAP _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _UVSEC_UV1 13 | m_CustomRenderQueue: -1 14 | m_SavedProperties: 15 | serializedVersion: 2 16 | m_TexEnvs: 17 | data: 18 | first: 19 | name: _MainTex 20 | second: 21 | m_Texture: {fileID: 2800000, guid: b4646ae63b0bcca40b1bdde3b87e01bf, type: 3} 22 | m_Scale: {x: 4, y: 4} 23 | m_Offset: {x: 0, y: 0} 24 | data: 25 | first: 26 | name: _BumpMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | data: 32 | first: 33 | name: _DetailNormalMap 34 | second: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | data: 39 | first: 40 | name: _EmissionMap 41 | second: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | data: 46 | first: 47 | name: _ParallaxMap 48 | second: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | data: 53 | first: 54 | name: _SpecGlossMap 55 | second: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | data: 60 | first: 61 | name: _DetailMask 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | data: 67 | first: 68 | name: _DetailAlbedoMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | data: 74 | first: 75 | name: _Occlusion 76 | second: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | data: 81 | first: 82 | name: _OcclusionMap 83 | second: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | data: 88 | first: 89 | name: _MetallicGlossMap 90 | second: 91 | m_Texture: {fileID: 0} 92 | m_Scale: {x: 1, y: 1} 93 | m_Offset: {x: 0, y: 0} 94 | m_Floats: 95 | data: 96 | first: 97 | name: _AlphaTestRef 98 | second: .5 99 | data: 100 | first: 101 | name: _Lightmapping 102 | second: 1 103 | data: 104 | first: 105 | name: _SrcBlend 106 | second: 1 107 | data: 108 | first: 109 | name: _DstBlend 110 | second: 0 111 | data: 112 | first: 113 | name: _Parallax 114 | second: .0199999996 115 | data: 116 | first: 117 | name: _ZWrite 118 | second: 1 119 | data: 120 | first: 121 | name: _Glossiness 122 | second: .100000001 123 | data: 124 | first: 125 | name: _BumpScale 126 | second: 1 127 | data: 128 | first: 129 | name: _OcclusionStrength 130 | second: 1 131 | data: 132 | first: 133 | name: _DetailNormalMapScale 134 | second: 1 135 | data: 136 | first: 137 | name: _UVSec 138 | second: 0 139 | data: 140 | first: 141 | name: _Mode 142 | second: 0 143 | data: 144 | first: 145 | name: _EmissionScaleUI 146 | second: 2 147 | data: 148 | first: 149 | name: _Metallic 150 | second: .100000001 151 | m_Colors: 152 | data: 153 | first: 154 | name: _EmissionColor 155 | second: {r: 0, g: 0, b: 0, a: 1.33483374} 156 | data: 157 | first: 158 | name: _Color 159 | second: {r: 1, g: 1, b: 1, a: 1} 160 | data: 161 | first: 162 | name: _SpecularColor 163 | second: {r: .156862751, g: .156862751, b: .156862751, a: 1} 164 | data: 165 | first: 166 | name: _EmissionColorUI 167 | second: {r: 0, g: 0, b: 0, a: 1} 168 | data: 169 | first: 170 | name: _EmissionColorWithMapUI 171 | second: {r: 1, g: 1, b: 1, a: 1} 172 | data: 173 | first: 174 | name: _SpecColor 175 | second: {r: .117647059, g: .117647059, b: .117647059, a: 1} 176 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Materials/YellowSmooth.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e1d36c4bbd37d54f9ea183e4f5fd656 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec897f9ee2210c749ad1898ea59326f9 3 | folderAsset: yes 4 | timeCreated: 1427299881 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/GridEmissive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/GridEmissive.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/GridEmissive.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a196fd6788131ec459bfb26012466fc1 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 4 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchMauveAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchMauveAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchMauveAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3edc74ae8207fd45a93c4ed8ee27567 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchNavyAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchNavyAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchNavyAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86e4aa9207c9e2740b6ace599d659c05 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 32 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 0 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchNavyDarkAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchNavyDarkAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchNavyDarkAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a336ccf90791f9841b7e680c010d1e88 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchOrangeAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchOrangeAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchOrangeAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b939c5b46fae7e49af7d85f731ba4ec 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchPinkDAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchPinkDAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchPinkDAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 580615edf5e29d245af58fc5fe2b06ac 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 32 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 0 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchTealAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchTealAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchTealAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 590546bcbd472d94e874f6e0c76cc266 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchTurquoiseAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchTurquoiseAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchTurquoiseAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c4d7ee42c7d4f944b2ce9d370fa265c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 32 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 0 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchWhiteAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchWhiteAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchWhiteAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d0b29cecf2678b41982d2173d3670ff 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchYellowAlbedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Standard Assets/Prototyping/Textures/SwatchYellowAlbedo.png -------------------------------------------------------------------------------- /Assets/Standard Assets/Prototyping/Textures/SwatchYellowAlbedo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4646ae63b0bcca40b1bdde3b87e01bf 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 32 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 0 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ea4665ab627f4c0b8a4371c5207eeeb 3 | folderAsset: yes 4 | timeCreated: 1427297696 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Textures/gold-star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/Assets/Textures/gold-star.png -------------------------------------------------------------------------------- /Assets/Textures/gold-star.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6535d27113bde4bb8976726abbc4be86 3 | timeCreated: 1427299130 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 1 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 1 48 | textureType: 8 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.1.2f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itp-vr/week4_walk/ac9274ae2898554600fc53db76d0eceb62f80604/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # week4_walk 2 | Although it's possible to make a great VR experience without giving the user control over their navigation, many experiences are best enjoyed when the user can walk around. This demo shows how to control your character using a Bluetooth gamepad, as well as using a simple button/gaze technique. 3 | --------------------------------------------------------------------------------