コード例 #1
0
        private static void OnGUI()
        {
            EditorGUILayout.LabelField(COMPILER_OPTIONS_HEADER, EditorStyles.boldLabel);

            bool autoGeneratePreference;
            bool newAutoGeneratePreference;

            using (var scope = new EditorGUILayout.HorizontalScope())
            {
                autoGeneratePreference = CompilerOverrideTools.IsCompilerOverrideFileAutoGenerationEnabled();
                EditorGUILayout.LabelField(AUTO_GENERATE_PREFERENCE_LABEL, GUILayout.MinWidth(MIN_LABEL_WIDTH));
                newAutoGeneratePreference = EditorGUILayout.Toggle(autoGeneratePreference);
            }

            if (autoGeneratePreference != newAutoGeneratePreference)
            {
                CompilerOverrideTools.SetAutoGenerateCompilerOverrideFilePreference(newAutoGeneratePreference);
            }

            if (GUILayout.Button(REGENERATE_COMPILER_FILE_BUTTON))
            {
                CompilerOverrideTools.RegenerateCompilerOverrideFile();
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField(DEMO_BUILD_HEADER, EditorStyles.boldLabel);

            bool showBuildPreference;
            bool newShowBuildPreference;

            using (var scope = new EditorGUILayout.HorizontalScope())
            {
                showBuildPreference = BuildTools.IsAutoShowBuildOnSuccessEnabled();
                EditorGUILayout.LabelField(SHOW_BUILD_RESULT_LABEL, GUILayout.MinWidth(MIN_LABEL_WIDTH));
                newShowBuildPreference = EditorGUILayout.Toggle(showBuildPreference);
            }

            if (showBuildPreference != newShowBuildPreference)
            {
                BuildTools.SetAutoShowBuildOnSuccessPreference(newShowBuildPreference);
            }
        }
コード例 #2
0
        public static void TryGenerateCompilerOverrideFile()
        {
            if (EditorApplication.isPlayingOrWillChangePlaymode)
            {
                return;
            }

            if (!CompilerOverrideTools.IsCompilerOverrideFileAutoGenerationEnabled())
            {
                return;
            }

            CompilerOverrideTools.DeleteUnusedCompilerOverrideFile();

            if (CompilerOverrideTools.DoesCompilerOverrideFileExist())
            {
                // If the compiler file already exists, check for all required arguments and warn if not present.
                var filePath     = CompilerOverrideTools.GetCompilerOverrideFilePath();
                var fileContents = File.ReadAllText(filePath);
                for (var i = 0; i < WearableEditorConstants.COMPILER_OVERRIDE_ARGUMENTS.Length; i++)
                {
                    var arg = WearableEditorConstants.COMPILER_OVERRIDE_ARGUMENTS[i];
                    if (!fileContents.Contains(arg))
                    {
                        Debug.LogWarningFormat(
                            WearableEditorConstants.COMPILER_ARGUMENT_NOT_FOUND_FORMAT,
                            arg,
                            filePath);
                    }
                }

                return;
            }

            CompilerOverrideTools.CreateCompilerOverrideFile();
        }
コード例 #3
0
        private static void OnGUI()
        {
            EditorGUILayout.LabelField(COMPILER_OPTIONS_HEADER, EditorStyles.boldLabel);

            bool autoGeneratePreference;
            bool newAutoGeneratePreference;

            using (var scope = new EditorGUILayout.HorizontalScope())
            {
                autoGeneratePreference = CompilerOverrideTools.IsCompilerOverrideFileAutoGenerationEnabled();
                EditorGUILayout.LabelField(AUTO_GENERATE_PREFERENCE_LABEL, GUILayout.MinWidth(220f));
                newAutoGeneratePreference = EditorGUILayout.Toggle(autoGeneratePreference);
            }

            if (autoGeneratePreference != newAutoGeneratePreference)
            {
                CompilerOverrideTools.SetAutoGenerateCompilerOverrideFilePreference(newAutoGeneratePreference);
            }

            if (GUILayout.Button(REGENERATE_COMPILER_FILE_BUTTON))
            {
                CompilerOverrideTools.RegenerateCompilerOverrideFile();
            }
        }