2022-05-10 22:54:04 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.SceneManagement;
|
2022-05-15 16:40:58 +02:00
|
|
|
using System;
|
2022-05-10 22:54:04 +02:00
|
|
|
|
|
|
|
public class ChangeScene : MonoBehaviour
|
|
|
|
{
|
2022-06-02 14:25:22 +02:00
|
|
|
float x, y, z;
|
|
|
|
|
2022-05-10 22:54:04 +02:00
|
|
|
public void MoveToScene(int sceneID)
|
|
|
|
{
|
|
|
|
SceneManager.LoadScene(sceneID);
|
|
|
|
}
|
2022-05-15 16:40:58 +02:00
|
|
|
|
2022-06-02 14:25:22 +02:00
|
|
|
|
2022-10-02 18:45:58 +02:00
|
|
|
// method is invoked only when script is assign to the player prefab object
|
2022-05-15 16:40:58 +02:00
|
|
|
public void OnCollisionEnter2D(Collision2D collision)
|
|
|
|
{
|
|
|
|
if(collision.gameObject.tag == "SceneTransition")
|
|
|
|
{
|
2022-10-02 18:45:58 +02:00
|
|
|
collision.gameObject.GetComponent<DoorBehaviour>().ScenetToMoveTo();
|
2022-05-15 16:40:58 +02:00
|
|
|
}
|
|
|
|
}
|
2022-05-10 22:54:04 +02:00
|
|
|
}
|