示例#1
0
        public void OnPreprocessBuild(BuildReport report)
        {
            CustomSettingsEditorPackage <ResourcesAssetEditorSettingsData> settings = ResourcesAssetEditorSettings.Settings;

            if (settings.Exists() && settings.GetData().UpdateAllGroupsOnBuild)
            {
                ResourcesAssetEditorUtility.UpdateAssetGroupAll();
            }
        }
示例#2
0
        public static void StartUpdateAssetGroupAll()
        {
            int progressId = Progress.Start("Update All Resources Assets Group", string.Empty, Progress.Options.Indefinite);

            try
            {
                ResourcesAssetEditorUtility.UpdateAssetGroupAll();

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

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

                EditorGUILayout.PropertyField(m_propertyLoader);

                m_list.DrawGUILayout();
            }

            EditorGUILayout.Space();

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

                if (GUILayout.Button(m_styles.RefreshAllContent))
                {
                    ResourcesAssetEditorProgress.StartUpdateAssetGroupAll();
                }

                if (GUILayout.Button(m_styles.RefreshContent))
                {
                    ResourcesAssetEditorUtility.UpdateAssetGroupEntries((ResourcesAssetGroupAsset)target);
                    EditorUtility.SetDirty(target);
                }
            }

            EditorGUILayout.Space();

            if (ResourcesAssetEditorUtility.IsAssetGroupHasMissingEntries((ResourcesAssetGroupAsset)target))
            {
                EditorGUILayout.HelpBox(m_styles.MissingEntryMessage, MessageType.Warning);
            }
        }