Add teleport to world map
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user