Exemplo n.º 1
0
    private void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.tag == "Stick")
        {
            Stick stick = col.gameObject.gameObject.GetComponent <Stick>();
            if (stick.IsGoingUp() || !(stick.IsMovingFastEnough())) // only trigger when the stick is going downwords, and moving fastEnough
            {
                return;
            }

            HitReaction();
            stick.Vibrate();
            GameManager.instance.OnButtonClick(buttonType);
        }
    }