24 lines
469 B
C#
24 lines
469 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.SceneManagement;
|
|||
|
|
|||
|
public class FlagScript : MonoBehaviour
|
|||
|
{
|
|||
|
private void OnTriggerEnter2D(Collider2D other)
|
|||
|
{
|
|||
|
if (other.CompareTag("Player"))
|
|||
|
{
|
|||
|
Debug.Log("Spieler hat die Flagge ber<65>hrt! Level gewonnen!");
|
|||
|
|
|||
|
WinLevel();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void WinLevel()
|
|||
|
{
|
|||
|
SceneManager.LoadScene("NextLevel");
|
|||
|
}
|
|||
|
}
|
|||
|
|