Exemple #1
0
 public static void AddBall()
 {
     if (session == null)//При переходе между уровнями должно будет вызываться само
     {
         session = new GameSession(SceneManager.GetActiveScene());
     }
     session.AddBall();
 }
Exemple #2
0
 /* Start is called before the first frame update */
 void Start()
 {
     gameSession = FindObjectOfType <GameSession>();
     gameSession.AddBall();
     myAudioSource = GetComponent <AudioSource>();
     myRigidBody2D = GetComponent <Rigidbody2D>();
     if (gameSession.GetNumberOfBalls() > 1)
     {
         hasStarted             = true;
         myRigidBody2D.velocity = new Vector2(xPush, yPush);
     }
     paddleToBallVector = transform.position - paddle1.transform.position;
 }
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     gameSession = FindObjectOfType <GameSession>();
     SFXPlayer   = FindObjectOfType <SoundSystem>();
     //if (SFXPlayer) print("Ball: SFXPlayer assigned");
     if (gameSession)
     {
         basePaddleBallRelation = gameSession.basePaddleBallRelation;
     }
     PaddleBallRelation = basePaddleBallRelation;
     //print("PaddleBallRelation: " + PaddleBallRelation.ToString());
     if (gameSession)
     {
         gameSession.AddBall();
     }
     ManageFireballOnStart();
     if (isOtherBallPresent())
     {
         hasStarted = true;
     }
 }