TextAsset memory use

If I have two gameObjects on a scene with a TextAsset “pointing” to a large XML file. Will the two objects be storing copies of the text in the file? I assume they are but I want to verify.

How would I make a variable for these objects that “points” to a file not the actual contents ? In such a away that I can drag and drop a file into the variable in the inspector window of the object?

You’ll probably need to write some custom code for a component (using System.IO) and a custom inspector for that. TextAsset is a Resource, and as far as I know are fully loaded into RAM when you load them.

However, I expect that since it’s a Resource both GameObjects will have references to the same TextAsset instance rather than having their own. So if you’re only doing this so that you don’t have multiple copies of the file in RAM at once then you probably don’t need to bother. (Though I would test that before I relied upon it.)