.namespace Transition

gotoNextScene = false
function OnEnable()
	OPLog.Log("OnEnabled Transition "..self.Name)
	SetVariables("CurrentGamePhase","TransitionScene")

	bg = OPUnitFactory.GetUnit(self.Name.."_background","Background")
	loc = OPUnitFactory.GetUnit("localization","Sprite")
	local lang = DebugOptions.curlanguage
	if(self.Name=="TR_5" and lang~="fre") then
		loc.Enabled=true

		loc.Image="media/graph/world/"..self.Name.."/journal_"..lang..".png"
	else
		loc.Enabled=false
	end
	bg.Scale_X = 1
	bg.Scale_Y = 1
	bg.Position_X = 0
	bg.Position_Y = 0
	SequencePlayer.PlaySequence(self.Name,self,nil,"transition")
	stopScale = false
	gotoNextScene = false
end



function OnDisable()


	SubtitlesDisplay.HideSubtitles()
	gotoNextScene = false

end

function OnSequenceEnd()
	if self.Name == "TR_5" then -- cas particulier fin du jeu
  		 NavigationManager.SwitchTo(nil,"Menu_Start")
		curseur.Flags_Visible = false
		-- -- Désactive le menu principal
		Menu_StartGame_Parent.Enabled = false

			-- --Active le background des Crédits
		Credits_popup.Enabled = true
		Credits_parent.Enabled = true

		-- -- Active les Crédits-- Création unit parent pour détruie les enfants
		local textparent = OPUnitFactory.CreateUnit("Display2D")
		textparent.Parent = Credits_parent
		textparent.Name = "textparent"
		textparent.Enabled = true

		-- -- Lance les crédits
		 Font_Arial22_Bold.Enabled = true
		New_CreditsText.StartCredits()
		return
	end
NavigationManager.SwitchTo(nil,self.nextscene)

end

-- function OnZoomEnd()
	-- NavigationManager.SwitchTo(nil,self.nextscene)
-- end
function OnUpdate(dt)
	-- if gotoNextScene == false then
		-- return
	-- end
	-- if bg.Scale_X > 1.2 and stopScale == false then
		-- stopScale = true
		-- NavigationManager.SwitchTo(nil,self.nextscene)
		-- return
	-- end
	-- bg.Scale_X = (bg.Scale_X)+0.5*dt
	-- bg.Scale_Y = (bg.Scale_Y)+0.5*dt


end

function InitInterface(shortname)




end







