Esempio n. 1
0
        static void PerformFirstTimeSetup()
        {
            SKSEditorUtil.AddDefine(projectSymbol, GetGroupFromBuildTarget(EditorUserBuildSettings.activeBuildTarget));
            EditorPrefs.SetBool(_performingFirstTimeSetup, true);
            EditorPrefs.DeleteKey(_ignoreSetup);

            //Create the default tags and layers
            GenTagDatabase();

            ReassignPrefabLayers();
        }
Esempio n. 2
0
        public static void ApplyDefault()
        {
            EditorUtility.DisplayProgressBar("Applying Default Presets...", "", 1f);

            EditorPrefs.SetBool(_performingSetup, true);
            if (!projectInitialized)
            {
                PerformFirstTimeSetup();
            }

            SKSEditorUtil.RemoveDefine(vrSymbol);
        }
Esempio n. 3
0
        public static void ApplyDefault()
        {
            EditorUtility.DisplayProgressBar("Applying Default Presets...", "", 1f);

            EditorPrefs.SetBool(_performingSetup, true);
            if (!projectInitialized)
            {
                PerformFirstTimeSetup();
            }

            SKSEditorUtil.RemoveDefine(vrSymbol, GetGroupFromBuildTarget(EditorUserBuildSettings.activeBuildTarget));
        }
Esempio n. 4
0
        public static void ApplyVR(bool includeVRTK)
        {
            EditorUtility.DisplayProgressBar("Applying VR Presets...", "", 1f);

            if (includeVRTK)
            {
                Logger.Log("Importing VRTK");
                EditorPrefs.SetInt(_importingVRTK, 2);

                var vrtkPath = Directory.GetFiles("Assets", "vrtk.unitypackage", SearchOption.AllDirectories);
                if (vrtkPath.Length > 0)
                {
                    AssetDatabase.ImportPackage(vrtkPath[0], false);
                    //AssetDatabase.Refresh();
                }
                else
                {
                    // failed to find vrtk package
                }
            }
            else
            {
                // if the user decides to set VR mode without importing VRTK the compile flags can cause errors/
                // detect those errors and let the user know the problem.
                if (!VRTKIsMaybeInstalled)
                {
                    ConsoleCallbackHandler.AddCallback(HandleVRTKImportError, LogType.Error, "CS0246");
                }
            }

            var vrtkSupportPath = Directory.GetFiles("Assets", "vrtk_support.unitypackage", SearchOption.AllDirectories);

            if (vrtkSupportPath.Length > 0)
            {
                AssetDatabase.ImportPackage(vrtkSupportPath[0], false);
                AssetDatabase.Refresh();
            }
            else
            {
                // failed to find vrtk_support package
            }

            EditorPrefs.SetBool(_performingSetup, true);
            if (!projectInitialized)
            {
                PerformFirstTimeSetup();
            }

            SKSEditorUtil.AddDefine(vrSymbol);
        }
Esempio n. 5
0
        private static void HandleVRTKImportError()
        {
            ConsoleCallbackHandler.RemoveCallback(LogType.Error, "CS0246");
            EditorUtility.ClearProgressBar();

            EditorUtility.DisplayDialog("No VRTK Installation Found", "No suitable VRTK installation found. VR Portal scripts will not function and may throw errors if VRTK is not present.\n\nIf you have no existing VRTK installation, you should check the 'Also import VRTK' box before applying VR mode.", "Okay");

            SKSEditorUtil.RemoveDefine(vrSymbol);
            performingSetup = false;

            if (performingFirstRunSetup)
            {
                SKSEditorUtil.RemoveDefine(projectSymbol);
                performingFirstRunSetup = false;
            }
        }
Esempio n. 6
0
        static void PerformFirstTimeSetup()
        {
            Logger.Log("performing first-time setup");

            SKSEditorUtil.AddDefine(projectSymbol);
            EditorPrefs.SetBool(_performingFirstTimeSetup, true);
            EditorPrefs.DeleteKey(_ignoreSetup);

            CreateLayer("Player");
            CreateLayer("Portal");
            CreateLayer("PortalPlaceholder");
            CreateLayer("PortalOnly");
            CreateLayer("RenderExclude");
            CreateTag("PhysicsPassthroughDuplicate");
            CreateTag("SKSEditorTemp");

            ReassignPrefabLayers();
        }