gimm-platformer-project/Assets/Scripts/goal.cs

16 lines
358 B
C#
Raw Normal View History

using UnityEngine;
2021-10-21 12:05:56 -06:00
using UnityEngine.SceneManagement;
public class goal : MonoBehaviour
{
private void OnCollisionEnter2D(Collision2D other)
{
if (other.collider.tag == "Player")
{
Debug.Log("You win!!!");
2021-10-21 12:05:56 -06:00
GetComponent<AudioSource>().Play();
SceneManager.LoadScene("winScreen");
}
}
}