15 lines
363 B
C#
15 lines
363 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class goal : MonoBehaviour
|
|
{
|
|
private void OnCollisionEnter2D(Collision2D other)
|
|
{
|
|
if (other.collider.CompareTag("Player"))
|
|
{
|
|
Debug.Log("You win!!!");
|
|
GetComponent<AudioSource>().Play();
|
|
SceneManager.LoadScene("winScreen");
|
|
}
|
|
}
|
|
}
|