function LightningAnim03 (Begin, LiveTime, timeScene)
	local LocalTime = (timeScene - Begin)/LiveTime	
	local flash = 0.1
--	currentMult.Scene4_light.Lightning.scale = 0.8

	if Begin <= timeScene and  timeScene < Begin + LiveTime then
		currentMult.Scene3_light.layer.isVisible = true
		if LocalTime <= flash then
			local FlashTime = LocalTime/flash		
			currentMult.Scene3_light.Lightning.color = Color(240, 240, 255, lerp (0, 255, FlashTime))
			currentMult.Scene3.Light.color = Color(255, 255, 255, lerp (0, 150, FlashTime))
			currentMult.Scene3_light.Lightning.color = Color(240, 240, 255, 255)						
			
		--	currentMult.Scene3.StormCloudDark .color = Color(255, 255, 255, lerp (0, 255, FlashTime))
		
			FlashTime = 0
			
			currentMult.Scene3.BackgroundDark .color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockRight03Dark.color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockRight02Dark.color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockLeft02Dark .color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockLeft01Dark .color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockRight01Dark.color = Color(255, 255, 255, 0)    
			currentMult.Scene3.TownDark       .color = Color(255, 255, 255, 0)    
			                                                         
		else
			local SlowTime  = ease((LocalTime-flash)/(1 -flash), 0.1, 0) 		
			currentMult.Scene3_light.Lightning.color = Color(240, 240, 255, lerp (150, 0, SlowTime ))
			currentMult.Scene3.Light.color = Color(255, 255, 255, lerp (150, 0, SlowTime ))
			
			--currentMult.Scene3.StormCloudDark .color = Color(255, 255, 255, lerp (255, 0, SlowTime))
			SlowTime = 1
			currentMult.Scene3.BackgroundDark .color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockRight03Dark.color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockRight02Dark.color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockLeft02Dark .color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockLeft01Dark .color = Color(255, 255, 255, 0)    
			currentMult.Scene3.RockRight01Dark.color = Color(255, 255, 255, 0)    
			currentMult.Scene3.TownDark       .color = Color(255, 255, 255, 0)    
		end	                                                                             
		currentMult.Scene3_light.Lightning.x     = 350
		currentMult.Scene3_light.Lightning.y     = lerp(230, 400, timeScene)
	else
		currentMult.Scene3_light.Lightning.color = Color(255, 255, 255, 0)
		currentMult.Scene3.StormCloudDark .color = Color(255, 255, 255, 0)
		currentMult.Scene3.BackgroundDark .color = Color(255, 255, 255, 0)    
		currentMult.Scene3.RockRight03Dark.color = Color(255, 255, 255, 0)    
		currentMult.Scene3.RockRight02Dark.color = Color(255, 255, 255, 0)    
		currentMult.Scene3.RockLeft02Dark .color = Color(255, 255, 255, 0)    
		currentMult.Scene3.RockLeft01Dark .color = Color(255, 255, 255, 0)    
		currentMult.Scene3.RockRight01Dark.color = Color(255, 255, 255, 0)    
		currentMult.Scene3.TownDark       .color = Color(255, 255, 255, 0)    
		currentMult.Scene3_light.layer.isVisible = false
	end		
end

function DarkClouds(timeScene, AC)
	local MegaX = lerp (400, 400, timeScene)
	local MegaY = 330
	currentMult.Effect03_cloud.DarkClouds3.color = Color(255,255,255, AC)
	currentMult.Effect03_cloud.DarkClouds3.x = MegaX-100
	currentMult.Effect03_cloud.DarkClouds3.y = lerp (MegaY, MegaY + 200, timeScene) - 20
end

function Effects03(timeScene, AC)	
	local MegaX = lerp (400, 400, timeScene)
	local MegaY = 330
	
	currentMult.Effect03.RainRight.x = MegaX
	currentMult.Effect03.RainRight.y = lerp (MegaY, MegaY + 200, timeScene) 
	currentMult.Effect03.RainRight.color = Color(255,255,255, AC)
	
	currentMult.Effect03.BackgroundRain.x = 350 --MegaX
	currentMult.Effect03.BackgroundRain.y = MegaY	
	currentMult.Effect03.BackgroundRain.color = Color(255,255,255, AC)
	currentMult.Effect03.Vulkan.x = 430		+20
	currentMult.Effect03.Vulkan.color = Color(255,255,255, AC)
end

