private void OnBallOut() { if (isHost) { FieldMediator.ResetState(); _physicsController.LaunchBall(); PhotonServerController.SendEvent(2, new Dictionary <byte, object>()); } }
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(); } } }
private void OnBallOut() { FieldMediator.ResetState(); _physicsController.LaunchBall(); }