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

public class ManuHandler : MonoBehaviour {

    public AudioClip intro;
    public AudioClip loop;

    bool looping = false;

    AudioSource AS;

	// Use this for initialization
	void Awake () {
        AS = GetComponent<AudioSource>();
        AS.PlayOneShot(intro);
	}
	
	// Update is called once per frame
	void Update () {
        if(!looping && !AS.isPlaying)
        {
            AS.clip = loop;
            AS.Play();
            AS.loop = true;
            looping = true;
        }

        if (Input.GetKey(KeyCode.Escape)) {
            Application.Quit();
        }
		
	}
}