function Scene3DarkColor (timeScene, AlphaDark)
	currentMult.Scene3.Background.color      = Color(255,255,255, AlphaDark )
	currentMult.Scene3.BackgroundDark.color  = Color(255,255,255, AlphaDark )
	currentMult.Scene3.RockRight03.color     = Color(255,255,255, AlphaDark )
	currentMult.Scene3.RockRight03Dark.color = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.RockRight02.color     = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.RockRight02Dark.color = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.RockLeft02.color      = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.RockLeft02Dark.color  = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.Town.color            = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.TownDark.color        = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.RockRight01.color     = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.RockLeft01.color      = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.RockLeft01Dark.color  = Color(255,255,255, AlphaDark )		
	currentMult.Scene3.RockRight01Dark.color = Color(255,255,255, AlphaDark )		
end                                                                       

function Visual_3 (timeScene)
	local Destroid, Pause, Relax = 0.6, 0.1, 0.0
	currentMult.Scene3.Rain.color = Color(255,255,255,0)
	currentMult.Scene3.Lightning.color = Color(255,255,255,0)
	if timeScene >= 0.1 then
		currentMult.Effect03.layer.isVisible = true					
		local Te = (timeScene - 0.1)/0.9
		Effects03 (timeScene, lerp(0, 255, Te))			
	else
		currentMult.Effect03.Vulkan.color = Color ( 255, 255, 255, 0)														
	end
	
	currentMult.Scene3.RockRight01L.color     = Color(255,255,255, 0)			
	
	if timeScene <= 1 - Destroid-Pause then   						
		local T = ease(timeScene/(1 - Destroid-Pause), 0, Relax)		
		
		currentMult.Scene3.RockRight01L.y = -152 --lerp( -400, -152, T)
		currentMult.Scene3.RockRight01L.x = 330
		
		currentMult.Scene3.RockRight02L.y = 8 --lerp( -125,   8, T)
		currentMult.Scene3.RockRight02L.x = 390				                
		
		currentMult.Scene3.RockRight03L.y = -25 --lerp( -57, -25, T)
		currentMult.Scene3.RockRight03L.x = 390
		--150
		currentMult.Scene3.RockLeft01L.y = -200 --lerp( -300,  -200, T)
		currentMult.Scene3.RockLeft01L.x = 227
		
		currentMult.Scene3.RockLeft02L.y = -60 --lerp( -240,  -60, T)
		currentMult.Scene3.RockLeft02L.x = 190
		
		currentMult.Scene3.RockLeft03L.y = 30 --lerp( -150,  30, T)
		currentMult.Scene3.RockLeft03L.x = 130
		
		currentMult.Scene3_sky.SkyL.x = 250
		currentMult.Scene3_sky.SkyL.y = 0 --lerp( 100,  200, T)		
		
		currentMult.Scene3.Castle.y = 40 --lerp(-70, 40, T)
		currentMult.Scene3.Castle.x = 240+20
		
		currentMult.Scene3.WhiteRock.y = 120 --lerp(10, 120, T)
		currentMult.Scene3.WhiteRock.x = 350+20			
		
		currentMult.Scene3.CastleMirror.y = 140
		currentMult.Scene3.CastleMirror.x = 325
		currentMult.Scene3.CastleMirror.color  = Color(255,255,255,0)
		
		currentMult.Scene3.Smoke.y = 200 + 70
		currentMult.Scene3.Smoke.x = lerp(450,  445, T)
		currentMult.Scene3.Smoke.color = Color (255, 255, 255, 0)
		
		currentMult.Scene3_sky.Sky.color = Color(255,255,255,0)
		currentMult.Scene3_sky.StormCloud.color = Color(255,255,255,0)
		currentMult.Scene3.StormCloudDark.color = Color(255,255,255,0)
		currentMult.Scene3.Sun.color = Color(255,255,255,0)          
		
	--	Scene3DarkColor (0)
		currentMult.Scene3.Background.color      = Color(255,255,255, 0 )
		currentMult.Scene3.RockRight03.color     = Color(255,255,255, 0 )
		currentMult.Scene3.RockRight02.color     = Color(255,255,255, 0 )		
		currentMult.Scene3.RockLeft02.color      = Color(255,255,255, 0 )		
		currentMult.Scene3.Town.color            = Color(255,255,255,  0 )		
		currentMult.Scene3.RockRight01.color     = Color(255,255,255,  0 )		
		currentMult.Scene3.RockLeft01.color      = Color(255,255,255,  0 )		
		
		currentMult.Effect01.Sun1.y = 205 --lerp(200, 205, T)
		currentMult.Effect01.Sun1.x = 230
		
		currentMult.Effect03.Vulkan.y = 80	
		currentMult.Effect01.Sun1.color = Color(255,255,255, 255 )														
		
		local R = 0.1
		if timeScene >= 1 - Destroid-Pause - R then 
			local Ts = ease((timeScene-1 +Destroid+Pause)/R + 1, 0.5, 0) 							
			currentMult.Scene3_sky.StormCloud.color      = Color(255,255,255, lerp(0, 255, Ts) )		
			currentMult.Effect01.Sun1.color = Color(255,255,255, lerp(255, 0, Ts) )														
			currentMult.Effect01.Sun1:Do("Finish")
			currentMult.Scene3_sky.StormCloud.x     = 250
			currentMult.Scene3_sky.StormCloud.y     = 185 --lerp (175, 185,  Ts)
			currentMult.Scene3_sky.StormCloud.scale = 1
			currentMult.Scene3.Sun.x     = 230
			currentMult.Scene3.Sun.y     = 220 --lerp ( 210, 220, Ts)      
			currentMult.Scene3.Sun.scale = 1				
			currentMult.Scene3.Sun.color      = Color(255,255,255, lerp(0, 255, Ts) )														
		end						
	elseif  1 - Destroid <= timeScene+Pause and  timeScene+Pause < 1 then		
		local Ts = ease((timeScene + Pause - 1)/Destroid + 1, 0.8, 0.2)
		
		--??????????????
		
		DarkClouds(timeScene, 255)
		if Ts <= 0.2 then
			local t = Ts/0.2
			currentMult.Effect03_cloud.layer.isVisible = true
			DarkClouds(timeScene, lerp(0, 255, t))			
		end
		
		--??????????????
		
		currentMult.Effect01.Sun1.y  = lerp(205, 340, Ts)
		currentMult.Effect01.Sun1.x  = 230
		
		currentMult.Effect03.Vulkan.y = lerp (80, 258, Ts)
		
		currentMult.Scene3.Sun.x     = 230
		currentMult.Scene3.Sun.y     = lerp (220, 350, Ts)      
		currentMult.Scene3.Sun.scale = 1				
		
	--	currentMult.Scene3.RockRight03L.y = lerp( -25, 210, Ts)
		currentMult.Scene3.RockRight03L.x = 390
		
		currentMult.Scene3.Castle.y = lerp(40, 205, Ts)   -- -38
		currentMult.Scene3.Castle.x = 240+20
		
		currentMult.Scene3.WhiteRock.y = lerp(120, 285, Ts)
		currentMult.Scene3.WhiteRock.x = 350+20
		
		currentMult.Scene3.RockRight01L.y = lerp( -152, 150, Ts)
		currentMult.Scene3.RockRight01L.x = 330				                
		
		currentMult.Scene3.RockLeft01L.y = lerp( -200,  150, Ts)
		currentMult.Scene3.RockLeft01L.x = 227
		
		currentMult.Scene3.RockLeft02L.y = lerp( -60, 136,   Ts)
		currentMult.Scene3.RockLeft02L.x = 190       
		currentMult.Scene3.RockLeft03L.y = lerp( 30, 227,  Ts)
		currentMult.Scene3.RockLeft03L.x = 130       
		
		currentMult.Scene3.RockRight02L.y = lerp( 8,   185, Ts)
		currentMult.Scene3.RockRight02L.x = 390	
		
		currentMult.Scene3.Background.color      = Color(255,255,255, lerp(0, 255, Ts) )		
		currentMult.Scene3.RockRight03.color     = Color(255,255,255, lerp(0, 255, Ts) )		
		currentMult.Scene3.RockRight02.color     = Color(255,255,255, lerp(0, 255, Ts) )		
		currentMult.Scene3.RockLeft02.color      = Color(255,255,255, lerp(0, 255, Ts) )		
		currentMult.Scene3.Town.color            = Color(255,255,255, lerp(200, 255, Ts) )		
	--	currentMult.Scene3.RockRight01.color     = Color(255,255,255, lerp(0, 255, Ts) )						
		currentMult.Scene3.RockRight01.color     = Color(255,255,255, 255 )				
		currentMult.Scene3.RockLeft01.color      = Color(255,255,255, lerp(0, 255, Ts) )	
		
	--	Scene3DarkColor (Ts*255)                                                                      lerp(0, 255, Ts)
		                                                        
		currentMult.Scene3_sky.Sky.x     = 250
		currentMult.Scene3_sky.Sky.y     = 250
		currentMult.Scene3_sky.Sky.scale = 1
				
		currentMult.Scene3_sky.StormCloud.x     = 250
		currentMult.Scene3_sky.StormCloud.y     = lerp (185, 340, Ts)
		currentMult.Scene3_sky.StormCloud.scale = 1
		
		currentMult.Scene3.StormCloudDark.x     = 250
		currentMult.Scene3.StormCloudDark.y     = lerp (180, 380, Ts)
		currentMult.Scene3.StormCloudDark.scale = 1		
		
		currentMult.Scene3.Background.x     = 270+20
		currentMult.Scene3.Background.y     = lerp (90, 258, Ts)       -- 10
		currentMult.Scene3.Background.scale = 1
		
		currentMult.Scene3.BackgroundDark.x     = 270
		currentMult.Scene3.BackgroundDark.y     = lerp (60, 260, Ts)       
		currentMult.Scene3.BackgroundDark.scale = 1
									 
		currentMult.Scene3.RockRight03.x     = 375
		currentMult.Scene3.RockRight03.y     = -100 --lerp (-60, 200, Ts) --190, Ts)       
		currentMult.Scene3.RockRight03.scale = 1
		
		currentMult.Scene3.RockRight03Dark.x     = 375
		currentMult.Scene3.RockRight03Dark.y     = lerp (-60, 190, Ts)       
		currentMult.Scene3.RockRight03Dark.scale = 1
									  
		currentMult.Scene3.RockRight02.x     = 380
		currentMult.Scene3.RockRight02.y     = lerp (8, 185, Ts)       
		currentMult.Scene3.RockRight02.scale = 1
		
		currentMult.Scene3.RockRight02Dark.x     = 380
		currentMult.Scene3.RockRight02Dark.y     = lerp (-20, 185, Ts)       
		currentMult.Scene3.RockRight02Dark.scale = 1
									  
		currentMult.Scene3.RockLeft02.x     = 150
		currentMult.Scene3.RockLeft02.y     = lerp (-35, 160, Ts)       
		currentMult.Scene3.RockLeft02.scale = 1
		
		currentMult.Scene3.RockLeft02Dark.x     = 150
		currentMult.Scene3.RockLeft02Dark.y     = lerp (-55, 160, Ts)       
		currentMult.Scene3.RockLeft02Dark.scale = 1
									 
		currentMult.Scene3.Town.x     = 300
		currentMult.Scene3.Town.y     = lerp (-100, 100, Ts)       
		currentMult.Scene3.Town.scale = 1
		
		currentMult.Scene3.TownDark.x     = 300
		currentMult.Scene3.TownDark.y     = lerp (-120, 100, Ts)       
		currentMult.Scene3.TownDark.scale = 1
							   
		currentMult.Scene3.RockRight01.x     = 352
		currentMult.Scene3.RockRight01.y     = lerp (-167, 135, Ts)       
		currentMult.Scene3.RockRight01.scale = 1	
		
		currentMult.Scene3.RockRight01Dark.x     = 352
		currentMult.Scene3.RockRight01Dark.y     = lerp (-135, 135, Ts)       
		currentMult.Scene3.RockRight01Dark.scale = 1
									  
		currentMult.Scene3.RockLeft01.x     = 128
		currentMult.Scene3.RockLeft01.y     = lerp (-230, 130, Ts)       
		currentMult.Scene3.RockLeft01.scale = 1
		
		currentMult.Scene3.RockLeft01Dark.x     = 128
		currentMult.Scene3.RockLeft01Dark.y     = lerp (-230, 130, Ts)       
		currentMult.Scene3.RockLeft01Dark.scale = 1			
	
	--	Effects03(timeScene, 255)		
	end 
	
	currentMult.Scene3.Rain.color = Color (255, 255, 255, 0)	
end      

function Scene3Show()
	currentMult.Scene3.layer.isVisible = true
	currentMult.Effect01.Sun1:Do("Reset")
	currentMult.Effect03.RainRight:Do("Reset")		
	currentMult.Effect03.BackgroundRain:Do("Reset")		
	currentMult.Effect03_cloud.DarkClouds3:Do("Reset")		
	currentMult.Effect03.Vulkan:Do("Reset")		
end 

function Scene3Hide()
	currentMult.Scene3.layer.isVisible = false
	currentMult.Effect03.RainRight:Do("Finish")		
	currentMult.Effect03.BackgroundRain:Do("Finish")		
	currentMult.Effect03_cloud.DarkClouds3:Do("Finish")		
	currentMult.Effect03.Vulkan:Do("Finish")		
end 
