summaryrefslogblamecommitdiffstats
path: root/world/chunk/Chunk.gd
blob: 4356caf4c1659125dfd67ee1fe532f2ab5f8bf14 (plain) (tree)
1
2
3
4
5




                             








                                                          
                  
















                                                          
extends Area

enum LOD {DISTANCE,MID,CLOSE}
var lod = -1

onready var lod_distance = $"gen_tree/lod_distance"
onready var lod_mid = $"gen_tree/lod_mid"
onready var lod_close = $"gen_tree/lod_close"

onready var _collision_enabled = lod_close.collision_layer

func _ready():
    lod_update()

func lod_update():
    match lod:
        LOD.CLOSE:
            lod_distance.visible = false
            lod_mid.visible = true
            lod_close.collision_layer = _collision_enabled
        LOD.MID:
            lod_distance.visible = false
            lod_mid.visible = true
            lod_close.collision_layer = 0
        LOD.DISTANCE:
            lod_distance.visible = true
            lod_mid.visible = false
            lod_close.collision_layer = 0
        _:
            lod_distance.visible = true
            lod_mid.visible = false
            lod_close.collision_layer = 0