|
The simple question is how to make a custom inspector. The long(er) version is I have difficulty understanding the principles behind it. I need the inspector to get data from a script based on an input field from the same inspector. The altered information should automatically be save when i hit enter. (I figure i just can use GUI.changed) The Image is the GUI only and none of it have any functions to it yet. Can anyone help me? How do I in JavaScript:
(comments are locked)
|
|
I can help with the first two parts... To access and save variable data from another script, you should have that script attached to something in your scene. Just one copy of it. Use this line: Drag that object into that variable in the inspector. You can also find it using GameObject.Find(), but this is the easiest way. Then find that script from your first one with this line: Then you can refer to variables (and functions) in that script like this:
(comments are locked)
|
|
If I understand part 3, you want to make a new script onto an game object? That's AddComponent()
(comments are locked)
|


In c# to acces a variable in another script you do : NAMEOFTHESCRIPT.VARIABLE
Sorry didnt mention it should be in JS. Is it worth learning C#, it looks like most things is fairly easy in C#