How do you load a ComputeShader in code without using the Resources folder?

I need a way to load a ComputeShader, in code, without the use of a Resources folder.

I’m working on a EditorWindow plugin that requires the use of a ComputeShader. This ComputeShader is only intended to be used from the EditorWindow and no where else. My plugin doesn’t add any GameObjects to the scene, and it doesn’t create any components to add to any of the existing GameObjects. The only thing my EditorWindow does is run a bake process that will hopefully produce results that can be used by developers to increase the realism of some of the scene’s components.

Do to these restrictions, I have found only one way to load the ComputeShader so far, and it goes against the purpose of the ComputeShader only being used by the EditorWindow. The only way I know of loading the ComputeShader is by placing it inside a Resources folder and loading it as a resource that gets cast to a ComputeShader. Using a Resources folder would pass the ComputeShader over to the builds, which is something I really don’t want.

Is there anyway to load the ComputeShader in code without the use of a Resource folder?

Did you ever find an answer to this? I need to do the exact same thing… I’m also making a editor window for a baking process.

Another possibility is to put a field on your GUI that lets users choose your compute shader… but that solution is also sucky if you don’t want to confuse people with useless GUI options.

If it should only run at editor time, you might be able to load the compute shader as asset from the AssetDatabase. I haven’t tested this though:
With a method like: Unity - Scripting API: AssetDatabase.LoadAssetAtPath