a bit of restructuring, renaming, and c sharp setup

This commit is contained in:
2025-03-24 21:55:34 +01:00
parent e0b5a26ee6
commit 4f312209b3
461 changed files with 1397 additions and 349 deletions
+22
View File
@@ -0,0 +1,22 @@
extends Node3D
@export var canPitch: bool = false
@export var canYaw: bool = false
@export var rotateSpeed: float = 0.003
@onready var sub_pivot: Node3D = $SubPivot
func _ready() -> void:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
func _input(event):
if event.is_action_pressed("click"):
if Input.mouse_mode == Input.MOUSE_MODE_VISIBLE:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
if event.is_action_pressed("ui_cancel"):
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
if event is InputEventMouseMotion:
if Input.mouse_mode != Input.MOUSE_MODE_CAPTURED: return
if canYaw: sub_pivot.rotate_x(event.relative.y * -rotateSpeed)
if canPitch: rotate_y(event.relative.x * -rotateSpeed)