mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Fix C# examples in documentation
- Fix documentation after C# renames. - Add missing `partial` in C# class declarations. - Change `delta` parameter type to `double` in C#. - Ensure parameters match base declaration. - Use `$` string interpolation in C#. - Fix invalid or outdated C# code. - Changed some examples to follow our style guide more closely.
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
$LineEdit.text = str(result)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
public Expression expression = new Expression();
|
||||
private Expression _expression = new Expression();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -33,14 +33,14 @@
|
||||
|
||||
private void OnTextEntered(string command)
|
||||
{
|
||||
Error error = expression.Parse(command);
|
||||
Error error = _expression.Parse(command);
|
||||
if (error != Error.Ok)
|
||||
{
|
||||
GD.Print(expression.GetErrorText());
|
||||
GD.Print(_expression.GetErrorText());
|
||||
return;
|
||||
}
|
||||
object result = expression.Execute();
|
||||
if (!expression.HasExecuteFailed())
|
||||
Variant result = _expression.Execute();
|
||||
if (!_expression.HasExecuteFailed())
|
||||
{
|
||||
GetNode<LineEdit>("LineEdit").Text = result.ToString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user