I’m trying to check if a script variable has a value assigned, not in the scene, but in the project. (When you click on the Project window, click the script, and it shows up in the Inspector).

vs.

My code to get the pictures above:
public class Sphere : MonoBehaviour {
public Mesh mesh;
}
Ok, I found a solution - dunno if there is a better way. This seems kind of hacky…
The script’s meta file without a mesh:
fileFormatVersion: 2
guid: b4862e4dbfff75e4a8b56fc2b7d7a029
timeCreated: 1442378139
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences:
- mesh: {instanceID: 0}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
With a mesh attached:
- mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
I can read in the value using a C# StreamReader and it will work. Any alternative solutions would be appreciated.