Working on entrance and building out first level
This commit is contained in:
31
Assets/Scripts/Decomtamination.cs
Normal file
31
Assets/Scripts/Decomtamination.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user