diff options
-rw-r--r-- | apps/gltf_viewer/src/main/assets/main.gd | 12 | ||||
-rw-r--r-- | apps/gltf_viewer/src/main/assets/project.godot | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/apps/gltf_viewer/src/main/assets/main.gd b/apps/gltf_viewer/src/main/assets/main.gd index 4b9bfdd..026ac5a 100644 --- a/apps/gltf_viewer/src/main/assets/main.gd +++ b/apps/gltf_viewer/src/main/assets/main.gd @@ -3,11 +3,11 @@ extends Node3D # Reference to the gltf model that's currently being shown. var current_gltf_node: Node3D = null -func _ready(): +func _ready() -> void: # Default asset to load when the app starts _load_gltf("res://gltfs/food_kit/turkey.glb") - var appPlugin = Engine.get_singleton("AppPlugin") + var appPlugin := Engine.get_singleton("AppPlugin") if appPlugin: print("App plugin is available") @@ -17,7 +17,7 @@ func _ready(): print("App plugin is not available") -func _process(delta): +func _process(_delta: float) -> void: if current_gltf_node == null: return @@ -25,7 +25,7 @@ func _process(delta): current_gltf_node.rotate_y(0.001) -func _unhandled_input(event): +func _unhandled_input(event: InputEvent) -> void: if current_gltf_node == null: return @@ -35,13 +35,13 @@ func _unhandled_input(event): if event is InputEventMouseMotion and event.button_mask == MOUSE_BUTTON_MASK_LEFT: # Rotate the gltf model based on swipe gestures - var relative_drag = event.relative + var relative_drag: Vector2 = event.relative current_gltf_node.rotate_y(relative_drag.x / 100) current_gltf_node.rotate_x(relative_drag.y / 100) # Load the gltf model specified by the given path -func _load_gltf(gltf_path: String): +func _load_gltf(gltf_path: String) -> void: if current_gltf_node != null: remove_child(current_gltf_node) diff --git a/apps/gltf_viewer/src/main/assets/project.godot b/apps/gltf_viewer/src/main/assets/project.godot index 8599945..fb80bae 100644 --- a/apps/gltf_viewer/src/main/assets/project.godot +++ b/apps/gltf_viewer/src/main/assets/project.godot @@ -18,6 +18,7 @@ config/icon="res://icon.svg" [debug] settings/stdout/verbose_stdout=true +gdscript/warnings/untyped_declaration=2 [display] |