Commit of existing data.
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
@tool
|
||||
class_name Config
|
||||
extends Resource
|
||||
|
||||
|
||||
@export var music_volume: float = 0
|
||||
@export var sfx_volume: float = 0
|
||||
@export var fullscreen: bool = false
|
||||
@export var vsync: bool = true
|
||||
|
||||
|
||||
func save() -> Error:
|
||||
return ResourceSaver.save(self, "user://config.tres")
|
||||
|
||||
|
||||
static func exists() -> bool:
|
||||
return ResourceLoader.exists("user://config.tres")
|
||||
|
||||
|
||||
static func load() -> Save:
|
||||
if exists():
|
||||
var config_data = ResourceLoader.load("user://config.tres")
|
||||
if config_data is Config:
|
||||
return config_data
|
||||
return null
|
||||
Reference in New Issue
Block a user