Editor Terrain Size Options #1
BIN
editor.scn (Stored with Git LFS)
BIN
editor.scn (Stored with Git LFS)
Binary file not shown.
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue