Esempio n. 1
0
 void Start()
 {
     LeftBallCount  = 0;
     RightBallCount = 0;
     leftText.text  = LeftBallCount.ToString();
     rightText.text = RightBallCount.ToString();
 }
Esempio n. 2
0
        void OnTriggerExit2D(Collider2D collision)
        {
            collision.transform.SetParent(null);
            if (collision.transform.CompareTag("Ball"))
            {
                --LeftBallCount;
                leftText.text = LeftBallCount.ToString();
            }
            if (collision.transform.CompareTag("AIBall"))
            {
                --RightBallCount;
                rightText.text = RightBallCount.ToString();
            }
            BasketBall basket = collision.GetComponent <BasketBall>();

            basket.SetActiveTraill(true);
        }
Esempio n. 3
0
        void OnTriggerEnter2D(Collider2D collision)
        {
            if (collision.transform.CompareTag("Ball"))
            {
                ++LeftBallCount;
                leftText.text = LeftBallCount.ToString();
                AudioManager.Instance.PlaySound(eSoundId.Score);
                goalInEffectPrefab.PlayEffect(collision.transform);
            }
            else if (collision.transform.CompareTag("AIBall"))
            {
                ++RightBallCount;
                rightText.text = RightBallCount.ToString();
                AudioManager.Instance.PlaySound(eSoundId.Score);
                goalInEffectPrefab.PlayEffect(collision.transform);
            }

            BasketBall basket = collision.GetComponent <BasketBall>();

            basket.SetActiveTraill(false);
        }