Clean up spawn points, add mountain

This commit is contained in:
2022-08-14 22:15:45 -07:00
parent 9e87605849
commit 3a5ea8fd64
54 changed files with 7041 additions and 1376 deletions

View File

@@ -31,12 +31,18 @@ namespace Scampz.GameJam.Assets.Scripts
for (var i = 0; i < sceneCount; ++i)
scenes.Add(SceneManager.GetSceneAt(i));
if (scenes.Any(x => x.name.Contains("Temple")))
audioSource.clip = backgroundMusic[0];
if (scenes.Any(x => x.name.Contains("Sanctum")))
audioSource.clip = backgroundMusic[1];
AudioClip audioClipToPlay = null;
audioSource.Play();
if (scenes.Any(x => x.name.Contains("Temple")))
audioClipToPlay = backgroundMusic[0];
if (scenes.Any(x => x.name.Contains("Sanctum")))
audioClipToPlay = backgroundMusic[1];
if (audioClipToPlay != audioSource.clip)
{
audioSource.clip = audioClipToPlay;
audioSource.Play();
}
}

View File

@@ -1,4 +1,5 @@
using System.Collections;
using Scampz.GameJam.Assets.Scripts;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -17,6 +18,16 @@ namespace Scampz.GameJam
}
}
void OnEnable()
{
SceneManager.sceneLoaded += OnSceneLoaded;
}
void OnDisable()
{
SceneManager.sceneLoaded -= OnSceneLoaded;
}
public void LoadScene(string sceneName, LoadSceneMode loadSceneMode)
{
StartCoroutine(LoadSceneAsync(sceneName, loadSceneMode));
@@ -49,5 +60,10 @@ namespace Scampz.GameJam
if (SceneManager.GetSceneByName(sceneName).IsValid())
SceneManager.UnloadSceneAsync(sceneName);
}
private void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
{
BGMManager.Instance.PlaySong();
}
}
}