Skip to content

Commit 089d35e

Browse files
authored
Merge pull request #11112 from Piralein/brackets
Add missing brackets in c# code
2 parents 8febb9a + cd3e94b commit 089d35e

File tree

8 files changed

+40
-0
lines changed

8 files changed

+40
-0
lines changed

tutorials/3d/using_transforms.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ Jump:
305305

306306
// Keep in mind Y is up-axis
307307
if (Input.IsActionJustPressed("jump"))
308+
{
308309
velocity.Y = JumpSpeed;
310+
}
309311

310312
MoveAndSlide();
311313

tutorials/best_practices/godot_notifications.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ delta time methods as needed.
166166
public void _Process(double delta)
167167
{
168168
if (Input.IsActionJustPressed("ui_select"))
169+
{
169170
GD.Print(delta);
171+
}
170172
}
171173

172174
// Called during every input event. Equally true for _input().
@@ -176,7 +178,9 @@ delta time methods as needed.
176178
{
177179
case InputEventKey:
178180
if (Input.IsActionJustPressed("ui_accept"))
181+
{
179182
GD.Print(GetProcessDeltaTime());
183+
}
180184
break;
181185
}
182186
}

tutorials/inputs/handling_quit_requests.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Handling the notification is done as follows (on any node):
3232
public override void _Notification(int what)
3333
{
3434
if (what == NotificationWMCloseRequest)
35+
{
3536
GetTree().Quit(); // default behavior
37+
}
3638
}
3739

3840
It is important to note that by default, Godot apps have the built-in

tutorials/inputs/inputevent.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ Here is a quick example, closing your game if the escape key is hit:
2727
public override void _UnhandledInput(InputEvent @event)
2828
{
2929
if (@event is InputEventKey eventKey)
30+
{
3031
if (eventKey.Pressed && eventKey.Keycode == Key.Escape)
32+
{
3133
GetTree().Quit();
34+
}
35+
}
3236
}
3337

3438
However, it is cleaner and more flexible to use the provided :ref:`InputMap <class_InputMap>` feature,

tutorials/physics/physics_introduction.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,23 @@ For example, here is the code for an "Asteroids" style spaceship:
316316
public override void _IntegrateForces(PhysicsDirectBodyState2D state)
317317
{
318318
if (Input.IsActionPressed("ui_up"))
319+
{
319320
state.ApplyForce(_thrust.Rotated(Rotation));
321+
}
320322
else
323+
{
321324
state.ApplyForce(new Vector2());
325+
}
322326

323327
var rotationDir = 0;
324328
if (Input.IsActionPressed("ui_right"))
329+
{
325330
rotationDir += 1;
331+
}
326332
if (Input.IsActionPressed("ui_left"))
333+
{
327334
rotationDir -= 1;
335+
}
328336
state.ApplyTorque(rotationDir * _torque);
329337
}
330338
}
@@ -441,7 +449,9 @@ Or to bounce off of the colliding object:
441449
{
442450
var collisionInfo = MoveAndCollide(_velocity * (float)delta);
443451
if (collisionInfo != null)
452+
{
444453
_velocity = _velocity.Bounce(collisionInfo.GetNormal());
454+
}
445455
}
446456
}
447457

@@ -510,11 +520,17 @@ the ground (including slopes) and jump when standing on the ground:
510520
var jump = Input.IsActionPressed("ui_select");
511521

512522
if (IsOnFloor() && jump)
523+
{
513524
velocity.Y = _jumpSpeed;
525+
}
514526
if (right)
527+
{
515528
velocity.X += _runSpeed;
529+
}
516530
if (left)
531+
{
517532
velocity.X -= _runSpeed;
533+
}
518534

519535
Velocity = velocity;
520536
}

tutorials/physics/ray-casting.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ be empty. If it did hit something, it will contain collision information:
134134
.. code-tab:: csharp
135135

136136
if (result.Count > 0)
137+
{
137138
GD.Print("Hit at point: ", result["position"]);
139+
}
138140

139141
The ``result`` dictionary when a collision occurs contains the following
140142
data:

tutorials/physics/using_character_body_2d.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ Here's the code for the player body:
508508

509509
// Handle jump.
510510
if (Input.IsActionJustPressed("jump") && IsOnFloor())
511+
{
511512
velocity.Y = _jumpSpeed;
513+
}
512514

513515
// Get the input direction.
514516
float direction = Input.GetAxis("ui_left", "ui_right");

tutorials/xr/a_better_xr_start_script.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,13 @@ it is nicer to exit on failure than to hang the system.
170170

171171
// Enable VRS
172172
if (RenderingServer.GetRenderingDevice() != null)
173+
{
173174
vp.VrsMode = Viewport.VrsModeEnum.XR;
175+
}
174176
else if ((int)ProjectSettings.GetSetting("xr/openxr/foveation_level") == 0)
177+
{
175178
GD.PushWarning("OpenXR: Recommend setting Foveation level to High in Project Settings");
179+
}
176180

177181
// Connect the OpenXR events
178182
_xrInterface.SessionBegun += OnOpenXRSessionBegun;
@@ -276,8 +280,12 @@ Not matching the physics update rate will cause stuttering as frames are rendere
276280
{
277281
GD.Print("OpenXR: Available refresh rates: ", availableRates);
278282
foreach (float rate in availableRates)
283+
{
279284
if (rate > newRate && rate <= MaximumRefreshRate)
285+
{
280286
newRate = rate;
287+
}
288+
}
281289
}
282290

283291
// Did we find a better rate?

0 commit comments

Comments
 (0)