예제 #1
0
        public override void OnPreprocessBuild(BuildTarget target, string path)
        {
            if (target == BuildTarget.iOS)
            {
                bool arcoreiOSEnabled = ARCoreProjectSettings.Instance.IsIOSSupportEnabled;
                Debug.LogFormat("Building application with ARCore SDK for Unity iOS support {0}",
                                arcoreiOSEnabled ? "ENABLED" : "DISABLED");

                ARCoreIOSSupportHelper.SetARCoreIOSSupportEnabled(arcoreiOSEnabled);
            }
        }
예제 #2
0
        // Render ARCore Project Settings for ARCoreProjectSettingsWindow and
        // ARCoreProjectSettingsProvider.
        internal static void OnGUI(bool renderForStandaloneWindow)
        {
            ARCoreProjectSettings.Instance.IsARCoreRequired =
                EditorGUILayout.Toggle(ARCoreRequired,
                                       ARCoreProjectSettings.Instance.IsARCoreRequired);
            GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

            ARCoreProjectSettings.Instance.IsInstantPreviewEnabled =
                EditorGUILayout.Toggle(InstantPreviewEnabled,
                                       ARCoreProjectSettings.Instance.IsInstantPreviewEnabled);
            GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

            bool newARCoreIOSEnabled =
                EditorGUILayout.Toggle(IOSSupportEnabled,
                                       ARCoreProjectSettings.Instance.IsIOSSupportEnabled);

            GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

            s_FoldoutCloudAnchorAPIKeys =
                EditorGUILayout.Foldout(s_FoldoutCloudAnchorAPIKeys, CloudAnchorAPIKeys);
            if (s_FoldoutCloudAnchorAPIKeys)
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(s_GroupLabelIndent);
                EditorGUILayout.LabelField(Android, GUILayout.Width(s_GroupFieldIndent));
                ARCoreProjectSettings.Instance.CloudServicesApiKey =
                    EditorGUILayout.TextField(ARCoreProjectSettings.Instance.CloudServicesApiKey);
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(s_GroupLabelIndent);
                EditorGUILayout.LabelField(IOS, GUILayout.Width(s_GroupFieldIndent));
                ARCoreProjectSettings.Instance.IosCloudServicesApiKey =
                    EditorGUILayout.TextField(
                        ARCoreProjectSettings.Instance.IosCloudServicesApiKey);
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(10);
            }

            if (GUI.changed)
            {
                if (newARCoreIOSEnabled != ARCoreProjectSettings.Instance.IsIOSSupportEnabled)
                {
                    ARCoreProjectSettings.Instance.IsIOSSupportEnabled = newARCoreIOSEnabled;
                    ARCoreIOSSupportHelper.SetARCoreIOSSupportEnabled(newARCoreIOSEnabled);
                }
            }
        }