Irgendjemand musste es ja machen...
This commit is contained in:
28
3d Prototyp/Assets/Toilette.cs
Normal file
28
3d Prototyp/Assets/Toilette.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Toilette : MonoBehaviour
|
||||
{
|
||||
public AudioSource AudioSource;
|
||||
|
||||
private bool _canFlush = true;
|
||||
|
||||
public void Flush()
|
||||
{
|
||||
if (_canFlush)
|
||||
StartCoroutine(FlushRoutine());
|
||||
|
||||
}
|
||||
|
||||
private IEnumerator FlushRoutine()
|
||||
{
|
||||
_canFlush = false;
|
||||
|
||||
AudioSource.Play();
|
||||
|
||||
yield return new WaitForSeconds(5);
|
||||
|
||||
_canFlush = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user