1
Fork 0
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:
Steffo 2024-04-14 06:26:14 +02:00
parent 5b95544de5
commit 330bac8d0e
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
4 changed files with 25 additions and 8 deletions

19
behaviours/draggable.gd Normal file
View 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()

View 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")

View file

@ -1,2 +0,0 @@
extends Node
class_name Pickable

View file

@ -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")