A game where you get to play as a slime, made with Godot.
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.
 
 

25 lines
787 B

@tool
extends EditorPlugin
const CONTAINER := CustomControlContainer.CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT
var controls: Control = null;
func _handles(object: Object) -> bool:
var script := object.get_script() as CSharpScript
return script and script.resource_path.ends_with("/Terrain.cs")
func _exit_tree() -> void:
if not controls: return
if controls.get_parent():
remove_control_from_container(CONTAINER, controls)
controls.free()
func _make_visible(visible: bool) -> void:
if visible:
if not controls:
var controls_scene = load("res://terrain/editing/TerrainEditingControls.tscn")
controls = controls_scene.instantiate()
add_control_to_container(CONTAINER, controls)
elif controls and controls.get_parent():
remove_control_from_container(CONTAINER, controls)