init
This commit is contained in:
commit
341a877b4a
2338 changed files with 1346408 additions and 0 deletions
24
Assets/Scripts/Player/DungeonIntruder.cs
Normal file
24
Assets/Scripts/Player/DungeonIntruder.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class DungeonIntruder : MonoBehaviour
|
||||
{
|
||||
public Room currentRoom;
|
||||
public UnityEvent roomChange;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
roomChange = new UnityEvent();
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.gameObject.GetComponent<Room>() != null && other.gameObject.GetComponent<Room>()!=currentRoom)
|
||||
{
|
||||
currentRoom = other.gameObject.GetComponent<Room>();
|
||||
roomChange.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue