replace Referencer global with individual static instances
This commit is contained in:
@@ -123,7 +123,7 @@ func _update_visibility() -> void:
|
||||
|
||||
|
||||
func _unproject(pos: Vector3) -> Vector2:
|
||||
return Referencer.main_camera.unproject_position(pos)
|
||||
return MainCamera.instance.unproject_position(pos)
|
||||
|
||||
|
||||
func _update_controls_label() -> void:
|
||||
@@ -207,8 +207,8 @@ func _append_event(key: String, frame: int, args: Array[Variant]) -> void:
|
||||
|
||||
func _draw_vector(from: Vector3, to: Vector3, color: Color) -> void:
|
||||
if (
|
||||
not Referencer.main_camera.is_position_in_frustum(from)
|
||||
and not Referencer.main_camera.is_position_in_frustum(to)
|
||||
not MainCamera.instance.is_position_in_frustum(from)
|
||||
and not MainCamera.instance.is_position_in_frustum(to)
|
||||
):
|
||||
return
|
||||
|
||||
@@ -222,8 +222,8 @@ func _draw_vector(from: Vector3, to: Vector3, color: Color) -> void:
|
||||
|
||||
func _draw_line(from: Vector3, to: Vector3, color: Color) -> void:
|
||||
if (
|
||||
not Referencer.main_camera.is_position_in_frustum(from)
|
||||
and not Referencer.main_camera.is_position_in_frustum(to)
|
||||
not MainCamera.instance.is_position_in_frustum(from)
|
||||
and not MainCamera.instance.is_position_in_frustum(to)
|
||||
):
|
||||
return
|
||||
|
||||
@@ -247,7 +247,7 @@ func _draw_triangle(
|
||||
|
||||
|
||||
func _draw_marker(pos: Vector3, radius: float, color: Color) -> void:
|
||||
if not Referencer.main_camera.is_position_in_frustum(pos):
|
||||
if not MainCamera.instance.is_position_in_frustum(pos):
|
||||
return
|
||||
|
||||
var x_start := _unproject(pos + (Vector3.LEFT * radius))
|
||||
@@ -264,7 +264,7 @@ func _draw_marker(pos: Vector3, radius: float, color: Color) -> void:
|
||||
|
||||
|
||||
func _draw_circle(pos: Vector3, color: Color) -> void:
|
||||
if not Referencer.main_camera.is_position_in_frustum(pos):
|
||||
if not MainCamera.instance.is_position_in_frustum(pos):
|
||||
return
|
||||
|
||||
var point := _unproject(pos)
|
||||
@@ -306,7 +306,7 @@ func _on_control_draw() -> void:
|
||||
|
||||
_set_label_texts()
|
||||
|
||||
if !Referencer.main_camera or mode != Mode.FULL:
|
||||
if !MainCamera.instance or mode != Mode.FULL:
|
||||
return
|
||||
|
||||
for v: Dictionary in _vectors_to_draw.values():
|
||||
|
||||
Reference in New Issue
Block a user