[Solved] const elements of struct / class not accessible?
I currently have a class that I'm working with, and that class has structs inside it. I want these structs to contain lists of GUIDs for different situations (a struct with paytype IDs, another with notetype IDs, etc.) so that I can get the GUIDs out of my scripts and have them in one easily modifiable section.
However, I don't want to have to bother setting the elements of these structs separately, so I thought I'd use const on the internal variables, which allowed me to set the values inside the struct definition. When I started using const variables, I was unable to see the internal variables when operating on an instance of the class (with its internal member struct).
As soon as I remove const, the variable becomes visible.
The other problem is that these GUIDs are being used in case statements in my other scripts, and thus have to be of a const type.
Is there any way around this? Or will I just have to go back to using hard coded GUIDs in each and every file?
Here is an example of the struct that I'm working with (note: I changed these to nested classes, but it didn't help):
And I want the use of these values to be:
public class ShipType
public string shipper = "guid goes here";
public string consignee = "guid goes here";
public string thirdParty = "guid goes here";
public ShipType shipType = new ShipType();
where g_vars is an instance of the parent class of ShipType.
I'll post back with more info if I wasn't clear enough in any of my explanation