if (Input.GetKeyUp(“p”)|| (Input.GetButtonDown(“Fire2”))) {
if(paused == true){
paused = false;
}else{
paused = true;
}
if(paused == true){
Time.timeScale = 0.0;
pausedGUI.enabled = true;
rigidbody.isKinematic = true;
audio.volume = 0.05;
}else{
Time.timeScale = 1.0;
pausedGUI.enabled = false;
rigidbody.isKinematic = false;
audio.volume = 0.2;
}
}
Done thx for the help
if (Input.GetKeyUp("p")|| (Input.GetButtonDown("Fire2"))) {
if(paused == true){
paused = false;
}else{
paused = true;
}
if(paused == true){
Time.timeScale = 0.0;
pausedGUI.enabled = true;
rigidbody.isKinematic = true;
}else{
Time.timeScale = 1.0;
pausedGUI.enabled = false;
rigidbody.isKinematic = false;
}
}
if(paused == true){
(VolOut());
}else{
(Volin());
}
function VolOut(){
while(audio.volume>0.05){
audio.volume-=0.001;
yield;
}
}
function Volin(){
while(audio.volume<0.2){
audio.volume += 0.001;
yield;
}
}
sorry C# is not me, i just starte using javascript in february, can you translate it ??
– PoulpcI can translate it but can you understand it? I don't mean to be rude or looking down on you but there is no point for you to use code that do not understand yet. You 'd rather use a more simple alternative that you manage but does not do everything you want. Later you get back on it and make it do exactly what you want with a big smile of "I just totally get it".
– fafaseoki i no i just starte in this new world, but my game is all most done, http://www.youtube.com/watch?v=NDN2Ul5xT3k newest video of i
– Poulpc@fafase you don't need the StartCoroutine in JS. It's done magically.
– whydoidoitI know. I am just preparing his conversion to C#.
– fafase