Editor Terrain Size Options #1

Merged
kayomn merged 12 commits from editor-terrain-size-options into main 2023-01-12 02:36:57 +01:00
2 changed files with 4 additions and 6 deletions
Showing only changes of commit c061864c37 - Show all commits

BIN
editor.scn (Stored with Git LFS)

Binary file not shown.

View File

@ -1,8 +1,6 @@
@tool @tool
class_name TerrainInstance3D extends GeometryInstance3D class_name TerrainInstance3D extends GeometryInstance3D
const _TERRAIN_MAX := 1024
var _mesh := PlaneMesh.new() var _mesh := PlaneMesh.new()
var _material := ShaderMaterial.new() var _material := ShaderMaterial.new()
@ -16,8 +14,8 @@ var size: Vector2i = Vector2i.ZERO:
return size return size
set(value): set(value):
var width := clampi(value.x, 0, _TERRAIN_MAX) var width := maxi(value.x, 0)
var height := clampi(value.y, 0, _TERRAIN_MAX) var height := maxi(value.y, 0)
if (width != size.x) or (height != size.y): if (width != size.x) or (height != size.y):
if (width == 0) and (height == 0): if (width == 0) and (height == 0):