修改 EditorInterface 导致的打包运行问题: identifier "EditorInterface" not declared
This commit is contained in:
parent
56327d3913
commit
b0342ec8a8
@ -22,18 +22,3 @@ extends Resource
|
|||||||
# 你也可以直接在这里新建 Embellishment 资源,实现“特制wav”的需求。
|
# 你也可以直接在这里新建 Embellishment 资源,实现“特制wav”的需求。
|
||||||
@export var embellishments: Array[Embellishment]
|
@export var embellishments: Array[Embellishment]
|
||||||
|
|
||||||
|
|
||||||
# func _init() -> void:
|
|
||||||
# if not Engine.is_editor_hint():
|
|
||||||
# return
|
|
||||||
# var root = EditorInterface.get_edited_scene_root()
|
|
||||||
# if not root:
|
|
||||||
# return
|
|
||||||
# var ground = root.get_node_or_null("Ground") as Ground2D
|
|
||||||
# if not ground:
|
|
||||||
# return
|
|
||||||
# var scene_name = ground.scene_name
|
|
||||||
# # 检查 group_name 是否以 scene_name 开头
|
|
||||||
# if not group_name.begins_with(scene_name):
|
|
||||||
# group_name = scene_name + "_" + group_name
|
|
||||||
# print("VibeGroup: Auto-prefixed group_name to %s" % group_name)
|
|
||||||
|
@ -111,6 +111,7 @@ folder_colors={
|
|||||||
[global_group]
|
[global_group]
|
||||||
|
|
||||||
balloon=""
|
balloon=""
|
||||||
|
ground=""
|
||||||
|
|
||||||
[gui]
|
[gui]
|
||||||
|
|
||||||
|
@ -62,7 +62,11 @@ func _on_interacted():
|
|||||||
func _debug_check_player_pos():
|
func _debug_check_player_pos():
|
||||||
if not Engine.is_editor_hint():
|
if not Engine.is_editor_hint():
|
||||||
return
|
return
|
||||||
var ground = EditorInterface.get_edited_scene_root().get_node("Ground") as Ground2D
|
var grounds = get_tree().get_nodes_in_group("ground")
|
||||||
|
if not grounds:
|
||||||
|
printerr("no ground")
|
||||||
|
return
|
||||||
|
var ground = grounds[0]
|
||||||
if use_x_only:
|
if use_x_only:
|
||||||
ground.replace_player_to_portal = true
|
ground.replace_player_to_portal = true
|
||||||
var player = ground.player
|
var player = ground.player
|
||||||
|
@ -14,7 +14,7 @@ gradient = SubResource("Gradient_p7aaq")
|
|||||||
width = 15000
|
width = 15000
|
||||||
height = 500
|
height = 500
|
||||||
|
|
||||||
[node name="Ground" type="Node2D"]
|
[node name="Ground" type="Node2D" groups=["ground"]]
|
||||||
script = ExtResource("1_0vrlo")
|
script = ExtResource("1_0vrlo")
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
Loading…
Reference in New Issue
Block a user