コード例 #1
0
 protected virtual void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Ball")
     {
         //plays goal hit sound
         goalHit.Play();
         // Hit by ball
         manager.scoreGoal(onLeft);
     }
 }
コード例 #2
0
    // Override this method for custom the goal trigger
    protected virtual void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Ball")
        {
            manager.PlaySound("Goal");

            // Hit by ball
            manager.scoreGoal(onLeft);
        }
    }