chore: Cleanup
This commit is contained in:
parent
01668c7be3
commit
2565617ff9
|
@ -42,7 +42,6 @@ public class BallBehaviour : NetworkBehaviour, IMonoGameContentLoader
|
|||
|
||||
rigidBody = foundRigidBody;
|
||||
communicator = foundCommunicator;
|
||||
communicator.Listener.PeerConnectedEvent += PeerConnected;
|
||||
if (GameObject.GameManager.TryFindBehaviour(out PongManagerBehaviour? pongManager))
|
||||
{
|
||||
pongManager.OnReset += ResetBall;
|
||||
|
@ -51,13 +50,6 @@ public class BallBehaviour : NetworkBehaviour, IMonoGameContentLoader
|
|||
}
|
||||
}
|
||||
|
||||
private void PeerConnected(NetPeer peer)
|
||||
{
|
||||
if (!IsServer)
|
||||
return;
|
||||
if (communicator.Manager.ConnectedPeersCount == 1)
|
||||
}
|
||||
|
||||
private void DisableBall(PongManagerBehaviour pongManager)
|
||||
{
|
||||
BehaviourController.GameObject.Transform.Position = Vector2D.Zero;
|
||||
|
|
|
@ -74,9 +74,4 @@ public class PaddleBehaviour(Keys Up, Keys Down, float High, float Low, float Sp
|
|||
private void OnUpReleased(IButtonInputs<Keys> inputs, Keys keys) => isUpPressed = false;
|
||||
private void OnDownPressed(IButtonInputs<Keys> inputs, Keys keys) => isDownPressed = true;
|
||||
private void OnDownReleased(IButtonInputs<Keys> inputs, Keys keys) => isDownPressed = false;
|
||||
|
||||
protected override void OnMessageReceived(NetPacketReader reader, NetPeer peer)
|
||||
{
|
||||
Transform.Position = reader.GetVector2D();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue