
.namespace s06_SearchSite

function OnEnable()
	SearchSite.OnEnable()
	OPLog.Log("OnEnable unit "..self.Name)
	--On définit le nom du tableau
	if  SampleLevel.IsEqual("s06_search_1","unstarted") then 
	liste_s06_1.Enabled = true
	end
	
	if SampleLevel.IsEqual("s06_search_1","finished") then
	trou_plancher.Enabled = true
	end
end

function OnEnter()
	
	if SampleLevel.IsEqual("s06_firstenter",true) then
		SequencePlayer.Enabled = true
		trou_plancher.Enabled = false
		SequencePlayer.PlaySequence("GP_600",nil,nil)
		SampleLevel.Set("s06_firstenter",false)
	end	
	
end


function UpdateAll()
	
end

function OnPickObject(objname)
if objname == "obj_casque_colonial" then
	SampleLevel.Set("Page_2",true)
	PopupManager.OpenPopup("msg_ig_livre",nil,"Livre")
	
	end
	
	if objname == "obj_tapis" then
	PlaySoundEffect("gmp_carpet")
	 SequencePlayer.Enabled = true
	 SequencePlayer.PlaySequence("GP_602",nil,nil)
	end
	
	if objname == "obj_montre_gousset" then
	 SequencePlayer.Enabled = true
	 SequencePlayer.PlaySequence("GP_603",nil,nil)
	end

end

function OnSearchEnd(typesearch)
		if typesearch == 1 then
		InventoryManager.AddInInventory("InventoryPince","msg_ig_inventaire")	
		InventoryPince.Equipped = true
		trou_plancher.Enabled = true
		SampleLevel.Set("Page_2",true)
	
	end	
	
end

function OnPopupLeave(objname)
	if objname == "InventoryPince" then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_605",nil,nil)
	end
end
function CondSpecificToFinish()

end