reactions
This commit is contained in:
parent
2f559639fb
commit
5e20eeb8bf
74 changed files with 891 additions and 19 deletions
17
src/ui/reagent_drag_and_drop.gd
Normal file
17
src/ui/reagent_drag_and_drop.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends Button
|
||||
|
||||
|
||||
var reagent: Reagent
|
||||
|
||||
func _ready() -> void:
|
||||
text = reagent.substance.get_formula()
|
||||
|
||||
func _on_button_down() -> void:
|
||||
return
|
||||
var scene = reagent.scene.instantiate()
|
||||
if scene is DraggableObject:
|
||||
scene.dragged = true
|
||||
scene.mouse_in = true
|
||||
get_tree().current_scene.add_child(scene)
|
||||
var camera = get_viewport().get_camera_3d()
|
||||
scene.global_position = camera.project_position(get_global_mouse_position(),1.8)
|
||||
Loading…
Add table
Add a link
Reference in a new issue