Ejemplo n.º 1
0
    public void PopWrapping(Vector3 newVelocity)
    {
        Debug.Log("pop wrapping called");
        GameAudioManager.WrappingDestroy(this.transform.position);

        //shread wrapping (remove mesh layer, create pop particles, etc.) & remove this script
        GetComponent <MeshCollider>().enabled = true;
        GetComponent <MeshRenderer>().enabled = true;
        gameObject.AddComponent <Rigidbody>();
        GetComponent <Rigidbody>().velocity = newVelocity;
        Destroy(transform.parent.gameObject);
        gameObject.transform.SetParent(null);
        Destroy(this);
    }