save code

This commit is contained in:
xsl
2025-11-15 17:17:27 +08:00
parent 33576ef233
commit 9975f69734
3 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ public partial class MyPlayer : CharacterBody3D
// Get the input direction and handle the movement/deceleration.
// As good practice, you should replace UI actions with custom gameplay actions.
Vector2 inputDir = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down");
Vector2 inputDir = Input.GetVector("left", "right", "forward", "backward");
Vector3 direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
if (direction != Vector3.Zero)
{
+6
View File
@@ -16,3 +16,9 @@ mesh = SubResource("CapsuleMesh_kak5s")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_kak5s")
[node name="Label3D" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 0)
billboard = 1
text = "我是3D 显示的文字"
font_size = 48
+6
View File
@@ -43,3 +43,9 @@ transform = Transform3D(40, 0, 0, 0, 0.5, 0, 0, 0, 40, 0, 0, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Environment/StaticBody3D"]
shape = SubResource("BoxShape3D_s4405")
[node name="Label" type="Label" parent="."]
offset_right = 400.0
offset_bottom = 150.0
theme_override_font_sizes/font_size = 32
text = "ASDF"