void OnGUI()
        {
            if (_optionNames == null)
            {
                _optionNames = Enum.GetNames(typeof(Options));
            }

            _settings.Filename = EditorGUILayout.TextField("Target file", _settings.Filename).Trim();
            if (string.IsNullOrEmpty(_settings.Filename))
            {
                _settings.Filename = DefaultFilename;
            }
            _settings.Namespace = EditorGUILayout.TextField("Namespace", _settings.Namespace).Trim();
            if (string.IsNullOrEmpty(_settings.Namespace))
            {
                _settings.Namespace = DefaultNamespace;
            }
            _settings.Options = (Options)EditorGUILayout.MaskField("Options", (int)_settings.Options, _optionNames);

            _settings.IgnoredPaths = EditorGUILayout.TextField("Ignore assets at paths", _settings.IgnoredPaths).Trim();

            if (GUILayout.Button("Reset settings"))
            {
                ProjectPrefs.DeleteKey(SettingsKey);
                OnEnable();
                Repaint();
            }
            if (GUILayout.Button("Save settings & generate"))
            {
                ProjectPrefs.SetString(SettingsKey, Singleton.Get <JsonSerialization> ().Serialize(_settings));
                var res = Generate(_settings);
                EditorUtility.DisplayDialog(titleContent.text, res ?? "Success", "Close");
            }
        }
Exemple #2
0
 void Save()
 {
     if (_paths != null)
     {
         ProjectPrefs.SetString(ProjectPrefsKey, JsonSerialization.SerializeStatic(_paths));
     }
 }
Exemple #3
0
        protected override void Save()
        {
            currentScene = SceneManager.GetActiveScene();

            UpdatePinnedObjectIds();

            ProjectPrefs.SetString(PinnedPrefsKey, string.Join(",", pinnedObjectIds.Select(x => x.ToString()).ToArray()));
        }
Exemple #4
0
        protected override void Save()
        {
            var pinnedObjectGUIDs = pinnedObject
                                    .Where(x => x != null)
                                    .Select(x => AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(x)))
                                    .ToArray();

            ProjectPrefs.SetString(PinnedPrefsKey, string.Join(",", pinnedObjectGUIDs));
        }
Exemple #5
0
 void Save()
 {
     if (_paths != null && _paths.Count > 0)
     {
         ProjectPrefs.SetString(ProjectPrefsKey, Singleton.Get <JsonSerialization> ().Serialize(_paths));
     }
     else
     {
         ProjectPrefs.DeleteKey(ProjectPrefsKey);
     }
 }
 void Save()
 {
     if (_items != null && _items.Count > 0)
     {
         ProjectPrefs.SetString(ProjectPrefsKey, Service <JsonSerialization> .Get().Serialize(_items));
     }
     else
     {
         ProjectPrefs.DeleteKey(ProjectPrefsKey);
     }
 }
 void Save()
 {
     if (_items != null && _items.Count > 0)
     {
         ProjectPrefs.SetString(ProjectPrefsKey, _serializer.Serialize(_items));
     }
     else
     {
         ProjectPrefs.DeleteKey(ProjectPrefsKey);
     }
 }
 static void SaveInfo()
 {
     if (_allDescs.Count > 0)
     {
         try {
             ProjectPrefs.SetString(StorageKey, JsonSerialization.SerializeStatic(_allDescs));
         } catch {
         }
     }
     else
     {
         ProjectPrefs.DeleteKey(StorageKey);
     }
 }
Exemple #9
0
 static void SaveInfo()
 {
     if (_allDescs.Count > 0)
     {
         try {
             ProjectPrefs.SetString(StorageKey, Service <JsonSerialization> .Get().Serialize(_allDescs));
         } catch (Exception ex) {
             Debug.LogWarning("FolderIconEditor.SaveInfo: " + ex.Message);
         }
     }
     else
     {
         ProjectPrefs.DeleteKey(StorageKey);
     }
 }
        void OnGUI()
        {
            GUILayout.Label("AssetBundles Settings", EditorStyles.boldLabel);

            GUILayout.BeginHorizontal(GUI.skin.box);
            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            _settings.Path = EditorGUILayout.TextField("Output Path:", _settings.Path).Trim();
            if (string.IsNullOrEmpty(_settings.Path))
            {
                _settings.Path = DefaultPath;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Options:", EditorStyles.label, GUILayout.Width(EditorGUIUtility.labelWidth));
            _settings.Options = (BuildAssetBundleOptions)EditorGUILayout.EnumPopup(DefaultOptions);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Platform:", EditorStyles.label, GUILayout.Width(EditorGUIUtility.labelWidth));
            _settings.Target = (BuildTarget)EditorGUILayout.EnumPopup(DefaultTarget);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.EndHorizontal();

            GUILayout.Space(10f);

            EditorGUILayout.HelpBox("Note: if you will load bundle directly from disk – choose option \"UncompressedAssetBundle\", to pack bundle and download from remote source – choose \"None\".", MessageType.Info, true);

            GUILayout.Space(10f);

            EditorGUILayout.Separator();
            if (GUILayout.Button("Save settings & build", GUILayout.Height(50f)))
            {
                ProjectPrefs.SetString(SettingsKey, Service <JsonSerialization> .Get().Serialize(_settings));
                var res = Generate(_settings);
                EditorUtility.DisplayDialog(titleContent.text, res ?? "Success", "Close");
                if (string.IsNullOrEmpty(res))
                {
                    EditorUtility.RevealInFinder(_settings.Path);
                }
            }
        }
        // ReSharper disable once InconsistentNaming
        void OnGUI()
        {
            if (_optionNames == null)
            {
                _optionNames = Enum.GetNames(typeof(Options));
            }

            _fileName = EditorGUILayout.TextField("Target file", _fileName).Trim();
            if (string.IsNullOrEmpty(_fileName))
            {
                _fileName = DefaultFileName;
            }
            _nsName = EditorGUILayout.TextField("Namespace", _nsName).Trim();
            if (string.IsNullOrEmpty(_nsName))
            {
                _nsName = DefaultNamespace;
            }
            _options = (Options)EditorGUILayout.MaskField("Options", (int)_options, _optionNames);

            if (GUILayout.Button("Reset settings"))
            {
                ProjectPrefs.DeleteKey(TargetFileKey);
                ProjectPrefs.DeleteKey(NamespaceKey);
                ProjectPrefs.DeleteKey(OptionsKey);
                OnEnable();
                Repaint();
            }
            if (GUILayout.Button("Save settings & generate"))
            {
                ProjectPrefs.SetString(TargetFileKey, _fileName);
                ProjectPrefs.SetString(NamespaceKey, _nsName);
                ProjectPrefs.SetInt(OptionsKey, (int)_options);
                var res = Generate(_fileName, _nsName, _options);
                EditorUtility.DisplayDialog(titleContent.text, res ?? "Success", "Close");
            }
        }