void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.name != "Player") { Destroy(col.gameObject); Destroy(gameObject); CountPoint counter = GameObject.FindGameObjectWithTag("GameManager").GetComponent <CountPoint>(); counter.points++; } }
// Use this for initialization void Start() { countPoint = parent.GetComponent <CountPoint> (); }