private void OnGUI()
        {
            GUILayout.BeginVertical();
            GUILayout.Space(5);
            GUIStyle titleStyle = new GUIStyle(GUI.skin.label);

            titleStyle.alignment    = TextAnchor.MiddleCenter;
            titleStyle.stretchWidth = true;
            titleStyle.fontSize     = 14;
            titleStyle.fixedHeight  = 20;
            EditorGUILayout.LabelField("ARCore Project Settings", titleStyle);
            GUILayout.Space(15);
            ARCoreProjectSettings.Instance.IsARCoreRequired =
                EditorGUILayout.Toggle("ARCore Required", ARCoreProjectSettings.Instance.IsARCoreRequired);
            GUILayout.Space(5);
            ARCoreProjectSettings.Instance.IsInstantPreviewEnabled =
                EditorGUILayout.Toggle("Instant Preview enabled",
                                       ARCoreProjectSettings.Instance.IsInstantPreviewEnabled);
            GUILayout.Space(5);
            bool newARCoreIOSEnabled =
                EditorGUILayout.Toggle("iOS Support Enabled",
                                       ARCoreProjectSettings.Instance.IsIOSSupportEnabled);

            GUILayout.Space(5);
            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(3);
            EditorGUILayout.LabelField("Android Cloud Services API Key", GUILayout.Width(180));
            ARCoreProjectSettings.Instance.CloudServicesApiKey =
                EditorGUILayout.TextField(ARCoreProjectSettings.Instance.CloudServicesApiKey);
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(5);
            EditorGUILayout.BeginHorizontal();
            GUILayout.Space(3);
            EditorGUILayout.LabelField("iOS Cloud Services API Key", GUILayout.Width(180));
            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);
                }
                ARCoreProjectSettings.Instance.Save();
            }
            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Close", GUILayout.Width(50), GUILayout.Height(20)))
            {
                Close();
            }
            EditorGUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }
        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);
            }
        }
        // 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(k_GroupLabelIndent);
                EditorGUILayout.LabelField(Android, GUILayout.Width(k_GroupFieldIndent));
                ARCoreProjectSettings.Instance.CloudServicesApiKey =
                    EditorGUILayout.TextField(ARCoreProjectSettings.Instance.CloudServicesApiKey);
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);

                EditorGUILayout.BeginHorizontal();
                GUILayout.Space(k_GroupLabelIndent);
                EditorGUILayout.LabelField(IOS, GUILayout.Width(k_GroupFieldIndent));
                ARCoreProjectSettings.Instance.IosCloudServicesApiKey =
                    EditorGUILayout.TextField(
                        ARCoreProjectSettings.Instance.IosCloudServicesApiKey);
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);
            }

            if (GUI.changed)
            {
                if (newARCoreIOSEnabled != ARCoreProjectSettings.Instance.IsIOSSupportEnabled)
                {
                    ARCoreProjectSettings.Instance.IsIOSSupportEnabled = newARCoreIOSEnabled;
                    ARCoreIOSSupportHelper.SetARCoreIOSSupportEnabled(newARCoreIOSEnabled);
                }
            }
        }
 public override void OnPreprocessBuild(BuildTarget target, string path)
 {
     if (target == BuildTarget.iOS)
     {
         bool arcoreiOSEnabled = ARCoreProjectSettings.Instance.IsIOSSupportEnabled;
         if (arcoreiOSEnabled)
         {
             Debug.Log("Building application with ARCore iOS support ENABLED.");
         }
         else
         {
             Debug.Log("Building application with ARCore iOS support DISABLED.");
         }
         ARCoreIOSSupportHelper.SetARCoreIOSSupportEnabled(arcoreiOSEnabled);
     }
 }