mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 13:30:07 +01:00
- Use pattern matching instead of check-and-cast. - Rename constants to fit the usual c# code-style.
15 lines
251 B
C#
15 lines
251 B
C#
using Godot;
|
|
using System;
|
|
|
|
public class Wall : Area2D
|
|
{
|
|
public void OnWallAreaEntered(Area2D area)
|
|
{
|
|
if (area is Ball ball)
|
|
{
|
|
// Oops, ball went out of game place, reset
|
|
ball.Reset();
|
|
}
|
|
}
|
|
}
|