Beispiel #1
0
 private void OnBallOut()
 {
     if (isHost)
     {
         FieldMediator.ResetState();
         _physicsController.LaunchBall();
         PhotonServerController.SendEvent(2, new Dictionary <byte, object>());
     }
 }
Beispiel #2
0
 private void OnEventReceived(byte code, Dictionary <byte, object> data)
 {
     if (isHost)
     {
         if (code == 1)
         {
             SetRacketPosition(FieldMediator.Racket2, (float)data[0]);
         }
     }
     else
     {
         if (code == 1)
         {
             SetRacketPosition(FieldMediator.Racket1, (float)data[0]);
             FieldMediator.Ball.Rigidbody2D.position = new Vector2((float)data[1], (float)data[2]);
             FieldMediator.Ball.Rigidbody2D.velocity = new Vector2((float)data[3], (float)data[4]);
         }
         if (code == 2)
         {
             FieldMediator.ResetState();
         }
     }
 }
Beispiel #3
0
 private void OnBallOut()
 {
     FieldMediator.ResetState();
     _physicsController.LaunchBall();
 }