public static void Destroy(GameObject obj) { if (obj.HaveTags("pool")) { StaticPool.Destroy(obj); } else { GameObject.Destroy(obj); } }
void gotNextWaypoint() { pointIndex++; if (pointIndex >= WayPoints.points.Length) { StaticPool.Destroy(gameObject); return; } target = WayPoints.points[pointIndex]; }
private void OnCollisionEnter(Collision coll) { StaticPool.Destroy(gameObject); }