private void OnTriggerEnter2D(Collider2D other) { FlyBall flyball = other.GetComponent <FlyBall>(); if (flyball) { flyball.Dropped(); GameController.instance.LoadBall(); } BallConnected ballConnected = other.GetComponent <BallConnected>(); if (ballConnected) { ballConnected.PopBall(); GameController.instance.LoadBall(); } }
private void OnTriggerEnter2D(Collider2D other) { BallConnected ballConnected = other.gameObject.GetComponent <BallConnected>(); if (ballConnected && !alreadyConnected) { alreadyConnected = true; if (fullForce) { FindObjectOfType <BallGrid>().SmackBall(ballConnected, Type); } else { FindObjectOfType <BallGrid>().ConnectBall(ballConnected, transform.position, Type); } gameObject.SetActive(false); Destroy(gameObject); } }