using UnityEngine;
using System.Collections;

public abstract class Pill : MonoBehaviour {

	public abstract void attach(World world, Camera camera, Owl owl);

	public abstract void update(float dt, float totalTimeLeft);

	public abstract Color getColor();

	public void fixYAxis(Camera camera) {
		
		// update our y-axis by doing a raycast for terrain
		Ray ray = new Ray (camera.transform.position + new Vector3(0, 500, 0), new Vector3(0, -1, 0));
		RaycastHit hitInfo;
		if (Physics.Raycast (ray, out hitInfo, float.MaxValue, 1 << 9)) {
			camera.transform.position = new Vector3(camera.transform.position.x, camera.transform.position.y + hitInfo.point.y, camera.transform.position.z);
		}
	}

	public virtual void destroy() {
	}
}
