Bläddra i källkod

Added missing `CallDeferred()` to C# Example (#2358)

* Added missing `CallDeferred()` to C# Example

The note below the example references the call_deferred from the GDScript example but it was missing in the C# one.

* Apply suggestions from code review
ScepticDope 6 år sedan
förälder
incheckning
77089f965a
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      getting_started/step_by_step/your_first_game.rst

+ 1 - 1
getting_started/step_by_step/your_first_game.rst

@@ -467,7 +467,7 @@ Add this code to the function:
     {
     {
         Hide(); // Player disappears after being hit.
         Hide(); // Player disappears after being hit.
         EmitSignal("Hit");
         EmitSignal("Hit");
-        GetNode<CollisionShape2D>("CollisionShape2D").Disabled = true;
+        GetNode<CollisionShape2D>("CollisionShape2D").SetDeferred("disabled", true);
     }
     }
 
 
 Each time an enemy hits the player, the signal is going to be emitted. We need
 Each time an enemy hits the player, the signal is going to be emitted. We need