Skip to content

Commit

Permalink
Add clear() to Director
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDarigan committed Dec 19, 2021
1 parent 7ecb49c commit f04cdc4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/WAT/double/factory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const ScriptDirector = preload("script_director.gd")
const SceneDirector = preload("scene_director.gd")
var registry

func clear() -> void:
# Allow users to clear registry in the post hook if they want fresh values between runs
registry.clear()
for director in registry.test_directors.values() :
director.free()
registry.test_directors.clear()

func script(path, inner: String = "", deps: Array = []) -> ScriptDirector:
if path is GDScript: path = path.resource_path
Expand Down

0 comments on commit f04cdc4

Please sign in to comment.