31 lines
600 B
C#
31 lines
600 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Valve.VR;
|
|
|
|
public class FallDownTrigger : MonoBehaviour
|
|
{
|
|
private AudioSource source;
|
|
private bool oneShot;
|
|
// Update is called once per frame
|
|
|
|
private void Start()
|
|
{
|
|
source = GetComponent<AudioSource>();
|
|
}
|
|
|
|
|
|
void Update()
|
|
{
|
|
if (transform.position.y < -10 && !oneShot)
|
|
{
|
|
source.Play();
|
|
oneShot = true;
|
|
}
|
|
|
|
if (transform.position.y < -100)
|
|
{
|
|
SteamVR_Fade.View(Color.black, 0.3f);
|
|
}
|
|
}
|
|
}
|