Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var loaded_json_file
- #When loading the .json file.
- func load_json(path_string):
- var dir = Directory.new()
- if dir.file_exists(path_string) == true:
- var file = File.new()
- file.open(path_string, File.READ)
- loaded_json_file = JSON.parse(file.get_as_text()).result
- file.close()
- #When saving the .json file, passing the .json files full path.
- func save_json(path_string):
- var file.new()
- file.open(path_string)
- file.store_line(to_json(loaded_json_file))
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement