Merge branch 'master' of https://git.steelants.cz/PragueGameJam/GlobalGameJame
This commit is contained in:
commit
fc81945421
@ -5,17 +5,35 @@ using UnityEngine;
|
||||
public class MusicManager : MonoBehaviour
|
||||
{
|
||||
public AudioSource musicSource = new AudioSource();
|
||||
public AudioClip Music;
|
||||
public AudioClip DayMusic;
|
||||
public AudioClip NightMusic;
|
||||
|
||||
private bool night = false;
|
||||
public GameObject Sun = new GameObject();
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
musicSource.PlayOneShot(Music);
|
||||
musicSource.PlayOneShot(DayMusic);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
float sunRotationX = Sun.transform.localEulerAngles.x;
|
||||
sunRotationX = (sunRotationX > 180) ? sunRotationX - 360 : sunRotationX;
|
||||
|
||||
Debug.Log(sunRotationX.ToString());
|
||||
if (sunRotationX < 0)
|
||||
{
|
||||
musicSource.PlayOneShot(NightMusic);
|
||||
Debug.Log("It is a Night");
|
||||
night = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
musicSource.PlayOneShot(DayMusic);
|
||||
Debug.Log("It is a Day");
|
||||
night = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
22
Assets/Sounds/Bonus-MonsterKill.wav.meta~HEAD
Normal file
22
Assets/Sounds/Bonus-MonsterKill.wav.meta~HEAD
Normal file
@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f8d91a5770ab6443b2c99b393881d93
|
||||
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…
Reference in New Issue
Block a user