public void OnPreprocessBuild(BuildReport report)
        {
            CustomSettingsEditorPackage <ManagerSceneEditorSettingsData> settings = ManagerSceneEditorSettings.Settings;

            if (settings.Exists() && settings.GetData().UpdateAllGroupsOnBuild)
            {
                ManagerSceneEditorUtility.UpdateSceneGroupAll();
                AssetDatabase.SaveAssets();
            }
        }
コード例 #2
0
        internal static void StartUpdateSceneGroupAll()
        {
            int progressId = Progress.Start("Update All Manager Scene Groups", string.Empty, Progress.Options.Indefinite);

            try
            {
                ManagerSceneEditorUtility.UpdateSceneGroupAll();

                Progress.Finish(progressId);
            }
            catch
            {
                Progress.Finish(progressId, Progress.Status.Failed);
                throw;
            }
            finally
            {
                AssetDatabase.SaveAssets();
            }
        }
        public override void OnInspectorGUI()
        {
            m_styles ??= new Styles();

            using (new SerializedObjectUpdateScope(serializedObject))
            {
                EditorIMGUIUtility.DrawScriptProperty(serializedObject);

                EditorGUILayout.PropertyField(m_propertyLoader);

                m_listScenes.DrawGUILayout();
            }

            EditorGUILayout.Space();

            using (new EditorGUILayout.HorizontalScope())
            {
                GUILayout.FlexibleSpace();

                if (GUILayout.Button(m_styles.RefreshAllContent))
                {
                    ManagerSceneEditorProgress.StartUpdateSceneGroupAll();
                }

                if (GUILayout.Button(m_styles.RefreshContent))
                {
                    ManagerSceneEditorUtility.UpdateSceneGroupEntries((ManagerSceneGroupAsset)target);
                    EditorUtility.SetDirty(target);
                }
            }

            EditorGUILayout.Space();

            if (ManagerSceneEditorUtility.IsSceneGroupHasMissingEntries((ManagerSceneGroupAsset)target))
            {
                EditorGUILayout.HelpBox(m_styles.MissingEntryMessage, MessageType.Warning);
            }
        }