mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-21 13:16:49 +01:00
Remove the nameplate if the entity gets controlled by the player and it wasn't before.
This commit is contained in:
parent
67b3ce48f5
commit
e6d21cbb8a
@ -111,6 +111,8 @@ var just_place : bool = false
|
|||||||
|
|
||||||
var contact : RayCast = null
|
var contact : RayCast = null
|
||||||
|
|
||||||
|
var _nameplate : Node = null
|
||||||
|
|
||||||
#var los : bool = false
|
#var los : bool = false
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@ -769,6 +771,9 @@ func on_c_controlled_changed(val):
|
|||||||
_controlled = val
|
_controlled = val
|
||||||
|
|
||||||
if val:
|
if val:
|
||||||
|
if _nameplate:
|
||||||
|
_nameplate.queue_free()
|
||||||
|
|
||||||
var cam_scene : PackedScene = ResourceLoader.load("res://player/camera/CameraPivot.tscn")
|
var cam_scene : PackedScene = ResourceLoader.load("res://player/camera/CameraPivot.tscn")
|
||||||
camera_pivot = cam_scene.instance() as Spatial
|
camera_pivot = cam_scene.instance() as Spatial
|
||||||
add_child(camera_pivot)
|
add_child(camera_pivot)
|
||||||
@ -791,8 +796,8 @@ func on_c_controlled_changed(val):
|
|||||||
set_process_input(false)
|
set_process_input(false)
|
||||||
set_process_unhandled_input(false)
|
set_process_unhandled_input(false)
|
||||||
var nameplatescn : PackedScene = ResourceLoader.load("res://ui/nameplates/NamePlate.tscn")
|
var nameplatescn : PackedScene = ResourceLoader.load("res://ui/nameplates/NamePlate.tscn")
|
||||||
var nameplate = nameplatescn.instance()
|
_nameplate = nameplatescn.instance()
|
||||||
add_child(nameplate)
|
add_child(_nameplate)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user