clean some code
This commit is contained in:
parent
9e5e97dff6
commit
aa2a234bc9
2 changed files with 18 additions and 1 deletions
|
@ -81,7 +81,7 @@ func resetCast(bFull = false):
|
|||
CastResult.clear()
|
||||
hoveredObjects.clear()
|
||||
if bFull:
|
||||
if (hoveredObject and hoveredObject.has_method("on_unhover")):
|
||||
if (hoveredObject != null and hoveredObject.has_method("on_unhover")):
|
||||
hoveredObject.on_unhover()
|
||||
hoveredObject = null
|
||||
hoveredSticker = null
|
||||
|
|
|
@ -9,6 +9,7 @@ region = Rect2(384, 64, 288, 224)
|
|||
[sub_resource type="GDScript" id="GDScript_uqtu8"]
|
||||
script/source = "@tool
|
||||
extends Sprite2D
|
||||
var OutlineMat:ShaderMaterial = preload(\"res://shaders/shaderMaterial_Outline.tres\")
|
||||
|
||||
@export_group(\"Sticker Detection Shape\")
|
||||
@export var StickerShape :Shape2D:
|
||||
|
@ -44,6 +45,22 @@ extends Sprite2D
|
|||
$StaticBody2D/CollisionShape2D.rotation = CollisionRotation
|
||||
$StaticBody2D/CollisionShape2D.queue_redraw()
|
||||
|
||||
func on_released():
|
||||
print(self,\" released\")
|
||||
|
||||
func on_click():
|
||||
print(self,\" clicked\")
|
||||
|
||||
func on_hover():
|
||||
material = OutlineMat
|
||||
queue_redraw()
|
||||
|
||||
func on_unhover():
|
||||
material = null
|
||||
queue_redraw()
|
||||
|
||||
func on_grab(_offset:Vector2=Vector2(0.0,0.0)):
|
||||
pass
|
||||
"
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ep5ck"]
|
||||
|
|
Loading…
Reference in a new issue