Показать сообщение отдельно
Старый 03.01.2013, 00:25   #1
mepihin
ПроЭктировщик
 
Регистрация: 31.12.2012
Сообщений: 165
Написано 5 полезных сообщений
(для 7 пользователей)
Горизонтальный слайдер

Я создал горизонтальный слайдер, но никак не могу сделать так, чтобы при передвижение ползунка изменялась громкость на объекте тераина.
var showsettings 0;
function 
OnGUI()
{        
if(
GUI.Button(new Rect(Screen.width-105,30,100,20),"Settings"))
        {
            
showsettings 1;
        }
        if(
showsettings==1)
        {
            
GUI.Label(new Rect(Screen.width/75Screen.height 11515020),"Terrain sound volume");
            
terrainsounds GUI.HorizontalSlider(new Rect(Screen.width/250Screen.height 9050020),terrainsounds,0,1);
            
GUI.Label(new Rect(Screen.width/260Screen.height 955020),terrainsounds.ToString());
            
            
GUI.Label(new Rect(Screen.width/75Screen.height 8015020),"Pulse sound volume");
            
pulsesound GUI.HorizontalSlider(new Rect(Screen.width/250Screen.height 5550020),pulsesound,0,1);
            
GUI.Label(new Rect(Screen.width/260Screen.height 605020),pulsesound.ToString());
            
            
GUI.Label(new Rect(Screen.width/75Screen.height 4515020),"Step sound volume");
            
stepsound GUI.HorizontalSlider(new Rect(Screen.width/250Screen.height 2050020),stepsound,0,1);
            
GUI.Label(new Rect(Screen.width/260Screen.height 255020),stepsound.ToString());            
        }} 
Когда делаешь так:
terrainsound GameObject.Find("Terrain").audio.volume
То ползунок не двугается.
Помогите пожалуйста
(Offline)
 
Ответить с цитированием