var distance : float = 500;
function Update () {
	if(Vector3.Distance(transform.position, Camera.main.transform.position) < distance){
		for(var op in GetComponentsInChildren(Renderer)){
			op.enabled = true;
		}
	} else {
		var op : Component;
		for(op in GetComponentsInChildren(Renderer)){
			op.enabled = false;
		}
		for(op in GetComponentsInChildren(Light)){
			op.enabled = false;
		}
	}
}