using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Audio_Object : MonoBehaviour
{
    public AudioSource zvuk;
    public float Timer;

    private void Start()
    {
        Timer = Time.time + 5f;

    }

    private void Update()
    {
        if(Timer <= Time.time)
        {
            zvuk.Stop();
        }
    }

    //public AudioClip Motor;
    //AudioSource Izvor_Z;
    //void Start()
    //{
    //    Izvor_Z = GetComponent<AudioSource>();
    //}
    //public void Update()
    //{
    //    if (Input.GetKeyDown("space"))
    //    {
    //        Zvuk_Jednom();
    //    }

    //}
    //public void Zvuk_Jednom()
    //{
    //    Izvor_Z.PlayOneShot(Motor, 0.8f);
    //}
}
