Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/update-csharp-docs' into update-…
Browse files Browse the repository at this point in the history
…csharp-docs
  • Loading branch information
ShawnHardern committed Aug 27, 2024
2 parents 97f42b0 + ffc4331 commit 3e555ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tutorials/io/runtime_file_loading_and_saving.rst
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ then adding it as a theme override to a :ref:`class_Label` node:

.. code-tab:: csharp

var path = "/path/to/font.ttf";
string path = "/Path/To/Font.ttf";
var fontFile = new FontFile();

if (
Expand All @@ -359,7 +359,7 @@ then adding it as a theme override to a :ref:`class_Label` node:
{
fontFile.LoadDynamicFont(path);
}
else if (path.EndsWith(".fnt") || path.EndsWith(".font"))
else if (path.EndsWith(".fnt", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".font", StringComparison.OrdinalIgnoreCase))
{
fontFile.LoadBitmapFont(path);
}
Expand Down
14 changes: 6 additions & 8 deletions tutorials/navigation/navigation_using_navigationagents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,7 @@ The following sections provides script templates for nodes commonly used with Na
return;
}


_movementDelta = _movementSpeed * (float)delta;
_movementDelta = MovementSpeed * (float)delta;
Vector2 nextPathPosition = _navigationAgent.GetNextPathPosition();
Vector2 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * _movementDelta;
if (_navigationAgent.AvoidanceEnabled)
Expand All @@ -383,7 +382,6 @@ The following sections provides script templates for nodes commonly used with Na
{
OnVelocityComputed(newVelocity);
}

}

private void OnVelocityComputed(Vector2 safeVelocity)
Expand Down Expand Up @@ -427,7 +425,7 @@ The following sections provides script templates for nodes commonly used with Na
}

Vector2 nextPathPosition = _navigationAgent.GetNextPathPosition();
Vector2 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * _movementSpeed;
Vector2 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * MovementSpeed;
if (_navigationAgent.AvoidanceEnabled)
{
_navigationAgent.Velocity = newVelocity;
Expand Down Expand Up @@ -480,7 +478,7 @@ The following sections provides script templates for nodes commonly used with Na
}

Vector2 nextPathPosition = _navigationAgent.GetNextPathPosition();
Vector2 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * _movementSpeed;
Vector2 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * MovementSpeed;
if (_navigationAgent.AvoidanceEnabled)
{
_navigationAgent.Velocity = newVelocity;
Expand Down Expand Up @@ -633,7 +631,7 @@ The following sections provides script templates for nodes commonly used with Na
return;
}

_movementDelta = _movementSpeed * (float)delta;
_movementDelta = MovementSpeed * (float)delta;
Vector3 nextPathPosition = _navigationAgent.GetNextPathPosition();
Vector3 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * _movementDelta;
if (_navigationAgent.AvoidanceEnabled)
Expand Down Expand Up @@ -687,7 +685,7 @@ The following sections provides script templates for nodes commonly used with Na
}

Vector3 nextPathPosition = _navigationAgent.GetNextPathPosition();
Vector3 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * _movementSpeed;
Vector3 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * MovementSpeed;
if (_navigationAgent.AvoidanceEnabled)
{
_navigationAgent.Velocity = newVelocity;
Expand Down Expand Up @@ -740,7 +738,7 @@ The following sections provides script templates for nodes commonly used with Na
}

Vector3 nextPathPosition = _navigationAgent.GetNextPathPosition();
Vector3 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * _movementSpeed;
Vector3 newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * MovementSpeed;
if (_navigationAgent.AvoidanceEnabled)
{
_navigationAgent.Velocity = newVelocity;
Expand Down
4 changes: 2 additions & 2 deletions tutorials/navigation/navigation_using_navigationobstacles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ For static use an array of ``vertices`` is required.
Rid defaultMapRid = GetWorld2D().NavigationMap;

NavigationServer2D.ObstacleSetMap(newObstacleRid, defaultMapRid);
NavigationServer2D.ObstacleSetPosition(newObstacleRid, globalPosition);
NavigationServer2D.ObstacleSetPosition(newObstacleRid, GlobalPosition);

// Use obstacle dynamic by increasing radius above zero.
NavigationServer2D.ObstacleSetRadius(newObstacleRid, 5.0f);
Expand Down Expand Up @@ -274,7 +274,7 @@ For static use an array of ``vertices`` is required.
Rid defaultMapRid = GetWorld3D().NavigationMap;

NavigationServer3D.ObstacleSetMap(newObstacleRid, defaultMapRid);
NavigationServer3D.ObstacleSetPosition(newObstacleRid, globalPosition);
NavigationServer3D.ObstacleSetPosition(newObstacleRid, GlobalPosition);

// Use obstacle dynamic by increasing radius above zero.
NavigationServer3D.ObstacleSetRadius(newObstacleRid, 5.0f);
Expand Down

0 comments on commit 3e555ae

Please sign in to comment.