-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 2 completed: autofocus enabled, introduction video added.
- Loading branch information
1 parent
3a7363b
commit 1ae6fbb
Showing
1,439 changed files
with
1,093,006 additions
and
5,319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
134 changes: 134 additions & 0 deletions
134
src/FilipePires_BusinessCard/Assets/Common/Editor/ConfigurePlayerSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
/*============================================================================== | ||
Copyright (c) 2019 PTC Inc. All Rights Reserved. | ||
Copyright (c) 2015 Qualcomm Connected Experiences, Inc. | ||
All Rights Reserved. | ||
Confidential and Proprietary - Protected under copyright and other laws. | ||
Vuforia is a trademark of PTC Inc., registered in the United States and other | ||
countries. | ||
==============================================================================*/ | ||
|
||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
namespace Vuforia.EditorClasses | ||
{ | ||
[InitializeOnLoad] | ||
public static class ConfigurePlayerSettings | ||
{ | ||
static readonly string VUFORIA_ANDROID_SETTINGS = "VUFORIA_ANDROID_SETTINGS"; | ||
static readonly string VUFORIA_IOS_SETTINGS = "VUFORIA_IOS_SETTINGS"; | ||
static readonly string VUFORIA_WSA_SETTINGS = "VUFORIA_WSA_SETTINGS"; | ||
|
||
static ConfigurePlayerSettings() | ||
{ | ||
EditorApplication.update += UpdatePlayerSettings; | ||
} | ||
|
||
static void UpdatePlayerSettings() | ||
{ | ||
BuildTargetGroup androidBuildTarget = BuildTargetGroup.Android; | ||
BuildTargetGroup iOSBuildTarget = BuildTargetGroup.iOS; | ||
BuildTargetGroup wsaBuildTarget = BuildTargetGroup.WSA; | ||
|
||
|
||
////// Android Platform \\\\\\ | ||
|
||
string androidSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(androidBuildTarget); | ||
androidSymbols = androidSymbols ?? string.Empty; | ||
if (!androidSymbols.Contains(VUFORIA_ANDROID_SETTINGS)) | ||
{ | ||
if (PlayerSettings.Android.androidTVCompatibility) | ||
{ | ||
// Disable Android TV compatibility, as this is not compatible with | ||
// portrait, portrait-upside-down and landscape-right orientations. | ||
Debug.Log("Disabling Android TV compatibility"); | ||
PlayerSettings.Android.androidTVCompatibility = false; | ||
} | ||
|
||
EnableVuforia(androidBuildTarget); | ||
|
||
// Here we set the scripting define symbols for Android | ||
// so we can remember that the settings were set once. | ||
PlayerSettings.SetScriptingDefineSymbolsForGroup(androidBuildTarget, androidSymbols + ";" + VUFORIA_ANDROID_SETTINGS); | ||
} | ||
|
||
|
||
////// iOS Platform \\\\\\ | ||
|
||
string iOSSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(iOSBuildTarget); | ||
iOSSymbols = iOSSymbols ?? ""; | ||
if (!iOSSymbols.Contains(VUFORIA_IOS_SETTINGS)) | ||
{ | ||
EnableVuforia(iOSBuildTarget); | ||
|
||
if (PlayerSettings.iOS.cameraUsageDescription.Length == 0) | ||
{ | ||
Debug.Log("Setting Camera Usage Description for iOS"); | ||
PlayerSettings.iOS.cameraUsageDescription = "Camera access required for target detection and tracking"; | ||
} | ||
|
||
if (PlayerSettings.GetScriptingBackend(iOSBuildTarget) != ScriptingImplementation.IL2CPP) | ||
{ | ||
Debug.Log("Setting iOS Scripting Backend to IL2CPP to enable 64bit support"); | ||
PlayerSettings.SetScriptingBackend(iOSBuildTarget, ScriptingImplementation.IL2CPP); | ||
} | ||
|
||
if (PlayerSettings.iOS.targetOSVersionString != "11.0") | ||
{ | ||
Debug.Log("Setting Minimum iOS Version to 11.0"); | ||
PlayerSettings.iOS.targetOSVersionString = "11.0"; | ||
} | ||
|
||
// Here we set the scripting define symbols for IOS | ||
// so we can remember that the settings were set once. | ||
PlayerSettings.SetScriptingDefineSymbolsForGroup(iOSBuildTarget, iOSSymbols + ";" + VUFORIA_IOS_SETTINGS); | ||
} | ||
|
||
|
||
////// Universal Windows Platform (UWP) \\\\\\ | ||
|
||
string wsaSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(wsaBuildTarget); | ||
wsaSymbols = wsaSymbols ?? ""; | ||
if (!wsaSymbols.Contains(VUFORIA_WSA_SETTINGS)) | ||
{ | ||
EnableVuforia(wsaBuildTarget); | ||
|
||
if (PlayerSettings.GetScriptingBackend(wsaBuildTarget) != ScriptingImplementation.IL2CPP) | ||
{ | ||
Debug.Log("Setting WSA Scripting Backend to IL2CPP"); | ||
PlayerSettings.SetScriptingBackend(wsaBuildTarget, ScriptingImplementation.IL2CPP); | ||
} | ||
|
||
// Vuforia needs WebCam permission; UWP requires Microphone permission if using WebCam permission. | ||
Debug.Log("Setting WSA Capability for WebCam"); | ||
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.WebCam, true); | ||
Debug.Log("Setting WSA Capability for Microphone"); | ||
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.Microphone, true); | ||
|
||
// Vuforia SDK for UWP also requires InternetClient Access | ||
Debug.Log("Setting WSA Capability for InternetClient"); | ||
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.InternetClient, true); | ||
|
||
// Here we set the scripting define symbols for WSA | ||
// so we can remember that the settings were set once. | ||
PlayerSettings.SetScriptingDefineSymbolsForGroup(wsaBuildTarget, wsaSymbols + ";" + VUFORIA_WSA_SETTINGS); | ||
} | ||
|
||
|
||
// Unregister callback so that this script is only executed once | ||
EditorApplication.update -= UpdatePlayerSettings; | ||
} | ||
|
||
|
||
static void EnableVuforia(BuildTargetGroup buildTargetGroup) | ||
{ | ||
if (!PlayerSettings.vuforiaEnabled) | ||
{ | ||
Debug.Log("Enabling Vuforia for " + buildTargetGroup.ToString()); | ||
PlayerSettings.SetPlatformVuforiaEnabled(buildTargetGroup, true); | ||
} | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/FilipePires_BusinessCard/Assets/Common/Editor/OptionsConfigEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/*=============================================================================== | ||
Copyright (c) 2017 PTC Inc. All Rights Reserved. | ||
Vuforia is a trademark of PTC Inc., registered in the United States and other | ||
countries. | ||
===============================================================================*/ | ||
using UnityEditor; | ||
|
||
[CustomEditor(typeof(OptionsConfig))] | ||
[CanEditMultipleObjects] | ||
public class OptionsConfigEditor : Editor | ||
{ | ||
OptionsConfig _myTarget; | ||
|
||
#region UNITY_EDITOR_METHODS | ||
|
||
void OnEnable() | ||
{ | ||
_myTarget = (OptionsConfig)target; | ||
|
||
UpdateOptions(); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
DrawDefaultInspector(); | ||
|
||
UpdateOptions(); | ||
} | ||
|
||
#endregion // UNITY_EDITOR_METHODS | ||
|
||
#region PRIVATE_METHODS | ||
|
||
void UpdateOptions() | ||
{ | ||
|
||
if (_myTarget.options.Length > 0) | ||
{ | ||
for (int o = 0; o < _myTarget.options.Length; ++o) | ||
{ | ||
_myTarget.options[o].name = "Option " + (o + 1); | ||
|
||
if (_myTarget.options[o].m_Object) | ||
{ | ||
_myTarget.options[o].m_Object.SetActive(_myTarget.options[o].enabled); | ||
} | ||
else | ||
{ | ||
_myTarget.options[o].enabled = false; | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endregion // PRIVATE_METHODS | ||
|
||
} |
Oops, something went wrong.