I store a number of game options in a static class. The user can modify these options at runtime, but I’d also like to be able to set them in the editor.
So I wrote a simple editor script, but I can’t access the runtime script, I get a compile error (unknown type). I suppose the editor and runtime scripts are on different namespaces or something like that…
I don’t know what the answer is, but a work-around would be to create a runtime script with a setup function and have it be a ContextMenu. Something like this:
static var someValue : int = 0;
var newValue : int = 0;
@ContextMenu("Set value")
function SetValue() {
someValue = newValue;
}
What would this script be, editor or runtime?
If it’s a runtime script, I don’t think it can declare a context menu.
And if it’s and editor script, then a runtime script wouldn’t be able to access the static var someValue, which was the point to start with.
So… either I didn’t get what you where saying, or it won’t work.
Thanks anyway … I feel very lonely with my problem