using UnityEngine;
using System.Collections;

public class PlayerDetector : MonoBehaviour {

	
	void Start () {
	
	}
	
	public GameObject cam;
	void Update () {
		
		Quaternion q = Quaternion.Euler(-MouseLook.rotationY,MouseLook.rotationX,0);
		Matrix4x4 targetMatrix = Matrix4x4.TRS(cam.transform.position, q, Vector3.one); 
		Vector3 dir = targetMatrix.MultiplyPoint(new Vector3(0, 0, 1));
		dir -= cam.transform.position;
		RaycastHit hit;
		References.SetFlashingColor("");
		if(Physics.Raycast(cam.transform.position, dir, out hit)){
			hit.collider.gameObject.SendMessage("LightColorPaddle", SendMessageOptions.DontRequireReceiver);	
		}
		
	}
	
	public PlayerTouch_S touch;
	public void EnterFlower(Flower_S flower){
		touch.EnterFlower(flower);
	}
}


