using UnityEngine;
using System.Collections;

public class PortalControl : MonoBehaviour {

	#region Private Variables
	[SerializeField]
	private GameObject _room;

	private ActiveCamera _activeCamera;
	#endregion


	#region Events
	void OnTriggerEnter2D (Collider2D col) {

		_activeCamera = GameObject.FindObjectOfType <ActiveCamera> ();

		if (col.tag == "Player") {
			Instantiate (_room);
			_activeCamera.Switch ();
		}

	}
	#endregion

}
