perf: removed obsolete method calls and switched to for in draw calls
This commit is contained in:
@@ -27,7 +27,7 @@ public class MonoGameCamera2DBehaviour(GraphicsDeviceManager Graphics) : Behavio
|
||||
return;
|
||||
|
||||
_matrixTransform = value;
|
||||
OnMatrixTransformChanged?.InvokeSafe(this);
|
||||
OnMatrixTransformChanged?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MonoGameCamera2DBehaviour(GraphicsDeviceManager Graphics) : Behavio
|
||||
return;
|
||||
|
||||
_viewport = value;
|
||||
OnViewportChanged?.InvokeSafe(this);
|
||||
OnViewportChanged?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class MonoGameCamera2DBehaviour(GraphicsDeviceManager Graphics) : Behavio
|
||||
return;
|
||||
|
||||
_zoom = newValue;
|
||||
OnZoomChanged?.InvokeSafe(this);
|
||||
OnZoomChanged?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ public class PongManagerBehaviour : Behaviour, INetworkEntity,
|
||||
public void ScoreToLeft()
|
||||
{
|
||||
ScoreLeft++;
|
||||
OnScored?.InvokeSafe(this);
|
||||
OnScored?.Invoke(this);
|
||||
|
||||
CheckFinish();
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class PongManagerBehaviour : Behaviour, INetworkEntity,
|
||||
public void ScoreToRight()
|
||||
{
|
||||
ScoreRight++;
|
||||
OnScored?.InvokeSafe(this);
|
||||
OnScored?.Invoke(this);
|
||||
|
||||
CheckFinish();
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class PongManagerBehaviour : Behaviour, INetworkEntity,
|
||||
ball.ResetBall();
|
||||
ball.LaunchBall(GetBallLaunchDirection());
|
||||
|
||||
OnReset?.InvokeSafe(this);
|
||||
OnReset?.Invoke(this);
|
||||
}
|
||||
|
||||
private void CheckFinish()
|
||||
@@ -73,7 +73,7 @@ public class PongManagerBehaviour : Behaviour, INetworkEntity,
|
||||
|
||||
if (ScoreLeft > halfwayScore || ScoreRight > halfwayScore)
|
||||
{
|
||||
OnFinished?.InvokeSafe(this);
|
||||
OnFinished?.Invoke(this);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,6 @@ public class WallScoreBehaviour(Action OnCollision) : Behaviour2D
|
||||
if (!BehaviourController.TryGetBehaviour(out ICollider2D? collider2D))
|
||||
return;
|
||||
|
||||
collider2D.OnCollisionDetected += (_, _1) => OnCollision?.InvokeSafe();
|
||||
collider2D.OnCollisionDetected += (_, _1) => OnCollision?.Invoke();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user