// Update is called once per frame void Update() { lifetext.text = life.ToString(); if (life == 0) { //GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); //sphere.transform.position = transform.position; //sphere.transform.localScale = new Vector3(1, 1, 1); //sphere.transform.SetParent(transform); //sphere.GetComponent<Renderer>().material = GetComponent<Renderer>().material; //MeshExploder scripte = sphere.AddComponent<MeshExploder>(); GetComponent <MeshExploder>().Explode(); SoundManager.instance.PlaySingle(deadSound); Pooly.Despawn(transform); if (Pooly.GetActiveCloneCount("block") == 0) { GameManager.instance.Spawnblock(); GameManager.level++; } } UpdateColor(); }
public void PoolyDespawn(Transform clone) { Pooly.Despawn(clone); }