C# Deserialize an any object with Resource.Load()

Hey guys,
I’m writing a piece of code, with an editor-side to create config files and an runtime-side, to use this configuration.
The configuration file is an serialized object with the specific fields and its automaticly stored in a resource-folder.
But now i have the problem, that I don’t know, how to deserialize the object, while running the game, because Resource.Load only gives an Object, and I cannot cast directly to my own type of class.

Maybe you guys know a solution.

Greetings, Hendrik Müller

The documentation shows how to cast it as a GameObject. You can then grab the invidividual components attached to the GameObject by using GetComponent.

Alternatively, if you just want to access a component then use:

ClassName myClass = Resources.Load<ClassName>("location");