Beispiel #1
0
        static void showMethodsInInspector(params Object[] targets)
        {
            var target = targets.First() as ARFoundationRemoteInstaller;

            Assert.IsNotNull(target);

            #if AR_FOUNDATION_REMOTE_INSTALLED
            GUILayout.Space(16);
            GUILayout.Label("AR Companion app", EditorStyles.boldLabel);
            if (GUILayout.Button("Install AR Companion app", new GUIStyle(GUI.skin.button)
            {
                fontStyle = FontStyle.Bold
            }))
            {
                execute(() => CompanionAppInstaller.BuildAndRun(target.optionalCompanionAppExtension));
            }
            if (GUILayout.Button("Build AR Companion and show in folder", new GUIStyle(GUI.skin.button)))
            {
                execute(() => CompanionAppInstaller.Build(target.optionalCompanionAppExtension));
            }
            if (GUILayout.Button("Open Plugin Settings"))
            {
                Selection.activeObject = ARFoundationRemote.Runtime.Settings.Instance;
            }
            if (GUILayout.Button("Delete AR Companion app build folder"))
            {
                execute(CompanionAppInstaller.DeleteCompanionAppBuildFolder);
            }
            #endif

            GUILayout.Space(16);
            GUILayout.Label(ARFoundationRemoteInstaller.pluginName, EditorStyles.boldLabel);
            if (GUILayout.Button("Install or Update Plugin"))
            {
                execute(ARFoundationRemoteInstaller.InstallPlugin);
            }
            #if AR_FOUNDATION_REMOTE_INSTALLED
            if (GUILayout.Button("Apply fixes"))
            {
                FixesForEditorSupport.Apply();
            }
            if (GUILayout.Button("Un-install Plugin", new GUIStyle(GUI.skin.button)
            {
                normal = { textColor = Color.red }
            }))
            {
                execute(ARFoundationRemoteInstaller.UnInstallPlugin);
            }
            #endif
        }
Beispiel #2
0
        static void showMethodsInInspector(params Object[] targets)
        {
            var target = targets.First() as ARFoundationRemoteInstaller;

            Assert.IsNotNull(target);

            if (isInstalled)
            {
                GUILayout.Space(16);
                GUILayout.Label("AR Companion app", EditorStyles.boldLabel);
                if (GUILayout.Button("Install AR Companion App", new GUIStyle(GUI.skin.button)
                {
                    fontStyle = FontStyle.Bold
                }))
                {
                    execute(() => CompanionAppInstaller.BuildAndRun(target.optionalCompanionAppExtension, target.modifyAppId));
                }

                if (GUILayout.Button("Build AR Companion and show in folder", new GUIStyle(GUI.skin.button)))
                {
                    execute(() => CompanionAppInstaller.Build(target.optionalCompanionAppExtension, target.modifyAppId));
                }

                if (GUILayout.Button("Open Plugin Settings"))
                {
                    #if AR_FOUNDATION_REMOTE_INSTALLED
                    Selection.activeObject = Runtime.Settings.Instance;
                    #endif
                }

                if (GUILayout.Button("Delete AR Companion app build folder"))
                {
                    execute(CompanionAppInstaller.DeleteCompanionAppBuildFolder);
                }

                GUILayout.Space(16);
                if (GUILayout.Button("Apply AR Foundation fixes"))
                {
                    #if AR_FOUNDATION_REMOTE_INSTALLED
                    AutoARFoundationFixes.Enabled = true;
                    FixesForEditorSupport.Apply(true);
                    #endif
                }

                GUILayout.Space(16);
                GUILayout.Label(ARFoundationRemoteInstaller.displayName, EditorStyles.boldLabel);
                if (GUILayout.Button("Un-install Plugin", new GUIStyle(GUI.skin.button)
                {
                    normal = { textColor = Color.red }
                }))
                {
                    AutoARFoundationFixes.Enabled = false;
                    ARFoundationRemoteInstaller.UnInstallPlugin();
                }
            }
            else
            {
                if (GUILayout.Button("Install Plugin"))
                {
                    ARFoundationRemoteInstaller.InstallPlugin(true);
                }
            }
        }