From c7d45ec085086ab86192a7890b9622320d57b89d Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 3 Jun 2016 10:30:38 -0300 Subject: Removed demos they go to their own project now --- demos/misc/autoload/engine.cfg | 8 -------- demos/misc/autoload/global.gd | 36 ------------------------------------ demos/misc/autoload/scene_a.gd | 5 ----- demos/misc/autoload/scene_a.scn | Bin 1660 -> 0 bytes demos/misc/autoload/scene_b.gd | 5 ----- demos/misc/autoload/scene_b.scn | Bin 1639 -> 0 bytes 6 files changed, 54 deletions(-) delete mode 100644 demos/misc/autoload/engine.cfg delete mode 100644 demos/misc/autoload/global.gd delete mode 100644 demos/misc/autoload/scene_a.gd delete mode 100644 demos/misc/autoload/scene_a.scn delete mode 100644 demos/misc/autoload/scene_b.gd delete mode 100644 demos/misc/autoload/scene_b.scn (limited to 'demos/misc/autoload') diff --git a/demos/misc/autoload/engine.cfg b/demos/misc/autoload/engine.cfg deleted file mode 100644 index c6ad023013..0000000000 --- a/demos/misc/autoload/engine.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[application] - -name="Autoload (Singletons)" -main_scene="res://scene_a.scn" - -[autoload] - -global="res://global.gd" diff --git a/demos/misc/autoload/global.gd b/demos/misc/autoload/global.gd deleted file mode 100644 index 735995e806..0000000000 --- a/demos/misc/autoload/global.gd +++ /dev/null @@ -1,36 +0,0 @@ -extends Node - - -# Changing scenes is most easily done using the functions `change_scene` -# and `change_scene_to` of the SceneTree. This script demonstrates how to -# change scenes without those helpers. - - -func goto_scene(path): - # This function will usually be called from a signal callback, - # or some other function from the running scene. - # Deleting the current scene at this point might be - # a bad idea, because it may be inside of a callback or function of it. - # The worst case will be a crash or unexpected behavior. - - # The way around this is deferring the load to a later time, when - # it is ensured that no code from the current scene is running: - - call_deferred("_deferred_goto_scene",path) - - -func _deferred_goto_scene(path): - # Immediately free the current scene, there is no risk here. - get_tree().get_current_scene().free() - - # Load new scene - var packed_scene = ResourceLoader.load(path) - - # Instance the new scene - var instanced_scene = packed_scene.instance() - - # Add it to the scene tree, as direct child of root - get_tree().get_root().add_child(instanced_scene) - - # Set it as the current scene, only after it has been added to the tree - get_tree().set_current_scene(instanced_scene) diff --git a/demos/misc/autoload/scene_a.gd b/demos/misc/autoload/scene_a.gd deleted file mode 100644 index 03da86d9a0..0000000000 --- a/demos/misc/autoload/scene_a.gd +++ /dev/null @@ -1,5 +0,0 @@ -extends Panel - - -func _on_goto_scene_pressed(): - get_node("/root/global").goto_scene("res://scene_b.scn") diff --git a/demos/misc/autoload/scene_a.scn b/demos/misc/autoload/scene_a.scn deleted file mode 100644 index eff314e29d..0000000000 Binary files a/demos/misc/autoload/scene_a.scn and /dev/null differ diff --git a/demos/misc/autoload/scene_b.gd b/demos/misc/autoload/scene_b.gd deleted file mode 100644 index dea8c4623f..0000000000 --- a/demos/misc/autoload/scene_b.gd +++ /dev/null @@ -1,5 +0,0 @@ -extends Panel - - -func _on_goto_scene_pressed(): - get_node("/root/global").goto_scene("res://scene_a.scn") diff --git a/demos/misc/autoload/scene_b.scn b/demos/misc/autoload/scene_b.scn deleted file mode 100644 index 4cdb03e90e..0000000000 Binary files a/demos/misc/autoload/scene_b.scn and /dev/null differ -- cgit v1.2.3