File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Assets/_Project/Scripts/Sound Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ void Awake ()
2828 s . source . loop = s . loop ;
2929 // default to main mixergroup if not set
3030 s . source . outputAudioMixerGroup = s . mixerGroup ? s . mixerGroup : mixerGroup ;
31+
32+ Debug . Log ( s . name . ToString ( ) + ", " + s . loop . ToString ( ) ) ;
3133 }
3234
3335
@@ -55,7 +57,11 @@ public void Play (string sound)
5557 s . source . volume = s . volume * ( 1f + UnityEngine . Random . Range ( - s . volumeVariance / 2f , s . volumeVariance / 2f ) ) ;
5658 s . source . pitch = s . pitch * ( 1f + UnityEngine . Random . Range ( - s . pitchVariance / 2f , s . pitchVariance / 2f ) ) ;
5759
58- s . source . PlayOneShot ( s . source . clip ) ;
60+ if ( sound == "music" )
61+ s . source . Play ( ) ;
62+ else
63+ s . source . PlayOneShot ( s . source . clip ) ;
64+
5965 }
6066
6167
You can’t perform that action at this time.
0 commit comments