blob: a7d18a231b74c2d7da22c37819e21e1a2da3219a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
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()
$"%Coords".text = str(ChunkLoader.v2_coords(self.transform.origin))
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
|