init
This commit is contained in:
commit
001bb14f16
951 changed files with 270074 additions and 0 deletions
25
Assets/Scripts/Level/HouseController.cs
Normal file
25
Assets/Scripts/Level/HouseController.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue