private void Update() { if (!alive || hp <= 0) { try { po.DestroyObject(this.gameObject); } catch (MissingReferenceException) { } Destroy(this.gameObject); } }
// Update is called once per frame void Update() { destroyTime -= Time.deltaTime; if (destroyTime <= 0f) { try { po.DestroyObject(this.gameObject); } catch (MissingReferenceException) { } Destroy(this.gameObject); } }