Added 3 (!) diff musics
This commit is contained in:
parent
bea5554e59
commit
671c2d35e9
@ -45,7 +45,7 @@ AudioSource:
|
|||||||
type: 2}
|
type: 2}
|
||||||
m_audioClip: {fileID: 8300000, guid: 5e6a6f173f280dd48b74eb4bd1b9a32c, type: 3}
|
m_audioClip: {fileID: 8300000, guid: 5e6a6f173f280dd48b74eb4bd1b9a32c, type: 3}
|
||||||
m_PlayOnAwake: 1
|
m_PlayOnAwake: 1
|
||||||
m_Volume: 0.2
|
m_Volume: 0.3
|
||||||
m_Pitch: 1
|
m_Pitch: 1
|
||||||
Loop: 1
|
Loop: 1
|
||||||
Mute: 0
|
Mute: 0
|
||||||
|
|||||||
@ -133,6 +133,9 @@ MonoBehaviour:
|
|||||||
startScene: MainMenu
|
startScene: MainMenu
|
||||||
mainScene: LevelDesign
|
mainScene: LevelDesign
|
||||||
endScene: ThanksScene
|
endScene: ThanksScene
|
||||||
|
startMusic: {fileID: 8300000, guid: ca051ddfd9879bb4783087293eb7e5a4, type: 3}
|
||||||
|
mainMusic: {fileID: 8300000, guid: 3db8d9d52151c604c8b9d225f66dfed4, type: 3}
|
||||||
|
endMusic: {fileID: 8300000, guid: b770b78ed34b52b4f8891f25bb674320, type: 3}
|
||||||
fadeSpeed: 2.5
|
fadeSpeed: 2.5
|
||||||
fadeImg: {fileID: 3902665078773332606}
|
fadeImg: {fileID: 3902665078773332606}
|
||||||
coinText: {fileID: 3994057406749197163}
|
coinText: {fileID: 3994057406749197163}
|
||||||
@ -147,7 +150,7 @@ AudioSource:
|
|||||||
serializedVersion: 4
|
serializedVersion: 4
|
||||||
OutputAudioMixerGroup: {fileID: 24300002, guid: de87b833901494b4c90efb705ec209f6,
|
OutputAudioMixerGroup: {fileID: 24300002, guid: de87b833901494b4c90efb705ec209f6,
|
||||||
type: 2}
|
type: 2}
|
||||||
m_audioClip: {fileID: 8300000, guid: ca051ddfd9879bb4783087293eb7e5a4, type: 3}
|
m_audioClip: {fileID: 8300000, guid: 3db8d9d52151c604c8b9d225f66dfed4, type: 3}
|
||||||
m_PlayOnAwake: 1
|
m_PlayOnAwake: 1
|
||||||
m_Volume: 0.436
|
m_Volume: 0.436
|
||||||
m_Pitch: 1
|
m_Pitch: 1
|
||||||
|
|||||||
@ -11,11 +11,14 @@ public class GameController : MonoBehaviour
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
private string startScene, mainScene, endScene;
|
private string startScene, mainScene, endScene;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
|
private AudioClip startMusic, mainMusic, endMusic;
|
||||||
|
[SerializeField]
|
||||||
private float fadeSpeed;
|
private float fadeSpeed;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private Image fadeImg;
|
private Image fadeImg;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private TMP_Text coinText;
|
private TMP_Text coinText;
|
||||||
|
private AudioSource audioSource;
|
||||||
private Coroutine fadeCoroutine;
|
private Coroutine fadeCoroutine;
|
||||||
private int coinAmount = 0;
|
private int coinAmount = 0;
|
||||||
public int CoinAmount{get=>coinAmount;}
|
public int CoinAmount{get=>coinAmount;}
|
||||||
@ -37,6 +40,7 @@ public class GameController : MonoBehaviour
|
|||||||
}else{
|
}else{
|
||||||
coinText.gameObject.SetActive(true);
|
coinText.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
audioSource = GetComponent<AudioSource>();
|
||||||
}else{
|
}else{
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
}
|
}
|
||||||
@ -100,6 +104,18 @@ public class GameController : MonoBehaviour
|
|||||||
fadeImg.color = imgColor;
|
fadeImg.color = imgColor;
|
||||||
yield return null;
|
yield return null;
|
||||||
}
|
}
|
||||||
|
string active = SceneManager.GetActiveScene().name;
|
||||||
|
if(active.Equals(startScene)){
|
||||||
|
audioSource.clip = startMusic;
|
||||||
|
audioSource.Play();
|
||||||
|
}else if(active.Equals(mainScene)){
|
||||||
|
audioSource.clip = mainMusic;
|
||||||
|
audioSource.Play();
|
||||||
|
}else if(active.Equals(endScene)){
|
||||||
|
audioSource.clip = endMusic;
|
||||||
|
audioSource.Play();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
Assets/Sounds/Victory.mp3
Normal file
BIN
Assets/Sounds/Victory.mp3
Normal file
Binary file not shown.
22
Assets/Sounds/Victory.mp3.meta
Normal file
22
Assets/Sounds/Victory.mp3.meta
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b770b78ed34b52b4f8891f25bb674320
|
||||||
|
AudioImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 6
|
||||||
|
defaultSettings:
|
||||||
|
loadType: 0
|
||||||
|
sampleRateSetting: 0
|
||||||
|
sampleRateOverride: 44100
|
||||||
|
compressionFormat: 1
|
||||||
|
quality: 1
|
||||||
|
conversionMode: 0
|
||||||
|
platformSettingOverrides: {}
|
||||||
|
forceToMono: 0
|
||||||
|
normalize: 1
|
||||||
|
preloadAudioData: 1
|
||||||
|
loadInBackground: 0
|
||||||
|
ambisonic: 0
|
||||||
|
3D: 1
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Sounds/a-robust-crew.mp3
Normal file
BIN
Assets/Sounds/a-robust-crew.mp3
Normal file
Binary file not shown.
22
Assets/Sounds/a-robust-crew.mp3.meta
Normal file
22
Assets/Sounds/a-robust-crew.mp3.meta
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3db8d9d52151c604c8b9d225f66dfed4
|
||||||
|
AudioImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 6
|
||||||
|
defaultSettings:
|
||||||
|
loadType: 0
|
||||||
|
sampleRateSetting: 0
|
||||||
|
sampleRateOverride: 44100
|
||||||
|
compressionFormat: 1
|
||||||
|
quality: 1
|
||||||
|
conversionMode: 0
|
||||||
|
platformSettingOverrides: {}
|
||||||
|
forceToMono: 0
|
||||||
|
normalize: 1
|
||||||
|
preloadAudioData: 1
|
||||||
|
loadInBackground: 0
|
||||||
|
ambisonic: 0
|
||||||
|
3D: 1
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
x
Reference in New Issue
Block a user