using UnityEngine;
using System.Collections;

public class ChangeCamera : MonoBehaviour {
	public GameObject goOldCamera, goNewCamera, goAudioSource;
//	// Use this for initialization
	void Start () 
	{
	}
//	
//	// Update is called once per frame
//	void Update () {
//	
//	}
	void OnTriggerEnter(Collider other) 
	{
		if(other.tag == "Player")
		{
			goOldCamera = Camera.main.gameObject;
			goAudioSource = goOldCamera.GetComponentInChildren<AudioSource>().gameObject;
			goAudioSource.transform.position = goNewCamera.transform.position;
			goAudioSource.transform.parent = null;
			goOldCamera.SetActive(false);
			goNewCamera.SetActive(true);
			goAudioSource.transform.parent = goNewCamera.transform;

		}	
	}
}
