浏览代码

Fix C# condition being `as` instead of `is` in Input examples (#4362)

Feniks 4 年之前
父节点
当前提交
f830197075
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tutorials/inputs/input_examples.rst

+ 1 - 1
tutorials/inputs/input_examples.rst

@@ -282,7 +282,7 @@ also counts as a button - two buttons, to be precise, with both
 
     public override void _Input(InputEvent inputEvent)
     {
-        if (inputEvent as InputEventMouseButton mouseEvent && mouseEvent.Pressed)
+        if (inputEvent is InputEventMouseButton mouseEvent && mouseEvent.Pressed)
         {
             switch ((ButtonList)mouseEvent.ButtonIndex)
             {