Skip to content

Instantly share code, notes, and snippets.

@Gnumaru
Created November 5, 2023 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gnumaru/14ce3a70b3b396c559dcefb0a402b5e2 to your computer and use it in GitHub Desktop.
Save Gnumaru/14ce3a70b3b396c559dcefb0a402b5e2 to your computer and use it in GitHub Desktop.
class_name Utils
static func file_exists_(prespath:String, pforceexactmatch:bool=false)->bool:
if prespath.begins_with('res://') and not pforceexactmatch:
return FileAccess.file_exists(prespath) or FileAccess.file_exists(prespath+'.remap') or FileAccess.file_exists(prespath+'.import')
else:
return FileAccess.file_exists(prespath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment