Exemplo n.º 1
0
    void HandleCollisionWithVinyl(Collision collision)
    {
        Instantiate(fragments, gameObject.transform.position, Quaternion.identity);
        Rigidbody[] fragmentRigidBodies = fragments.GetComponentsInChildren <Rigidbody>();
        fragmentRigidBodies[0].AddExplosionForce(5.0f, fragmentRigidBodies[0].transform.position, 5.0f, 5.0f, ForceMode.Force);

        spotifyManagerScript.Follow(FollowType.Artist, playlistScript.artistId);
        Debug.Log("Followed artist " + playlistScript.playlistName + " with id " + playlistScript.artistId);

        GameObject spawnedUIConfirmation = Instantiate(uiConfirmation, gameObject.transform.position + new Vector3(0, 0.3f, 0), Quaternion.identity);

        spawnedUIConfirmation.transform.Find("Follow Confirmation Text").GetComponent <TextMeshProUGUI>().text = "Followed " + playlistScript.playlistName + "!";
        Destroy(gameObject);
    }