Time.delta cleanup / Basic mobile input
This commit is contained in:
@@ -136,10 +136,10 @@ public class MusicControl{
|
||||
silenced = false;
|
||||
}else if(current == music && music != null){
|
||||
//fade in the playing track
|
||||
fade = Mathf.clamp(fade + Time.delta()/finTime);
|
||||
fade = Mathf.clamp(fade + Time.delta /finTime);
|
||||
}else if(current != null){
|
||||
//fade out the current track
|
||||
fade = Mathf.clamp(fade - Time.delta()/foutTime);
|
||||
fade = Mathf.clamp(fade - Time.delta /foutTime);
|
||||
|
||||
if(fade <= 0.01f){
|
||||
//stop current track when it hits 0 volume
|
||||
|
||||
@@ -27,9 +27,9 @@ public class SoundLoop{
|
||||
}else{
|
||||
//fade the sound in or out
|
||||
if(play){
|
||||
volume = Mathf.clamp(volume + fadeSpeed * Time.delta());
|
||||
volume = Mathf.clamp(volume + fadeSpeed * Time.delta);
|
||||
}else{
|
||||
volume = Mathf.clamp(volume - fadeSpeed * Time.delta());
|
||||
volume = Mathf.clamp(volume - fadeSpeed * Time.delta);
|
||||
if(volume <= 0.001f){
|
||||
sound.stop(id);
|
||||
id = -1;
|
||||
|
||||
Reference in New Issue
Block a user