Remove old scenes dev useless
This commit is contained in:
@@ -1,54 +0,0 @@
|
|||||||
extends Spatial
|
|
||||||
|
|
||||||
const time_max = 3000 # msec
|
|
||||||
|
|
||||||
onready var meshes = {
|
|
||||||
"dagger": {
|
|
||||||
"mesh": $dagger,
|
|
||||||
"value": 0.0,
|
|
||||||
"label": "Dagger",
|
|
||||||
"lock": false,
|
|
||||||
"tick_reference": null
|
|
||||||
},
|
|
||||||
"coin": {
|
|
||||||
"mesh": $coin,
|
|
||||||
"value": 0.0,
|
|
||||||
"label": "Coin",
|
|
||||||
"lock": false,
|
|
||||||
"tick_reference": null
|
|
||||||
},
|
|
||||||
"book": {
|
|
||||||
"mesh": $book,
|
|
||||||
"value": 0.0,
|
|
||||||
"label": "Book",
|
|
||||||
"lock": false,
|
|
||||||
"tick_reference": null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func _on_Dagger_Area_input_event(_camera, event, _click_position, _click_normal, _shape_idx):
|
|
||||||
_initialize_mesh_ref("dagger", event)
|
|
||||||
|
|
||||||
func _on_Coin_Area_input_event(_camera, event, _click_position, _click_normal, _shape_idx):
|
|
||||||
_initialize_mesh_ref("coin", event)
|
|
||||||
|
|
||||||
func _on_Book_Area_input_event(_camera, event, _click_position, _click_normal, _shape_idx):
|
|
||||||
_initialize_mesh_ref("book", event)
|
|
||||||
|
|
||||||
func _initialize_mesh_ref(meshInstance, event):
|
|
||||||
if meshes[meshInstance]["lock"] == false and (event is InputEventMouseButton or event is InputEventScreenTouch):
|
|
||||||
meshes[meshInstance]["lock"] = true
|
|
||||||
|
|
||||||
func _process(_delta):
|
|
||||||
for mesh in meshes:
|
|
||||||
if meshes[mesh]["lock"] == true and meshes[mesh]["mesh"] != null:
|
|
||||||
|
|
||||||
if meshes[mesh]["tick_reference"] == null:
|
|
||||||
meshes[mesh]["tick_reference"] = OS.get_ticks_msec()
|
|
||||||
|
|
||||||
if OS.get_ticks_msec() < meshes[mesh]["tick_reference"] + time_max:
|
|
||||||
meshes[mesh]["value"] += 0.01
|
|
||||||
meshes[mesh]["mesh"].get_surface_material(0).set("shader_param/dissolve_amount", meshes[mesh]["value"])
|
|
||||||
else:
|
|
||||||
meshes[mesh]["mesh"].call_deferred("free")
|
|
||||||
meshes[mesh]["mesh"] = null
|
|
||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user