using UnityEngine;

[AddComponentMenu("Gamelogic/Cells/MeshCell")]
public class MeshCell : GLMonoBehaviour
{
	private bool on;
	private TextMesh textMesh;

	public Color Color
	{
		get;
		set;
	}

	public Vector3 Pivot
	{
		set
		{
			textMesh.transform.localPosition = value;
		}
	}

	public void SetColor(Color color)
	{
		this.Color = color;
		renderer.material.color = color;
	}

	public void SetTectColor(Color color)
	{
		textMesh.renderer.material.color = color;
	}

	public string Text
	{
		set
		{
			textMesh.text = value;
		}
	}

	public bool HighlightOn
	{
		get
		{
			return on;
		}

		set
		{
			on = value;

			renderer.material.color = on ? ExampleUtils.Blend(0.5f, Color, Color.white) : Color;
		}
	}

	public void Awake()
	{
		textMesh = GetComponentInChildren<TextMesh>();
	}

	public void SetText(string text)
	{
		Text = text;
	}
}