add script to Game Manager Object

Its is possible to attach my script to a empty game object, to be able to move them togheter in the screen?

AddComponent

1 Like

showing 2 error

IndexOutOfRangeException: Array index is out of range.
HighScores_js.SynchTable () (at Assets/HighScores/Source/JsVersion/HighScores_js.js:294)
HighScores_js.Start () (at Assets/HighScores/Source/JsVersion/HighScores_js.js:333)

( StartCoroutine(GetHighScores(difficultyModes[modeIndex].databaseName,currentScope,maxHighScores));
})


IndexOutOfRangeException: Array index is out of range.
HighScores_js.OnGUI () (at Assets/HighScores/Source/JsVersion/HighScores_js.js:341)

localScore = PlayerPrefs.GetInt(difficultyModes[modeIndex].playerPrefsName);

Could you please post your code here? It seems you’re setting up a new array without having it as “new” when you use it, so it registers as old array without any list.

1 Like

Whenever you write a new array, you need to set it to:

//'amountOfSpots' is a number!
int[] myArray = new int[amountOfSpots];

Basically, you need to tell the code that there is a new array being registered.
But because you’re coding an editor extension, this won’t work the same way as you don’t want the array to bug out and register every time the user opens the editor extension, right?

So I’d suggest you to try out this:

• Setup a simple button (GUILayout.Button(“SetupArray”))
• Check for input from the button
• If input is registered, register new array

The code could look like this:

if(GUILayout.Button("Register Arrays"))
{
   difficultyModes = new Mode[100];

   //Then keep on doing this to every array
   //The 100 number inside of square brackets [] tells how many 'spots' there are in this array, so            you can obviously customize it to whatever you want.
}

tha script is this, i would like to be able to resize an move and put a .jpg backgound

You cannot use any image as background, only display a texture but that will not be a background, it’ll actually be a spot inside of the editor window - just like a button, label and any other module.

Resizing is built in to editor windows unless you create the editor window with a constant size!

is in java!

I am very sorry but unfortunately, I can’t keep track of what you’re wanting to know anymore due to a language barrier.

Edit: Better to say, it feels like you’re needing help with something else each time you reply. Did your main issue get fixed?