Ejemplo n.º 1
0
    public void Explode()
    {
        GameObject[] floats = GameObject.FindGameObjectsWithTag("float");
        foreach (GameObject g in floats)
        {
            Rigidbody rb = g.GetComponent <Rigidbody>();
            rb.AddExplosionForce(300.0f, transform.position, 5.0f);
        }
        foreach (GameObject g in floats)
        {
            Destroy(g, .5f);
        }
        managerScript.greenExplosion.Play();
        Cam.GetComponent <AudioSource>().PlayOneShot(goodExplode, 2f);

        // Debug.Log("Time to create the next instructions");

        hueScript.AddToHue();

        Destroy(this.gameObject);
    }