IEnumerator SelfDestroy()
    {
        yield return(new WaitForSeconds(3f));

        Destroy(gameObject);
        pickUpGenerator.Clone();
    }
Beispiel #2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.GetComponent <PickUp>() != null)
        {
            PickUp pickUp = other.GetComponent <PickUp>();
            pickUp.Change();

            Destroy(other.gameObject);
            pickUpGenerator.Clone();
        }
    }