コード例 #1
0
ファイル: BasketGoalCounter.cs プロジェクト: realtics/team4
        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);
        }
コード例 #2
0
ファイル: BasketGoalCounter.cs プロジェクト: realtics/team4
        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);
        }