using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class GearboxPos : MonoBehaviour {

	public GearBoxPosition gp;
	public Material GearSelected, GearNotSelected;
	private MeshRenderer mr;
	GearboxControl gc;

	void Start () 
	{
		gc = GetComponentInParent<GearboxControl> ();
		mr = GetComponent<MeshRenderer> ();
	}
		
	public void SelectOrDeselectGear(bool isGearToBeSelected)
	{
		if (isGearToBeSelected) {
			mr.material = GearSelected;
		} else 
		{
			mr.material = GearNotSelected;
		}
	}

	public void SelectGear()
	{
		gc.SetGearBoxPosition (this.transform, gp);
	}
}
