chore: updated engine

This commit is contained in:
2025-04-13 22:24:56 +03:00
parent 51854a3e59
commit 34aa4dbb69
13 changed files with 91 additions and 91 deletions

View File

@@ -24,7 +24,7 @@ public class PongManagerBehaviour : Behaviour
protected override void OnFirstActiveFrame()
{
var buttonInputs = GameManager.FindRequiredBehaviour<IButtonInputs<Keys>>();
var buttonInputs = Universe.FindRequiredBehaviour<IButtonInputs<Keys>>();
buttonInputs.RegisterOnRelease(Keys.Space, (_, _1) => Reset());
}
@@ -32,7 +32,7 @@ public class PongManagerBehaviour : Behaviour
public void ScoreToLeft()
{
ScoreLeft++;
OnScored?.Invoke(this);
OnScored?.InvokeSafe(this);
CheckFinish();
}
@@ -40,7 +40,7 @@ public class PongManagerBehaviour : Behaviour
public void ScoreToRight()
{
ScoreRight++;
OnScored?.Invoke(this);
OnScored?.InvokeSafe(this);
CheckFinish();
}
@@ -48,7 +48,7 @@ public class PongManagerBehaviour : Behaviour
public void Reset()
{
ScoreLeft = ScoreRight = 0;
OnReset?.Invoke(this);
OnReset?.InvokeSafe(this);
}
private void CheckFinish()
@@ -56,6 +56,6 @@ public class PongManagerBehaviour : Behaviour
int halfwayScore = (int)(WinScore * .5f);
if (ScoreLeft > halfwayScore || ScoreRight > halfwayScore)
OnFinished?.Invoke(this);
OnFinished?.InvokeSafe(this);
}
}