32 lines
912 B
C#
32 lines
912 B
C#
|
|
using UnityEngine;
|
||
|
|
using StarterAssets;
|
||
|
|
using System.Collections;
|
||
|
|
using UnityEngine.UIElements;
|
||
|
|
|
||
|
|
public class Decomtamination : MonoBehaviour
|
||
|
|
{
|
||
|
|
[SerializeField] GameObject decomtaminationChamberDoor;
|
||
|
|
StarterAssetsInputs inputs;
|
||
|
|
Log log;
|
||
|
|
void Awake()
|
||
|
|
{
|
||
|
|
inputs = FindFirstObjectByType<StarterAssetsInputs>();
|
||
|
|
log = FindFirstObjectByType<Log>();
|
||
|
|
}
|
||
|
|
void OnTriggerEnter(Collider other)
|
||
|
|
{
|
||
|
|
if (other.CompareTag("Player"))
|
||
|
|
{
|
||
|
|
Decomtaminating();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
void Decomtaminating()
|
||
|
|
{
|
||
|
|
Debug.Log("Decomtaminating");
|
||
|
|
StartCoroutine(inputs.ToggleInput(5f));
|
||
|
|
log.WriteOutLog("You have entered the decomtamination chamber. Please wait while we process your decontamination...", 0.05f);
|
||
|
|
decomtaminationChamberDoor.GetComponent<Door>().UnlockDoor();
|
||
|
|
GetComponent<BoxCollider>().enabled = false;
|
||
|
|
}
|
||
|
|
}
|