20 lines
396 B
C#
20 lines
396 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.SceneManagement;
|
||
|
|
||
|
public class LoadSceneOnCollision: MonoBehaviour
|
||
|
{
|
||
|
public string newGameScene;
|
||
|
|
||
|
|
||
|
void OnTriggerEnter2D(Collider2D other)
|
||
|
{
|
||
|
if(other.CompareTag("Player")){
|
||
|
Debug.Log("SceneLoader: Next Scene");
|
||
|
SceneManager.LoadScene(newGameScene);}
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|