Add method for quit war scene and back to main

This commit is contained in:
VAILLANT Jeremy
2021-05-08 20:38:16 +02:00
parent ec277ff2c0
commit 54833d8f78
3 changed files with 15 additions and 3 deletions
+9
View File
@@ -0,0 +1,9 @@
extends Spatial
export (PackedScene) var main = load("res://scenes/main.tscn")
func _notification(what):
# Back to main scene
if what == MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST:
var scene = main.instance()
call_deferred("add_child", scene)
+3 -1
View File
@@ -1,10 +1,11 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=9 format=2]
[ext_resource path="res://assets/props/rock floor/rock floor.gltf" type="PackedScene" id=1]
[ext_resource path="res://assets/props/table/table.gltf" type="PackedScene" id=2]
[ext_resource path="res://assets/props/stool b/stool b.gltf" type="PackedScene" id=3]
[ext_resource path="res://assets/hdri/tx_night_place.hdr" type="Texture" id=4]
[ext_resource path="res://assets/props/book/book.gltf" type="PackedScene" id=5]
[ext_resource path="res://scenes/levels/WarCraft.gd" type="Script" id=6]
[sub_resource type="PanoramaSky" id=1]
panorama = ExtResource( 4 )
@@ -15,6 +16,7 @@ background_sky = SubResource( 1 )
ambient_light_color = Color( 0.266667, 0.14902, 0.0627451, 1 )
[node name="Warcraft" type="Spatial"]
script = ExtResource( 6 )
[node name="rock floor" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 2.253 )