
.namespace s10_SearchSite

function OnEnable()
	SearchSite.OnEnable()
	OPLog.Log("OnEnable unit "..self.Name)
	--On définit le nom du tableau
end

function OnEnter()
	if SampleLevel.IsEqual("s10_firstenter",true) then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1000",s10_SearchSite,nil)
		SampleLevel.Set("s10_firstenter",false)
	end	 
	
	if SampleLevel.IsEqual("s10_search_4","finished") and SampleLevel.IsEqual("s10_dico",false) then
	SequencePlayer.Enabled = true
	SequencePlayer.PlaySequence("GP_1001",s10_SearchSite,nil)
	end
	if SampleLevel.IsEqual("s10_search_4","finished") and SampleLevel.IsEqual("s10_dico",true) then 
	SequencePlayer.Enabled = true
	SequencePlayer.PlaySequence("GP_1011",s10_SearchSite,nil)
	--SampleLevel.Set("s10_dico",false)
	end
end


function UpdateAll()
	
end

function OnPickObject(objname)
	if objname == "obj_solex_portions03" then
	SampleLevel.Set("Page_4",true)
	PopupManager.OpenPopup("msg_ig_livre",nil,"Livre")
	end
end

function OnSequenceEnd (keyword)
	if keyword == "GP_1001" then
	 NavigationManager.SwitchTo(nil,"s10_c01")
	 
  end
  if keyword == "GP_1011" then
	 NavigationManager.SwitchTo(nil,"s10_c02")
  end
  if keyword == "GP_1000" then
	 @ObjectManager.LaunchNewResearch("s10",4)
  end
end


function OnSearchEnd(typesearch)
	if typesearch == 4 then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1001",s10_SearchSite,nil)
		SampleLevel.Set("Page_4",true)

	end

end
function OnPopupLeave(objname)
OPLog.Log(objname)
end


function CondSpecificToFinish()

end