scene change hole
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
public class DropletMovement : MonoBehaviour
|
public class DropletMovement : MonoBehaviour
|
||||||
{
|
{
|
||||||
@@ -97,7 +98,8 @@ public class DropletMovement : MonoBehaviour
|
|||||||
//Hole
|
//Hole
|
||||||
if (other.CompareTag("Hole"))
|
if (other.CompareTag("Hole"))
|
||||||
{
|
{
|
||||||
//Destroy(gameObject);
|
SceneManager.LoadScene(2, LoadSceneMode.Single);
|
||||||
|
Destroy(gameObject);
|
||||||
Debug.Log("Fell in hole!");
|
Debug.Log("Fell in hole!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
|
||||||
|
|
||||||
public class SceneController : MonoBehaviour
|
public class SceneController : MonoBehaviour
|
||||||
{
|
{
|
||||||
@@ -9,6 +9,7 @@ public class SceneController : MonoBehaviour
|
|||||||
private void OggerEnter2D(Collider2D collision)
|
private void OggerEnter2D(Collider2D collision)
|
||||||
{
|
{
|
||||||
Debug.Log("Hole");
|
Debug.Log("Hole");
|
||||||
SceneManager.LoadScene(sceneIndex, LoadSceneMode.Single);
|
// Destroy(collision.gameObject);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user