Scriptum/Assets/Scripts/ChangeScene.cs

22 lines
472 B
C#
Raw Permalink Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using System;
public class ChangeScene : MonoBehaviour
{
public void MoveToScene(int sceneID)
{
SceneManager.LoadScene(sceneID);
}
public void OnCollisionEnter2D(Collision2D collision)
{
if(collision.gameObject.tag == "SceneTransition")
{
DoorBehaviour.Instance.ScenetToMoveTo();
}
}
}