public virtual void OnTriggerEnter2D(Collider2D other) { Collectibles collectedItem = other.GetComponent <Collectibles> (); if (collectedItem != null) { other.GetComponent <Collectibles> ().collectItem(other.gameObject, playerType); } }
public void OnTriggerEnter2D(Collider2D other) { Collectibles collectibles = other.GetComponent <Collectibles> (); if (collectibles) { if (collectibles.bulletBehaviour == BulletBehaviour.blast) { Destroy(collectibles.gameObject); Destroy(this.gameObject); } else { } } else { Destroy(this.gameObject); } }