- Home /
Question by
pandaeyes1991 · Apr 12, 2012 at 01:10 AM ·
javascriptgameobjectarraystring
Access a String array in one script from another script
I am saving a string array in one script e.g. 'script1.js' like this
var options : String[] = ["option1", "option2", "option3"];
I am looking to access this in another script e.g. 'script2.js'. These options are user input data that I need in 'script2.js'. I am using them in an if-else statement to determine what GameObject to instantiate.
Can someone please post some example code that can achieve this for me?
Any help will be greatly appreciated as I have been searching for ages and can't seem to find anything that works.
Comment
Your answer
Follow this Question
Related Questions
Array problem -3 Answers
Load Prefabs in Array with Javascript 1 Answer
Automatically uncheck? 1 Answer
How can I instantiate a GameObject directly into an array? 3 Answers