Exemple #1
0
    // 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();
    }
Exemple #2
0
 public void PoolyDespawn(Transform clone)
 {
     Pooly.Despawn(clone);
 }