コード例 #1
0
ファイル: HQ.cs プロジェクト: Hengle/clapotis
        internal static void    LoadSharedNGSetting(bool skipLoad = false)
        {
            if (skipLoad == false && NGSettings.sharedSettings != null)
            {
                HQ.SetSettings(NGSettings.sharedSettings);
                return;
            }

            NGSettings asset = null;

            if (skipLoad == false)
            {
                asset = NGSettings.LoadSharedSettings();
                if (asset != null)
                {
                    asset.hideFlags = HideFlags.DontSave;
                }
            }

            if (skipLoad == true || asset == null)
            {
                asset           = NGSettings.CreateSharedSettings();
                asset.hideFlags = HideFlags.DontSave;

                Directory.CreateDirectory(Path.GetDirectoryName(NGSettings.GetSharedSettingsPath()));
                HQ.SaveSharedNGSettings(asset);
            }
            else
            {
                NGSettings.sharedSettings = asset;
            }

            HQ.SetSettings(asset);
        }
コード例 #2
0
ファイル: HQ.cs プロジェクト: Hengle/clapotis
        public static void              InvalidateSettings(NGSettings settings = null, bool directSave = false)
        {
            if (settings == null)
            {
                settings = HQ.settings;
            }

            if ((settings.hideFlags & HideFlags.DontSave) == HideFlags.DontSave)
            {
                HQ.SaveSharedNGSettings(settings, directSave);
            }
            else
            {
                EditorUtility.SetDirty(settings);
            }
        }