IEnumerator SelfDestroy() { yield return(new WaitForSeconds(3f)); Destroy(gameObject); pickUpGenerator.Clone(); }
void OnTriggerEnter(Collider other) { if (other.GetComponent <PickUp>() != null) { PickUp pickUp = other.GetComponent <PickUp>(); pickUp.Change(); Destroy(other.gameObject); pickUpGenerator.Clone(); } }