- Home /
Drop down with sizes
hey, I'm trying to find out how to make script that performs this drop down menu, does anyone know how to make this menu?
][1]
I need it for this script which will allow the user(developer) to select what lights and how many (why I need that drop down) to turn off which then plays a SFX to simulate say a power outage or something. heres the script.
var sound: AudioClip;
var action: boolean;
var done: boolean;
function Start(){
action = false;
}
function OnTriggerEnter( other : Collider ) {
if(other.tag == ("Player")){
action = true;
}
}
function Update(){
if(!done){
if(action){
light.enabled = !light.enabled;
audio.PlayOneShot(sound);
done=true;
}
}
}
@script RequireComponent(AudioSource)
Answer by JChiu · Sep 30, 2013 at 06:31 AM
I might be wrong but I don't think you can based on your images provided, which they seem to me that they are from the inspector, your users are not going to be able to access the inspector from their end. Thus, I would suggest you to create some GUI (text or texture) element with all the possible choice the user can choose from (with a script). Then use script referring to pass it onto your script above.
user as in the the developer, thats what I was meaning. its so I can add however many objects of something I need which in this case its the lights.