mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-25 01:24:23 +00:00
Rename Pickable
to Draggable
and add the drag
and drop
methods
This commit is contained in:
parent
5b95544de5
commit
330bac8d0e
4 changed files with 25 additions and 8 deletions
19
behaviours/draggable.gd
Normal file
19
behaviours/draggable.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Node
|
||||
class_name Draggable
|
||||
|
||||
|
||||
signal dragged
|
||||
signal dropped
|
||||
|
||||
|
||||
var being_dragged: bool = false
|
||||
|
||||
|
||||
func drag():
|
||||
being_dragged = true
|
||||
dragged.emit()
|
||||
|
||||
|
||||
func drop():
|
||||
being_dragged = false
|
||||
dropped.emit()
|
6
behaviours/draggable.tscn
Normal file
6
behaviours/draggable.tscn
Normal file
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://dijcjahkddudv"]
|
||||
|
||||
[ext_resource type="Script" path="res://behaviours/draggable.gd" id="1_hdedq"]
|
||||
|
||||
[node name="Draggable" type="Node"]
|
||||
script = ExtResource("1_hdedq")
|
|
@ -1,2 +0,0 @@
|
|||
extends Node
|
||||
class_name Pickable
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://dijcjahkddudv"]
|
||||
|
||||
[ext_resource type="Script" path="res://behaviours/pickable.gd" id="1_ymn8e"]
|
||||
|
||||
[node name="Pickable" type="Node"]
|
||||
script = ExtResource("1_ymn8e")
|
Loading…
Reference in a new issue