using UnityEngine;
using System.Collections;

public class TrainCarWindowCurtainScript : MonoBehaviour {

	//private float animationSpeed = 1.0f;

	public bool mainMenuCurtain = false;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public void startWiggle(){

		if(!gameObject.animation.isPlaying){
			gameObject.animation.Play();
		}

	}

	public void stopWiggle(){

		if(gameObject.animation.isPlaying && !mainMenuCurtain){
			// TODO: sometimes curtain stops wiggling, but remains "up" which doesn't look right. SHIP IT.
			//gameObject.animation["WiggleCurtains"].time = 0.0f;
			gameObject.animation.Stop();
			//gameObject.animation.Rewind();
		}
		
	}

}
