Exemplo n.º 1
0
 void OnTriggerEnter2D(Collider2D hitInfo)
 {
     if (hitInfo.name == "Ball")
     {
         var wallName = transform.name;
         GameMngr.Score(wallName);
         hitInfo.gameObject.SendMessage("ResetBallTimer");
     }
 }
Exemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D hitInfo)
    {
        if (hitInfo.name == "Ball")
        {
            var wallName = transform.name;
            GameMngr.Score(wallName);
            hitInfo.gameObject.SendMessage("ResetBallTimer");

            audioSource      = GetComponent <AudioSource>();
            audioSource.clip = scoreSound;
            audioSource.Play();
        }
    }