You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
767 B
27 lines
767 B
1 month ago
|
@tool
|
||
|
extends EditorPlugin
|
||
|
|
||
|
const CONTAINER := CustomControlContainer.CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT
|
||
|
|
||
|
var controls_scene := preload("res://terrain/editing/TerrainEditingControls.tscn")
|
||
|
var controls_script := preload("res://terrain/editing/TerrainEditingControls.cs")
|
||
|
|
||
|
var controls : Control;
|
||
|
|
||
|
func _handles(object: Object) -> bool:
|
||
|
return object.get_script() == controls_script
|
||
|
|
||
|
func _enter_tree() -> void:
|
||
|
controls = controls_scene.instantiate()
|
||
|
|
||
|
func _exit_tree() -> void:
|
||
|
if controls.get_parent():
|
||
|
remove_control_from_container(CONTAINER, controls)
|
||
|
controls.free()
|
||
|
|
||
|
func _make_visible(visible: bool) -> void:
|
||
|
if visible:
|
||
|
add_control_to_container(CONTAINER, controls)
|
||
|
elif controls.get_parent():
|
||
|
remove_control_from_container(CONTAINER, controls)
|