From 447bf5026da63d771cfdfb8abfe8eda319ef210b Mon Sep 17 00:00:00 2001 From: Aidan Hoover Date: Thu, 23 Apr 2026 17:44:44 -0400 Subject: [PATCH 1/5] apple build documentation --- Documentation/AppleBuild.md | 91 +++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 Documentation/AppleBuild.md diff --git a/Documentation/AppleBuild.md b/Documentation/AppleBuild.md new file mode 100644 index 0000000..10d8521 --- /dev/null +++ b/Documentation/AppleBuild.md @@ -0,0 +1,91 @@ +# Apple Compile +By Aidan Hoover +Based off Apple Compile By Nicholas Busaba + +## Current Status + - Window size is too small (black bars around the cardboard view) and off centered. + - Scenario 1, 2, and main menu should work with iOS. + +## How to Compile + - Get an Apple account + - Make a developer Apple Account (https://developer.apple.com/programs/enroll/) + - Get XCode. Use the Apple store if you can. If on an older mac use https://xcodereleases.com/ to get the right version + - In XCode you need to set up a team with yourself. + - I can't remember the process because I did it a while ago now but it should work. + - Make sure everything is pulled + - Open the Unity Project + +## Setting Up Unity + - Projects -> Add -> select "Gyroscope Testing" + - File -> Build Profiles -> iOS -> + - See "No iOS module loaded." -> Click "Install with Unity Hub" + - Install iOS Build Support, reload editor + - File -> Build Profiles -> iOS -> "Switch Platform" + - File -> Open Scene -> Assets -> Scenes -> Home.unity + + +**Unity Produced File Modifications** + - Search for file CardboardReticlePointer.cs (Packages/com.google.xr.cardboard/Runtime/CardboardReticlePointer.cs) + - in Update(): + - find line: + ``` + if (Google.XR.Cardboard.Api.IsTriggerPressed || Mouse.current.leftButton.isPressed) + ``` + - replace with: + ``` + if (Google.XR.Cardboard.Api.IsTriggerPressed || (Mouse.current != null && Mouse.current.leftButton.isPressed)) + ``` + - The issue this fixes is allowing a touch to iPhone screen to work as an interaction. + - Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs (is in repository and can be changed there but for now) + - In ```RunEveryFrame(GameObject cur)```: + - find line 84: + ``` + bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || Mouse.current.leftButton.isPressed; + ``` + - replace with: + ``` + bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || (Mouse.current != null && Mouse.current.leftButton.isPressed); + ``` + - The issue this fixes is taking a touch to iPhone screen as a pause invoking interact. + - Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs (is in repository and can be changed there but for now) + - In ```Keyboard_3D_Static::makeNewKeyboardObject()```: + - add the following after ```if (prefab == null) {...}```: + ``` + instance = Object.Instantiate(prefab); + if (instance.GetComponent() == null) { + Debug.LogError("Keyboard_3D missing from prefab. Adding at runtime."); + instance.AddComponent(); + } + ``` + - replace: ```return Object.Instantiate(prefab);``` with ```return instance;``` + - The issue this fixes is for iOS builds, Keyboard_Base.prefab may instantiate without the Keyboard_3D component due to Unity build inconsistencies. This checks and forces the component to be added at runtime. + +**Unity Settings and Build** + - Edit -> Project Settings -> + - -> Player + - Company Name = RPI RCC + - Settings for IOS -> Other Settings -> + - Bundle Identifier = set the team name correctly. ex: com.vrctf.vrctf + - Target Device = set to iPhone Only + - Target SDK = set to Simulator or Device depending on what you want + - Enable ProMotion = True + - -> XR Plug-in Management -> Settings for IOS -> Cardboard XR Plugin = True + - File -> Build Profiles -> iOS (active) or switch platform to it if not active + - Build, choose new folder + +## XCode Settings and Run + - Finder -> Build Folder -> Info.plist + - (+) Privacy - Camera Usage Description + - Set string to "Camera is used to scan VR headset QR codes for Cardboard configuration." + - *This will reset every build but after the first run with it on an iPhone that iPhone won't need it again.* + - Finder -> Build Folder -> open Unity-iPhone.xcworkspace + - In XCode: + - Unity-iPhone (target) + - Signing and Capabilities + - Automatically manage signing = true + - Set "team" to personal team + - Select iOS device and run + + +## Next Steps + - GitHub actions to perform compliance checks to ensure futher development doesn't break compatibility. \ No newline at end of file From 8956726c2d49b0b2fc56ecf5ebf958097c66276b Mon Sep 17 00:00:00 2001 From: Aidan Hoover Date: Tue, 28 Apr 2026 14:09:14 -0400 Subject: [PATCH 2/5] made changes to the files listed in the original documentation, and changed the documentation to note that --- Documentation/AppleBuild.md | 51 ++++++++++--------- .../Scripts/KeyboardScripts/Keyboard_3D.cs | 9 +++- .../Assets/Scripts/Pausing/UserPauseStatus.cs | 2 +- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Documentation/AppleBuild.md b/Documentation/AppleBuild.md index 10d8521..1cb38f9 100644 --- a/Documentation/AppleBuild.md +++ b/Documentation/AppleBuild.md @@ -36,29 +36,6 @@ Based off Apple Compile By Nicholas Busaba if (Google.XR.Cardboard.Api.IsTriggerPressed || (Mouse.current != null && Mouse.current.leftButton.isPressed)) ``` - The issue this fixes is allowing a touch to iPhone screen to work as an interaction. - - Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs (is in repository and can be changed there but for now) - - In ```RunEveryFrame(GameObject cur)```: - - find line 84: - ``` - bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || Mouse.current.leftButton.isPressed; - ``` - - replace with: - ``` - bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || (Mouse.current != null && Mouse.current.leftButton.isPressed); - ``` - - The issue this fixes is taking a touch to iPhone screen as a pause invoking interact. - - Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs (is in repository and can be changed there but for now) - - In ```Keyboard_3D_Static::makeNewKeyboardObject()```: - - add the following after ```if (prefab == null) {...}```: - ``` - instance = Object.Instantiate(prefab); - if (instance.GetComponent() == null) { - Debug.LogError("Keyboard_3D missing from prefab. Adding at runtime."); - instance.AddComponent(); - } - ``` - - replace: ```return Object.Instantiate(prefab);``` with ```return instance;``` - - The issue this fixes is for iOS builds, Keyboard_Base.prefab may instantiate without the Keyboard_3D component due to Unity build inconsistencies. This checks and forces the component to be added at runtime. **Unity Settings and Build** - Edit -> Project Settings -> @@ -88,4 +65,30 @@ Based off Apple Compile By Nicholas Busaba ## Next Steps - - GitHub actions to perform compliance checks to ensure futher development doesn't break compatibility. \ No newline at end of file + - GitHub actions to perform compliance checks to ensure futher development doesn't break compatibility. + + +## Repo Files Modified +- Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs (is in repository and can be changed there but for now) + - In ```RunEveryFrame(GameObject cur)```: + - find line 84: + ``` + bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || Mouse.current.leftButton.isPressed; + ``` + - replace with: + ``` + bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || (Mouse.current != null && Mouse.current.leftButton.isPressed); + ``` + - The issue this fixes is taking a touch to iPhone screen as a pause invoking interact. + - Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs (is in repository and can be changed there but for now) + - In ```Keyboard_3D_Static::makeNewKeyboardObject()```: + - add the following after ```if (prefab == null) {...}```: + ``` + instance = Object.Instantiate(prefab); + if (instance.GetComponent() == null) { + Debug.LogError("Keyboard_3D missing from prefab. Adding at runtime."); + instance.AddComponent(); + } + ``` + - replace: ```return Object.Instantiate(prefab);``` with ```return instance;``` + - The issue this fixes is for iOS builds, Keyboard_Base.prefab may instantiate without the Keyboard_3D component due to Unity build inconsistencies. This checks and forces the component to be added at runtime. \ No newline at end of file diff --git a/Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs b/Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs index c1085cf..180d250 100644 --- a/Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs +++ b/Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs @@ -13,7 +13,14 @@ public static GameObject makeNewKeyboardObject() Debug.LogError("Prefab \"KeyboardPrefabs/Keyboard_Base\" not found in Resources folder"); return null; } - return Object.Instantiate(prefab); + + instance = Object.Instantiate(prefab); + if (instance.GetComponent() == null) { + Debug.LogError("Keyboard_3D missing from prefab. Adding at runtime."); + instance.AddComponent(); + } + + return instance; } public static GameObject makeNewKeyboardObjectAndKeys(TypeEnum keyboard_type, float hor_margin, float ver_margin, System.Action onKeyPress_func, diff --git a/Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs b/Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs index e935c24..f5de6f4 100644 --- a/Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs +++ b/Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs @@ -81,7 +81,7 @@ public override void RunEveryFrame(GameObject cur) { return; } - bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || Mouse.current.leftButton.isPressed; + bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || (Mouse.current != null && Mouse.current.leftButton.isPressed); currentTimeHeld = (currentTimeHeld > 0.01f || isButtonPressed) ? (currentTimeHeld + Time.deltaTime) : 0; currentTimeDropped = (currentTimeHeld > 0.01f && !isButtonPressed) ? (currentTimeDropped + Time.deltaTime) : 0; From 9736e3fb06f33e19761bf8447cf21c736b2fe39b Mon Sep 17 00:00:00 2001 From: Aidan Hoover Date: Tue, 28 Apr 2026 14:11:53 -0400 Subject: [PATCH 3/5] changed phrasing of documentation --- Documentation/AppleBuild.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/AppleBuild.md b/Documentation/AppleBuild.md index 1cb38f9..4a350c8 100644 --- a/Documentation/AppleBuild.md +++ b/Documentation/AppleBuild.md @@ -69,20 +69,20 @@ Based off Apple Compile By Nicholas Busaba ## Repo Files Modified -- Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs (is in repository and can be changed there but for now) +- Gyroscope Testing/Assets/Scripts/Pausing/UserPauseStatus.cs - In ```RunEveryFrame(GameObject cur)```: - - find line 84: + - line 84: ``` bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || Mouse.current.leftButton.isPressed; ``` - - replace with: + - replaced with: ``` bool isButtonPressed = Google.XR.Cardboard.Api.IsTriggerPressed || (Mouse.current != null && Mouse.current.leftButton.isPressed); ``` - The issue this fixes is taking a touch to iPhone screen as a pause invoking interact. - - Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs (is in repository and can be changed there but for now) + - Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs - In ```Keyboard_3D_Static::makeNewKeyboardObject()```: - - add the following after ```if (prefab == null) {...}```: + - added the following after ```if (prefab == null) {...}```: ``` instance = Object.Instantiate(prefab); if (instance.GetComponent() == null) { @@ -90,5 +90,5 @@ Based off Apple Compile By Nicholas Busaba instance.AddComponent(); } ``` - - replace: ```return Object.Instantiate(prefab);``` with ```return instance;``` + - replaced: ```return Object.Instantiate(prefab);``` with ```return instance;``` - The issue this fixes is for iOS builds, Keyboard_Base.prefab may instantiate without the Keyboard_3D component due to Unity build inconsistencies. This checks and forces the component to be added at runtime. \ No newline at end of file From 0e9c2da16296184cf7060861792cbe32f1fcf47a Mon Sep 17 00:00:00 2001 From: Aidan Hoover Date: Wed, 29 Apr 2026 10:05:12 -0400 Subject: [PATCH 4/5] update --- Documentation/AppleBuild.md | 1 - Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/AppleBuild.md b/Documentation/AppleBuild.md index 4a350c8..02d8cf9 100644 --- a/Documentation/AppleBuild.md +++ b/Documentation/AppleBuild.md @@ -11,7 +11,6 @@ Based off Apple Compile By Nicholas Busaba - Make a developer Apple Account (https://developer.apple.com/programs/enroll/) - Get XCode. Use the Apple store if you can. If on an older mac use https://xcodereleases.com/ to get the right version - In XCode you need to set up a team with yourself. - - I can't remember the process because I did it a while ago now but it should work. - Make sure everything is pulled - Open the Unity Project diff --git a/Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs b/Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs index 180d250..226e5e5 100644 --- a/Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs +++ b/Gyroscope Testing/Assets/Scripts/KeyboardScripts/Keyboard_3D.cs @@ -14,7 +14,7 @@ public static GameObject makeNewKeyboardObject() return null; } - instance = Object.Instantiate(prefab); + GameObject instance = Object.Instantiate(prefab); if (instance.GetComponent() == null) { Debug.LogError("Keyboard_3D missing from prefab. Adding at runtime."); instance.AddComponent(); From a3e3ce8f5cdcc0f0cb6e0d527e0dd61c2cb30234 Mon Sep 17 00:00:00 2001 From: Aidan Hoover Date: Wed, 29 Apr 2026 10:28:03 -0400 Subject: [PATCH 5/5] permission name changed --- Documentation/AppleBuild.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/AppleBuild.md b/Documentation/AppleBuild.md index 02d8cf9..8825903 100644 --- a/Documentation/AppleBuild.md +++ b/Documentation/AppleBuild.md @@ -51,7 +51,7 @@ Based off Apple Compile By Nicholas Busaba ## XCode Settings and Run - Finder -> Build Folder -> Info.plist - - (+) Privacy - Camera Usage Description + - (+) Privacy - NSCameraUsageDescription or Privacy - Camera Usage Description - Set string to "Camera is used to scan VR headset QR codes for Cardboard configuration." - *This will reset every build but after the first run with it on an iPhone that iPhone won't need it again.* - Finder -> Build Folder -> open Unity-iPhone.xcworkspace