25 lines
583 B
C#
25 lines
583 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class HouseController : MonoBehaviour{
|
|
|
|
public GameController gameController;
|
|
|
|
bool lost;
|
|
|
|
void OnTriggerEnter2D(Collider2D col){
|
|
if(col.gameObject.tag == "Player" && !lost){
|
|
Win();
|
|
Time.timeScale = 0;
|
|
AudioManager.instance.Stop("Theme");
|
|
AudioManager.instance.Stop("Theme2");
|
|
AudioManager.instance.Play("Win");
|
|
lost = true;
|
|
}
|
|
}
|
|
|
|
void Win(){
|
|
gameController.win = true;
|
|
}
|
|
}
|