Example #1
0
    private void OnTriggerEnter(Collider other)
    {
        Sphere s = other.GetComponent <Sphere>();

        if (s)
        {
            s.gameObject.SetActive(false);
            if (s.CompareTag("Player"))
            {
                s.OutOfBounds();
            }
            else
            {
                ballCount++;
                UpdateScoreEvent.Invoke(ballCount);
            }
        }
    }