Skip to content

Commit

Permalink
Cardboard XR Plugin v1.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyunh0929 committed Oct 24, 2022
1 parent 5d09998 commit f14b4d1
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 4 deletions.
8 changes: 8 additions & 0 deletions Editor/BuildPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
path + "/Frameworks/com.google.xr.cardboard/Runtime/iOS/sdk.bundle/qrSample.png.meta");
FileUtil.DeleteFileOrDirectory(
path + "/Frameworks/com.google.xr.cardboard/Runtime/iOS/sdk.bundle/tickmarks.png.meta");

// Note: SDK binaries no longer contain bitcode, as
// <a https://developer.apple.com/documentation/Xcode-Release-Notes/xcode-14-release-notes>Apple has deprecated bitcode</a>.
string projectPath = PBXProject.GetPBXProjectPath(path);
string projectConfig = File.ReadAllText(projectPath);
projectConfig = projectConfig.Replace("ENABLE_BITCODE = YES",
"ENABLE_BITCODE = NO");
File.WriteAllText(projectPath, projectConfig);
}
}
}
Expand Down
Binary file added Resources/Cardboard/quantum_ic_line_white_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
133 changes: 133 additions & 0 deletions Resources/Cardboard/quantum_ic_line_white_24.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Runtime/Android/GfxPluginCardboard.aar
Binary file not shown.
2 changes: 1 addition & 1 deletion Runtime/UnitySubsystemsManifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Cardboard",
"version": "1.17.0",
"version": "1.18.0",
"libraryName": "GfxPluginCardboard",
"displays": [
{
Expand Down
9 changes: 7 additions & 2 deletions Runtime/XRLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class XRLoader : XRLoaderHelper

private static Texture2D _gearTexture;

private static Texture2D _whiteLineTexture;

/// <summary>
/// Pairs the native enum to set the graphics API being used.
/// </summary>
Expand Down Expand Up @@ -165,7 +167,7 @@ internal static void RecalculateRectangles(Rect renderingArea)
1, _gearTexture.GetNativeTexturePtr(), gearRect.x, gearRect.y, gearRect.width,
gearRect.height);
CardboardUnity_setWidgetParams(
2, Texture2D.whiteTexture.GetNativeTexturePtr(), alignmentRect.x,
2, _whiteLineTexture.GetNativeTexturePtr(), alignmentRect.x,
alignmentRect.y, alignmentRect.width, alignmentRect.height);
}

Expand Down Expand Up @@ -282,6 +284,8 @@ private void CardboardSDKInitialize()
DontDestroyOnLoad(_closeTexture);
_gearTexture = Resources.Load<Texture2D>("Cardboard/quantum_ic_settings_white_24");
DontDestroyOnLoad(_gearTexture);
_whiteLineTexture = Resources.Load<Texture2D>("Cardboard/quantum_ic_line_white_24");
DontDestroyOnLoad(_whiteLineTexture);

SetGraphicsApi();
SetViewportOrientation(Screen.orientation);
Expand All @@ -292,12 +296,13 @@ private void CardboardSDKInitialize()
}

/// <summary>
/// Close and gear button textures are preserved until the XR provider is deinitialized.
/// Widgets textures are preserved until the XR provider is deinitialized.
/// </summary>
private void CardboardSDKDeinitialize()
{
Resources.UnloadAsset(_closeTexture);
Resources.UnloadAsset(_gearTexture);
Resources.UnloadAsset(_whiteLineTexture);
}
}
}
Binary file modified Runtime/iOS/GfxPluginCardboard.a
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.google.xr.cardboard",
"displayName": "Google Cardboard XR Plugin for Unity",
"version": "1.17.0",
"version": "1.18.0",
"unity": "2019.4",
"description": "Provides rendering and input support for Google Cardboard.",
"keywords": [
Expand Down

0 comments on commit f14b4d1

Please sign in to comment.