Hi every one, I get stuck with this:
How can I get/set a variable value that’s in a script’s Array (List, Builtin Array, etc.).
The main idea is to use an editor script(lets call this main script) that put a script(data holder) in other script(game object with it) in a Builtin Array, List, etc. and then get/set any public variable using the main script.
//Main Script
for (n = 0; n < nScriptCount; n ++)
target.scriptList.Add(dataHolder);
target.scriptList[n].someValue = "Set value";
//Game Object Script
public var scriptList = new List.<MonoScript>();
//Data Holder
public var someValue : String;
Any help will be appreciated.
So broadly speaking this should work (sans the . between List and <<). What about your solution doesn't work?
– BovineMr. Bovine, before you let a comment, try to check if the text it's for C# or JS, the code above it's for JS.
– anon34578815I did try to determine the script - it's only the last line thats obvious - and I use obvious in the broadest sense possible here. Perhaps rather you could state the script's language. At any rate I was trying to help you - hence my post in the first place.
– Bovine