Get variable from ScriptableObject class in MonoBehaviour class

I am making a simple text adventure game to learn unity. I have the following code which creates a typewriter effect on text.

public class Dialog : MonoBehaviour
{
    public TextMeshProUGUI textdisplay;
    public string senetnces;
    private int index;
    public float typingspeed;
    private AudioSource textScrollingSound;
    private void Start()
    {
        StartCoroutine(Type());
        textScrollingSound = transform.Find("textScrollSound").GetComponent<AudioSource>();
        textScrollingSound.Play();
    }

    IEnumerator Type()
    {
        foreach (char letter in senetnces.ToCharArray())
        {
            textdisplay.text += letter;
            if (letter.Equals('.') || letter.Equals(',') || letter.Equals('!') || letter.Equals('?'))
            {
                if (Input.GetKey("space") == false)
                {
                    textScrollingSound.Stop();
                    yield return new WaitForSeconds(.25f);
                    textScrollingSound.Play();
                }
            }
            yield return new WaitForSeconds(typingspeed);

        }
    }

    private void Update()
    {
        if (Input.GetKeyDown("space"))
        {
            typingspeed = .002f;
            textScrollingSound.pitch = 2;
        }
        if (Input.GetKeyUp("space"))
        {
            typingspeed = .02f;
            textScrollingSound.pitch = 1;
        }

    }

}

I am now following the Unity made text adventure tutorial (

).
The tutorial says to make a ScriptableObject class called room, to create different rooms for the player to enter.

[CreateAssetMenu(menuName = "TextAdventure/Room")]
public class Room : ScriptableObject
{
    [TextArea]
    public string description;
    public string roomName;

}

I want to get the string “description” into my class Dialog so I can use the typewriter effect on the description of each room. I am not sure how to access the “description” variable from another class since the variable is in a ScriptableObject class.

Any help would be greatly appreciated!

No. They are in the created Room asset. Do not think about values like they are “in a class”. They are in the asset you create in your project.
You need to somehow reference the room asset in your dialog like you’re referencing AudioSource or TextMeshProUGUI.
Then you can reference the .description of that Room object like the textdisplay.text.

Make an example: put the public Room testRoom; line above the public TextMeshProUGUI textdisplay;, drag and drop a room asset into it in the inspector and put the Debug.Log(testRoom.description); line in the Start method.

This worked! Thanks so much for the help!