public void StartMultiplayer() { actualMode = PONGMode.Multiplayer; if (enhanced != null) { enhanced.SetPaddleOriginalSize(playerOne.gameObject); enhanced.SetPaddleOriginalSize(playerTwo.gameObject); } matchStarted = true; HideObjects(); StartCoroutine(ball.InitMatch()); }
public void StartSinglePlayer() { if (ballRigid == null) { ballRigid = ball.gameObject.GetComponent <Rigidbody2D>(); } if (aiPlayer == null) { aiPlayer = playerTwo.gameObject.GetComponent <PONGAI>(); } actualMode = PONGMode.SinglePlayer; if (enhanced != null) { enhanced.SetPaddleOriginalSize(playerOne.gameObject); enhanced.SetPaddleOriginalSize(playerTwo.gameObject); } matchStarted = true; HideObjects(); playerTwo.ControlledByAI = true; StartCoroutine(ball.InitMatch()); }