parent
4da1da73ef
commit
cea26aea83
6 changed files with 67 additions and 3 deletions
@ -0,0 +1,27 @@ |
||||
[gd_scene format=3 uid="uid://bmljchm3fj42"] |
||||
|
||||
[node name="TerrainEditingControls" type="VBoxContainer"] |
||||
custom_minimum_size = Vector2(32, 0) |
||||
anchors_preset = 11 |
||||
anchor_left = 1.0 |
||||
anchor_right = 1.0 |
||||
anchor_bottom = 1.0 |
||||
offset_left = -20.0 |
||||
grow_horizontal = 0 |
||||
grow_vertical = 2 |
||||
|
||||
[node name="Button1" type="Button" parent="."] |
||||
layout_mode = 2 |
||||
text = "A" |
||||
|
||||
[node name="Button2" type="Button" parent="."] |
||||
layout_mode = 2 |
||||
text = "B" |
||||
|
||||
[node name="Button3" type="Button" parent="."] |
||||
layout_mode = 2 |
||||
text = "C" |
||||
|
||||
[node name="Button4" type="Button" parent="."] |
||||
layout_mode = 2 |
||||
text = "D" |
@ -0,0 +1,30 @@ |
||||
#if TOOLS |
||||
|
||||
[Tool] |
||||
public partial class TerrainEditingPlugin |
||||
: EditorPlugin |
||||
{ |
||||
Control controls; |
||||
public override void _EnterTree() |
||||
{ |
||||
var scene = GD.Load<PackedScene>("res://addons/terrain-editing/TerrainEditingControls.tscn"); |
||||
controls = scene.Instantiate<Control>(); |
||||
} |
||||
|
||||
public override void _ExitTree() |
||||
{ |
||||
controls.QueueFree(); |
||||
controls = null; |
||||
} |
||||
|
||||
public override bool _Handles(GodotObject obj) |
||||
=> obj is Terrain; |
||||
|
||||
public override void _MakeVisible(bool visible) |
||||
{ |
||||
var cont = CustomControlContainer.SpatialEditorSideRight; |
||||
if (visible) AddControlToContainer(cont, controls); |
||||
else RemoveControlFromContainer(cont, controls); |
||||
} |
||||
} |
||||
#endif |
@ -0,0 +1,7 @@ |
||||
[plugin] |
||||
|
||||
name="Terrain Editing" |
||||
description="" |
||||
author="copygirl" |
||||
version="1.0.0" |
||||
script="TerrainEditingPlugin.cs" |
Loading…
Reference in new issue