Add airship level
Fix default spawn issue TODO: Fix issue with spawning when loading from other scenes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user