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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Scampz.GameJam
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
GameManager.Instance.LoadScene(SceneNames.TempleC, LoadSceneMode.Additive);
|
||||
GameManager.Instance.LoadScene(SceneNames.TempleA, LoadSceneMode.Additive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
|
||||
public static string TempleC => "TempleC";
|
||||
|
||||
public static string TempleD => "TempleD";
|
||||
public static string TempleSanctum => "TempleSanctum";
|
||||
|
||||
public static string TitleScreenScene => "TitleScreen";
|
||||
|
||||
public static string BaseScene => "BaseScene";
|
||||
|
||||
public static string WorldMap => "WorldMap";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user