private void OnTriggerEnter2D(Collider2D collider) { GameObject laser = collider.gameObject; if (laser.GetComponent <bulletController>() != null) { sceneCon.AddScore(20); Destroy(laser.gameObject); Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D collider) { GameObject laser = collider.gameObject; if (laser.GetComponent <bulletController>() != null) { Instantiate(smallAsteroidPrefab, transform.position, Quaternion.identity, sceneCon.transform); Instantiate(smallAsteroidPrefab, transform.position, Quaternion.identity, sceneCon.transform); sceneCon.AddScore(15); Destroy(laser.gameObject); Destroy(gameObject); } }