private void DestroyObject(GameObject obj) { // Destroy the object collected IPoolObject poolObj = obj.GetComponent <IPoolObject>(); if (poolObj != null) { Pool.RemoveObject(poolObj.GetPoolName(), obj); } }
private void OnTriggerEnter(Collider other) { if (other.tag == "pickup" || other.tag == "obstacle") { IPoolObject poolobj = other.GetComponent <IPoolObject>(); if (poolobj != null) { Pool.RemoveObject(poolobj.GetPoolName(), other.gameObject); } else { Debug.Log("UH POH"); } } }