
.namespace s19_SearchSite

function OnEnable()
	SearchSite.OnEnable()
	OPLog.Log("OnEnable unit "..self.Name)
	--On définit le nom du tableau
	if  SampleLevel.IsEqual("s19_search_1","unstarted") then 
		billet.Enabled = false
end
end

function OnEnter()
	if SampleLevel.IsEqual("s19_firstenter",true) then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1901",s19_SearchSite,nil)
		SampleLevel.Set("s19_firstenter",false)
		
	end	
	if SampleLevel.IsEqual("s19_search_1","finished") then
		OnSearchEnd(1)
	end
	
end


function UpdateAll()
	
end

function OnPickObject(objname)
	if objname == "obj_coffre_1" then
	SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1903",nil,nil)
	end
end
 function OnSequenceEnd (keyword)
	if keyword == "GP_1901" then
		@ObjectManager.LaunchNewResearch("s19",1)
	end
	if keyword == "GP_1902" then
		billet.Enabled = false
		NavigationManager.SwitchTo(nil,"TR_5")
	end
  end

function OnSearchEnd(typesearch)
if typesearch == 1 then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1902",s19_SearchSite,nil)
		billet.Enabled = true
		
		end
	
end
function OnPopupLeave(objname)

end


function CondSpecificToFinish()

end