private void Awake()
 {
     _paddleTransform  = transform;
     _paddleController = DependencyResolver.GetPaddleController(_paddleControllerParameters);
     _paddleController.ResetPaddleSize();
     this.WeakSubscribe <PlayerPaddleMono, GameManagementEvent>(x => x.OnLevelReset);
 }
Exemple #2
0
        public Paddle(IPaddleController controller, Side side) : base(true)
        {
            this.Width  = Game1.tileSize * 5;
            this.Height = Game1.tileSize / 2;

            this.controller = controller;
            this.side       = side;

            this.ResetPos();
        }
Exemple #3
0
 private void Awake()
 {
     _paddleController = DependencyResolver.GetPaddleController(_paddleControllerParameters);
 }
Exemple #4
0
 public void SetController(IPaddleController controller)
 {
     _controller = controller;
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Paddle"/> class.
 /// </summary>
 /// <param name="pongWorld">The pong world.</param>
 /// <param name="initialPosition">The initial position.</param>
 /// <param name="isLeft">if set to <c>true</c> [is left].</param>
 public Paddle(IPaddleController controller, PongWorld pongWorld, Vector2 initialPosition, bool isLeft)
 {
     this.totalPositiveResponces = 0;
     this.totalResponces = 0;
     this.isLeftPaddle = isLeft;
     this.position = initialPosition;
     this.oldPosition = initialPosition;
     this.target = initialPosition.Y;
     this.pongWorld = pongWorld;
     this.drawOrigin = new Vector2(Width / 2f, Height / 2f);
     this.controller = controller;
     this.controller.paddle = this;
     this.PreviousStates = new List<PaddleState>();
 }