浏览代码

Update tutorials/scripting/instancing_with_signals.rst

Co-authored-by: Paul Joannon <[email protected]>
Raul Santos 2 年之前
父节点
当前提交
d9e888744e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tutorials/scripting/instancing_with_signals.rst

+ 1 - 1
tutorials/scripting/instancing_with_signals.rst

@@ -149,7 +149,7 @@ In the main scene, we then connect the player's signal (it will appear in the
 
     private void OnPlayerShoot(PackedScene bullet, float direction, Vector2 location)
     {
-        var spawnedBullet = (Bullet)bullet.Instantiate();
+        var spawnedBullet = bullet.Instantiate<Bullet>();
         AddChild(spawnedBullet);
         spawnedBullet.Rotation = direction;
         spawnedBullet.Position = location;