Esempio n. 1
0
 public void     Save()
 {
     if (this.disabledTips.Count > 0)
     {
         NGEditorPrefs.SetString(key, string.Join(TipsHelper.Separator.ToString(), this.disabledTips.ToArray()));
     }
     else if (NGEditorPrefs.HasKey(key) == true)
     {
         NGEditorPrefs.DeleteKey(key);
     }
 }
Esempio n. 2
0
        public void     EraseAll(bool silent = false)
        {
            this.disabledTips.Clear();

            if (NGEditorPrefs.HasKey(key) == true)
            {
                NGEditorPrefs.DeleteKey(key);
            }

            if (silent == false)
            {
                EditorUtility.DisplayDialog(Constants.PackageTitle, "Tips have been reset.", "OK");
            }
        }
Esempio n. 3
0
        public override object  Fetch(object instance, Type type, string path)
        {
            if (NGEditorPrefs.HasKey(path) == true)
            {
                string assetPath = NGEditorPrefs.GetString(path, string.Empty);

                if (assetPath != string.Empty)
                {
                    if (assetPath == "Library/unity editor resources")
                    {
                        return(instance);
                    }
                    return(AssetDatabase.LoadAssetAtPath(assetPath, type) ?? instance);
                }

                return(null);
            }

            return(instance);
        }