using UnityEngine;
using System.Collections;

public class SwitchToD : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		iTween.MoveTo(gameObject,iTween.Hash(
			"x", transform.position.x,
			"y", 3f,
			"z", transform.position.z,
			"time",2, 
			"easeType", "easeInOutQuad",
			"loopType", "pingPong"));
	}

	void OnTriggerStay() {
		GameObject.FindGameObjectWithTag ("Player").GetComponent<MeController> ().canSide = true;
		GameObject.FindGameObjectWithTag ("SoundManager").GetComponent<TemaFade> ().SwitchSoundClip ();
		transform.Find("Wall").gameObject.SetActive(true);
		transform.DetachChildren ();
		Destroy(gameObject);
	}
}
