private static EditorMenuSettings LoadSettings()
        {
            EditorMenuSettings settings = new EditorMenuSettings();

            string editorMenuSettingsFilePath = PackageUtility.ResolveDataPathAbsolute("@rotorz/unity3d-editor-menu", null, "EditorMenuSettings.json");

            if (File.Exists(editorMenuSettingsFilePath))
            {
                var jsonRaw = File.ReadAllText(editorMenuSettingsFilePath);
                var data    = JsonUtility.FromJson <JsonData>(jsonRaw);
                settings.FromSerializable(data);
            }

            return(settings);
        }
Esempio n. 2
0
        private static EditorMenuSettings LoadSettings()
        {
            EditorMenuSettings settings = null;

            string editorMenuSettingsFilePath = PackageUtility.ResolveDataPathAbsolute("@rotorz/unity3d-editor-menu", null, "EditorMenuSettings.json");

            if (File.Exists(editorMenuSettingsFilePath))
            {
                var jsonRaw = File.ReadAllText(editorMenuSettingsFilePath);
                settings = JsonUtility.ReadFrom(jsonRaw).ConvertTo <EditorMenuSettings>();
            }

            if (settings == null)
            {
                settings = new EditorMenuSettings();
            }

            return(settings);
        }