Merge branch 'master' of https://git.steelants.cz/PragueGameJam/GlobalGameJame
This commit is contained in:
commit
61ee2f2794
Binary file not shown.
Binary file not shown.
@ -5,6 +5,11 @@ using UnityEngine;
|
||||
public class DayManager : MonoBehaviour
|
||||
{
|
||||
public int sunSpeed = 30;
|
||||
private bool night = false;
|
||||
|
||||
public AudioSource mainSource = new AudioSource();
|
||||
public AudioClip dayClip;
|
||||
public AudioClip nigtClip;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
@ -15,6 +20,23 @@ public class DayManager : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
float sunRotationX = transform.localEulerAngles.x;
|
||||
sunRotationX = (sunRotationX > 180) ? sunRotationX - 360 : sunRotationX;
|
||||
|
||||
Debug.Log(sunRotationX.ToString());
|
||||
if (sunRotationX < 0 && !night)
|
||||
{
|
||||
Debug.Log("It is a Night");
|
||||
mainSource.PlayOneShot(nigtClip);
|
||||
night = true;
|
||||
}
|
||||
else if (sunRotationX > 0 && night)
|
||||
{
|
||||
Debug.Log("It is a Day");
|
||||
mainSource.PlayOneShot(dayClip);
|
||||
night = false;
|
||||
}
|
||||
|
||||
this.gameObject.transform.Rotate(new Vector3(sunSpeed * Time.deltaTime, 0, 0));
|
||||
}
|
||||
|
||||
|
0
Assets/Sounds/.gitkeep
Normal file
0
Assets/Sounds/.gitkeep
Normal file
BIN
Assets/Sounds/GGJ20 Night theme Basses.wav
Normal file
BIN
Assets/Sounds/GGJ20 Night theme Basses.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/GGJ20 Night theme Drums.wav
Normal file
BIN
Assets/Sounds/GGJ20 Night theme Drums.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/GGJ20 Night theme Glitch.wav
Normal file
BIN
Assets/Sounds/GGJ20 Night theme Glitch.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/GGJ20 Night theme Synths.wav
Normal file
BIN
Assets/Sounds/GGJ20 Night theme Synths.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/GGJ20 Night theme all tracks.wav
Normal file
BIN
Assets/Sounds/GGJ20 Night theme all tracks.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Kill01Mix.wav
Normal file
BIN
Assets/Sounds/Kill01Mix.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Kill02Mix.wav
Normal file
BIN
Assets/Sounds/Kill02Mix.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Kill03Mix.wav
Normal file
BIN
Assets/Sounds/Kill03Mix.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Rooster.wav
Normal file
BIN
Assets/Sounds/Rooster.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Shotgun01.wav
Normal file
BIN
Assets/Sounds/Shotgun01.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Shotgun02.wav
Normal file
BIN
Assets/Sounds/Shotgun02.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Shotgun03.wav
Normal file
BIN
Assets/Sounds/Shotgun03.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Shotgun04.wav
Normal file
BIN
Assets/Sounds/Shotgun04.wav
Normal file
Binary file not shown.
BIN
Assets/Sounds/Wolf.wav
Normal file
BIN
Assets/Sounds/Wolf.wav
Normal file
Binary file not shown.
BIN
Assets/Sprites/Icons/RAW/Spikes.xcf
Normal file
BIN
Assets/Sprites/Icons/RAW/Spikes.xcf
Normal file
Binary file not shown.
BIN
Assets/Sprites/Icons/Spikes.png
Normal file
BIN
Assets/Sprites/Icons/Spikes.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
Loading…
Reference in New Issue
Block a user