using UnityEngine;
using System.Collections;

public class TrainCarColliderScript : MonoBehaviour {

	public int trainCarNumber = 0;

	private GameObject trainCarManager;

	// Use this for initialization
	void Start () {
	
		trainCarManager = GameObject.FindGameObjectWithTag("TrainCarManager");
		
		if(!trainCarManager){
			Debug.LogError ("Cannot find TrainCarManager!");
		}

	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnTriggerEnter(Collider other) {

		if(other.CompareTag("Player")){

			trainCarManager.GetComponent<TrainCarManagerScript>().setTrainLadyLocation(trainCarNumber);

		}

	}



}
