Work around parser regression in latest Godot 4 beta

This commit is contained in:
kayomn 2023-01-25 23:35:36 +00:00
parent 9636d23dd0
commit 7526e60037
1 changed files with 7 additions and 2 deletions

View File

@ -15,13 +15,13 @@ enum PaintSlot {
PAINT_3, PAINT_3,
} }
var _albedo_maps: Array[Texture2D] = [null, null, null, null] var _albedo_maps: Array[Texture2D] = []
var _material := ShaderMaterial.new() var _material := ShaderMaterial.new()
var _mesh := PlaneMesh.new() var _mesh := PlaneMesh.new()
var _normal_maps: Array[Texture2D] = [null, null, null, null] var _normal_maps: Array[Texture2D] = []
## ##
## Range of the height channel value, ranging from [code]0.0[/code] to [code]100.0[/code]. ## Range of the height channel value, ranging from [code]0.0[/code] to [code]100.0[/code].
@ -54,6 +54,11 @@ var size := Vector2i.ONE:
size = value size = value
func _init() -> void: func _init() -> void:
var paint_channels := PaintSlot.values().size()
_albedo_maps.resize(paint_channels)
_normal_maps.resize(paint_channels)
_material.shader = _SHADER _material.shader = _SHADER
_mesh.surface_set_material(0, _material) _mesh.surface_set_material(0, _material)