This commit is contained in:
Gerard Gascón 2025-04-24 16:56:52 +02:00
commit 862afc9b7a
478 changed files with 197737 additions and 0 deletions

40
Assets/CompleteGame.cs Normal file
View file

@ -0,0 +1,40 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class CompleteGame : MonoBehaviour
{
public int winScene;
// Start is called before the first frame update
void Start()
{
AudioManager.instance.Stop("MenuSong");
AudioManager.instance.Play("Theme");
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.tag == "Player")
{
loadscene(winScene);
}
}
IEnumerator Win(int scene){
Time.timeScale = 0;
AudioManager.instance.Stop("Theme");
yield return new WaitForSecondsRealtime(1f);
AudioManager.instance.Play("MenuSong");
Time.timeScale = 1;
SceneManager.LoadScene(winScene);
}
public void loadscene(int scene)
{
SceneManager.LoadScene(scene);
}
}