chore: updated engine
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user