Add airship level

Fix default spawn issue
TODO: Fix issue with spawning when loading from other scenes
This commit is contained in:
2022-08-30 01:48:01 -07:00
parent 82bf43452b
commit 7a891a45f1
22 changed files with 3856 additions and 316 deletions

View File

@@ -19,17 +19,12 @@ namespace Scampz.GameJam
}
public void LoadScene(string sceneName, Transform spawnPoint, LoadSceneMode loadSceneMode)
public void LoadScene(string sceneName, LoadSceneMode loadSceneMode)
{
StartCoroutine(LoadSceneAsync(sceneName, spawnPoint, loadSceneMode));
StartCoroutine(LoadSceneAsync(sceneName, loadSceneMode));
}
public void LoadFromWorldMap(LoadSceneMode loadSceneMode)
{
SceneManager.LoadScene("WorldMap", loadSceneMode);
}
private IEnumerator LoadSceneAsync(string sceneName, Transform spawnPoint, LoadSceneMode loadSceneMode)
private IEnumerator LoadSceneAsync(string sceneName, LoadSceneMode loadSceneMode)
{
yield return null;
var player = GameObject.FindGameObjectWithTag("Player");
@@ -51,8 +46,6 @@ namespace Scampz.GameJam
yield return loadSceneOperation;
var cc = player.GetComponent<CharacterController>();
cc.enabled = false;
player.transform.position = spawnPoint.position;
player.transform.rotation = spawnPoint.rotation;
yield return null;
}
}