Add teleport to world map

This commit is contained in:
2022-08-14 19:10:01 -07:00
parent a779a19bbf
commit 9e87605849
11 changed files with 650 additions and 479 deletions

View File

@@ -1,4 +1,7 @@
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace Scampz.GameJam.Assets.Scripts
{
@@ -18,6 +21,24 @@ namespace Scampz.GameJam.Assets.Scripts
Instance = this;
}
public void PlaySong()
{
audioSource.Stop();
var sceneCount = SceneManager.sceneCount;
var scenes = new List<Scene>();
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];
audioSource.Play();
}
}
}