Exemple #1
0
 private void OnBallOut()
 {
     if (isHost)
     {
         FieldMediator.ResetState();
         _physicsController.LaunchBall();
         PhotonServerController.SendEvent(2, new Dictionary <byte, object>());
     }
 }
Exemple #2
0
 private void OnUpdate(float obj)
 {
     if (isHost)
     {
         var dict = new Dictionary <byte, object>();
         dict.Add(0, (FieldMediator.Racket1.transform as RectTransform).anchoredPosition.x);
         dict.Add(1, FieldMediator.Ball.Rigidbody2D.position.x);
         dict.Add(2, FieldMediator.Ball.Rigidbody2D.position.y);
         dict.Add(3, FieldMediator.Ball.Rigidbody2D.velocity.x);
         dict.Add(4, FieldMediator.Ball.Rigidbody2D.velocity.y);
         PhotonServerController.SendEvent(1, dict);
     }
     else
     {
         var dict = new Dictionary <byte, object>();
         dict.Add(0, (FieldMediator.Racket2.transform as RectTransform).anchoredPosition.x);
         PhotonServerController.SendEvent(1, dict);
     }
 }