- Home /
JS Class "Does not denote valid type"
The problem is the following:
I have a PauseMenu JS script that I've used for weeks and gives no problems, now I decided to add a static var called "isPaused" to avoid editing Time.timeScale.
It has many functions (like QualityControl, StatControl, etc...) that are called inside OnGUI function, to render the buttons and all the items of the pause menu.
Unfortunately when I try to access to that static var from another script, it tells me "Unknown identifier: 'PauseMenu'", so I can't access the static variable.
This is a known bug, that can me solved moving the script into "Standard Assets" folder. I did it, but what happens? On runtime it gives me the following error: "Internal_GetGUIDepth can only be called from the main thread.", and a lot of NullReferenceExceptions.
Basically Unity can't render the GUI functions because it can not access the "Screen.width" and "Screen.height" variables, also it can't change Camera rect, because they're executed in a function that is not "OnGUI", even if it always did it so far.
Basically I'm in a loop because of two stupid bugs, what can I do? Do there is another way to fix the "Does not denote valid type" bug?
Your answer
Follow this Question
Related Questions
Static class member for offset 1 Answer
Have create a script named "Screen", now my game won't work, please help 1 Answer
Developing a Dynamic GUI 1 Answer
An object reference is required to access non-static member 2 Answers
Resolutions 1 Answer