瀏覽代碼

Changed instance method to typed version

Rafael Correa 3 年之前
父節點
當前提交
b987dba961
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      getting_started/first_2d_game/05.the_main_game_scene.rst

+ 1 - 1
getting_started/first_2d_game/05.the_main_game_scene.rst

@@ -356,7 +356,7 @@ Note that a new instance must be added to the scene using ``add_child()``.
         // obviously Mob and PathFollow2D, since they appear later on the line.
         // obviously Mob and PathFollow2D, since they appear later on the line.
 
 
         // Create a new instance of the Mob scene.
         // Create a new instance of the Mob scene.
-        var mob = (Mob)MobScene.Instance();
+        var mob = MobScene.Instance<Mob>();
 
 
         // Choose a random location on Path2D.
         // Choose a random location on Path2D.
         var mobSpawnLocation = GetNode<PathFollow2D>("MobPath/MobSpawnLocation");
         var mobSpawnLocation = GetNode<PathFollow2D>("MobPath/MobSpawnLocation");