Ejemplo n.º 1
0
 void GrabBall()
 {
     if (!m_BallGrabbedFirstFrame)
     {
         // Debug.Log("Ball grabbed");
         m_Ball.GetCaught();
         m_CatchPosition         = m_Transform.position;
         m_BallGrabbedFirstFrame = true;
         // CatchRing m_CatchRing = GetComponentInChildren<CatchRing>();
         Color ballColor = m_Ball.GetComponentInChildren <NewBallArtManager>().myColor;
         m_CatchRing.SetBallColor(ballColor);
         Vibrator.Vibrate(vibeDuration);
     }
 }
Ejemplo n.º 2
0
    void SpawnBall()
    {
        Vector2 ballSpawnPos = new Vector2(Random.Range(-2.25f, 2.25f), -6);
        NewBall ball         = Instantiate(m_BallPrefab);

        ball.transform.position = ballSpawnPos;
        ball.m_Launching        = true;
        ball.canBeCaught        = false;
        ball.GetComponent <Rigidbody2D>().velocity = Vector2.up * ballLaunchForce;
        ball.GetComponentInChildren <NewBallArtManager>().SetInfo(_ballCount);

        balls.Add(ball);
        _ballCount++;

        ballsSortedByDepth.Add(ball.GetComponent <NewBallArtManager>());
    }
Ejemplo n.º 3
0
    public void SpawnFirstBall()
    {
        if (firstBall)
        {
            return;
        }

        Vector2 ballSpawnPos = new Vector2(0, -2);
        NewBall ball         = Instantiate(m_BallPrefab);

        ball.transform.position = ballSpawnPos;
        ball.m_Launching        = false;
        ball.canBeCaught        = false;
        ball.GetComponent <Rigidbody2D>().velocity     = Vector2.zero;
        ball.GetComponent <Rigidbody2D>().gravityScale = 0;
        ball.GetComponentInChildren <NewBallArtManager>().SetInfo(_ballCount);
        firstBall = ball;

        balls.Add(ball);
        _ballCount++;
        NewScoreManager._numBalls = _ballCount;

        ballsSortedByDepth.Add(ball.GetComponent <NewBallArtManager>());
    }