From a968e514148f3b9be8c1bdff38fffe6972976df2 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Wed, 7 Dec 2022 16:11:39 +0100 Subject: C#: Renames to follow .NET naming conventions Renamed C# types and members to use PascalCase and follow .NET naming conventions. --- .../script_templates/CharacterBody2D/basic_movement.cs | 8 ++++---- .../script_templates/CharacterBody3D/basic_movement.cs | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'modules/mono/editor/script_templates') diff --git a/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs b/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs index fbad482cf6..87468fb433 100644 --- a/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs +++ b/modules/mono/editor/script_templates/CharacterBody2D/basic_movement.cs @@ -17,22 +17,22 @@ public partial class _CLASS_ : _BASE_ // Add the gravity. if (!IsOnFloor()) - velocity.y += gravity * (float)delta; + velocity.Y += gravity * (float)delta; // Handle Jump. if (Input.IsActionJustPressed("ui_accept") && IsOnFloor()) - velocity.y = JumpVelocity; + velocity.Y = JumpVelocity; // Get the input direction and handle the movement/deceleration. // As good practice, you should replace UI actions with custom gameplay actions. Vector2 direction = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down"); if (direction != Vector2.Zero) { - velocity.x = direction.x * Speed; + velocity.X = direction.X * Speed; } else { - velocity.x = Mathf.MoveToward(Velocity.x, 0, Speed); + velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed); } Velocity = velocity; diff --git a/modules/mono/editor/script_templates/CharacterBody3D/basic_movement.cs b/modules/mono/editor/script_templates/CharacterBody3D/basic_movement.cs index abed246a1e..ddeb9d7e00 100644 --- a/modules/mono/editor/script_templates/CharacterBody3D/basic_movement.cs +++ b/modules/mono/editor/script_templates/CharacterBody3D/basic_movement.cs @@ -17,25 +17,25 @@ public partial class _CLASS_ : _BASE_ // Add the gravity. if (!IsOnFloor()) - velocity.y -= gravity * (float)delta; + velocity.Y -= gravity * (float)delta; // Handle Jump. if (Input.IsActionJustPressed("ui_accept") && IsOnFloor()) - velocity.y = JumpVelocity; + velocity.Y = JumpVelocity; // 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"); - Vector3 direction = (Transform.basis * new Vector3(inputDir.x, 0, inputDir.y)).Normalized(); + Vector3 direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized(); if (direction != Vector3.Zero) { - velocity.x = direction.x * Speed; - velocity.z = direction.z * Speed; + velocity.X = direction.X * Speed; + velocity.Z = direction.Z * Speed; } else { - velocity.x = Mathf.MoveToward(Velocity.x, 0, Speed); - velocity.z = Mathf.MoveToward(Velocity.z, 0, Speed); + velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed); + velocity.Z = Mathf.MoveToward(Velocity.Z, 0, Speed); } Velocity = velocity; -- cgit v1.2.3