Fix scene transitions and add demoable transition between two scenes
This commit is contained in:
21
Assets/Scripts/LoadScene.cs
Normal file
21
Assets/Scripts/LoadScene.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Scampz.GameJam
|
||||
{
|
||||
public class LoadScene : MonoBehaviour
|
||||
{
|
||||
private bool loaded = false;
|
||||
public int sceneIndex;
|
||||
|
||||
void OnTriggerEnter(Collider collider)
|
||||
{
|
||||
if (!loaded)
|
||||
{
|
||||
loaded = true;
|
||||
|
||||
CharacterManager.Instance.LoadScene(sceneIndex, LoadSceneMode.Additive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user