Add loading when load warcraft scene

This commit is contained in:
VAILLANT Jeremy
2021-05-09 17:10:40 +02:00
parent 275c0a080f
commit 78b566f5b8
4 changed files with 31 additions and 17 deletions
+10 -4
View File
@@ -1,9 +1,15 @@
extends Spatial
export (PackedScene) var main = load("res://scenes/main.tscn")
func _process(_delta):
# Event key "escape" and "godot event" ui_end
if Input.is_action_just_pressed("ui_end"):
_quit_to_menu()
func _notification(what):
# Back to main scene
# Notification for android back action
if what == MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST:
var scene = main.instance()
call_deferred("add_child", scene)
_quit_to_menu()
# Back to main scene
func _quit_to_menu():
Global.goto_scene("res://scenes/main.tscn")