浏览代码

Update C# Connect method: `binds` is a Godot array (#4777)

(cherry picked from commit 6e96d8d2629a4938ee391a325606a1d0eb51dbb9)
31 4 年之前
父节点
当前提交
c8dccbeee5
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      getting_started/scripting/c_sharp/c_sharp_features.rst

+ 3 - 3
getting_started/scripting/c_sharp/c_sharp_features.rst

@@ -128,7 +128,7 @@ Emitting signals is done with the ``EmitSignal`` method.
 
 
 Notice that you can always reference a signal name with the ``nameof`` keyword (applied on the delegate itself).
 Notice that you can always reference a signal name with the ``nameof`` keyword (applied on the delegate itself).
 
 
-It is possible to bind values when establishing a connection by passing an object array.
+It is possible to bind values when establishing a connection by passing a Godot array.
 
 
 .. code-block:: csharp
 .. code-block:: csharp
 
 
@@ -144,8 +144,8 @@ It is possible to bind values when establishing a connection by passing an objec
         var plusButton = (Button)GetNode("PlusButton");
         var plusButton = (Button)GetNode("PlusButton");
         var minusButton = (Button)GetNode("MinusButton");
         var minusButton = (Button)GetNode("MinusButton");
 
 
-        plusButton.Connect("pressed", this, "ModifyValue", new object[] { 1 });
-        minusButton.Connect("pressed", this, "ModifyValue", new object[] { -1 });
+        plusButton.Connect("pressed", this, "ModifyValue", new Godot.Collections.Array { 1 });
+        minusButton.Connect("pressed", this, "ModifyValue", new Godot.Collections.Array { -1 });
     }
     }
 
 
 Signals support parameters and bound values of all the `built-in types <https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/built-in-types-table>`_ and Classes derived from :ref:`Godot.Object <class_Object>`.
 Signals support parameters and bound values of all the `built-in types <https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/built-in-types-table>`_ and Classes derived from :ref:`Godot.Object <class_Object>`.