mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 06:09:46 +03:00
SceneMainLoop -> SceneTree
-=-=-=-=-=-=-=-=-=-=-=-=-=- *YOUR SOURCE MIGHT NOT WORK* For mor information on fix: https://github.com/okamstudio/godot/wiki/devel_scene_tree Other stuff: -Shower of bullets demo -Fixes all around
This commit is contained in:
@@ -12,12 +12,12 @@ func goto_scene(scene):
|
||||
#instance the new scene
|
||||
current_scene = s.instance()
|
||||
#add it to the active scene, as child of root
|
||||
get_scene().get_root().add_child(current_scene)
|
||||
get_tree().get_root().add_child(current_scene)
|
||||
|
||||
|
||||
func _ready():
|
||||
# get the current scene
|
||||
# it is always the last child of root,
|
||||
# after the autoloaded nodes
|
||||
var root = get_scene().get_root()
|
||||
var root = get_tree().get_root()
|
||||
current_scene = root.get_child( root.get_child_count() -1 )
|
||||
|
||||
@@ -5,11 +5,11 @@ extends Spatial
|
||||
func _on_pause_pressed():
|
||||
get_node("pause_popup").set_exclusive(true)
|
||||
get_node("pause_popup").popup()
|
||||
get_scene().set_pause(true)
|
||||
get_tree().set_pause(true)
|
||||
|
||||
|
||||
func _on_unpause_pressed():
|
||||
get_node("pause_popup").hide()
|
||||
get_scene().set_pause(false)
|
||||
get_tree().set_pause(false)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user