Skip to content

Commit

Permalink
Version 2 completed: autofocus enabled, introduction video added.
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipeLopesPires committed Nov 4, 2019
1 parent 3a7363b commit 1ae6fbb
Show file tree
Hide file tree
Showing 1,439 changed files with 1,093,006 additions and 5,319 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ src/FilipePires_BusinessCard/Library/StateCache/
# logs
src/FilipePires_BusinessCard/Logs

# temporary files
src/FilipePires_BusinessCard/Temp

# photoshop files
*.psd

# unity meta files
*.meta
*.meta

# video editing
demo/production
Binary file added img/business_card_back.pdf
Binary file not shown.
Binary file added img/business_card_front.pdf
Binary file not shown.
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);
}
}
}
}
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

}
Loading

0 comments on commit 1ae6fbb

Please sign in to comment.