local createCompositionKranik = nil
local createCompositionKranik2 = nil
---------------------------------------------------------------------------------------
local PREFIX_PATH = "data/Texture/Scenes/06_garden/hp/anim/valve/"
---------------------------------------------------------------------------------------
function Loader_06_HP_Valve_Animations(parent)
	return CreateAnimationLoadingRoutine(parent, PREFIX_PATH,
		{
                CreateCompositionLoader(createCompositionKranik,		                'valve',		        0,0, 13, 512,384, false),
    			CreateCompositionLoader(createCompositionKranik2,		                'valve2',		        0,0, 13, 512,384, false),
		},
		{
			function (element, textureName)
				if textureName == "kranik_anim_[].png" then
					local anim = element:GetTexture()
					anim:SetFrames(2)
					anim:SetTextureRect(0,0,54,44)
					anim:SetSpeed(12)
					anim:SetMode(HGEANIM_FWD + HGEANIM_LOOP)
					anim:Play()
				end
			end,
		});
end
---------------------------------------------------------------------------------------
createCompositionKranik = function()
	local compositionKranik = CreateCompositionSequence()
	local compositionDuration = 2.5
	compositionKranik:SetDuration(compositionDuration)
 
	local element
	local effector
 
	-- Layer Layer_1
	element = CreateCompositionElement(PREFIX_PATH.."kranik_anim_[].png")
	element:SetName("Layer_1")
	compositionKranik:AddElement(element)
	element:SetHotSpot(27, 22)
	element:SetParentElement(compositionKranik)
	element:SetXY(618, 431)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(1.5, 2.5)
	effector:Play()
 
 
	-- Layer Layer_2
	element = CreateCompositionElement(PREFIX_PATH.."kranik_anim_01.png")
	element:SetName("Layer_2")
	compositionKranik:AddElement(element)
	element:SetHotSpot(27, 22)
	element:SetParentElement(compositionKranik)
	element:SetXY(618, 431)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(1, 1.5)
	effector:Play()
 
 
	-- Layer Layer_3
	element = CreateCompositionElement(PREFIX_PATH.."kranik_anim_[].png")
	element:SetName("Layer_3")
	compositionKranik:AddElement(element)
	element:SetHotSpot(27, 22)
	element:SetParentElement(compositionKranik)
	element:SetXY(618, 431)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 1)
	effector:Play()
 
	compositionKranik:Play()
 
	return compositionKranik
end
 
createCompositionKranik2 = function()
	local compositionKranik2 = CreateCompositionSequence()
	local compositionDuration = 2.5
	compositionKranik2:SetDuration(compositionDuration)
 
	local element
	local effector
 
	-- Layer Layer_1
	element = CreateCompositionElement(PREFIX_PATH.."kranik_anim_[].png")
	element:SetName("Layer_1")
	compositionKranik2:AddElement(element)
	element:SetHotSpot(27, 22)
	element:SetParentElement(compositionKranik2)
	element:SetXY(618, 431)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(1.5, 2.5)
	effector:Play()
 
 
	-- Layer Layer_2
	element = CreateCompositionElement(PREFIX_PATH.."kranik_anim_01.png")
	element:SetName("Layer_2")
	compositionKranik2:AddElement(element)
	element:SetHotSpot(27, 22)
	element:SetParentElement(compositionKranik2)
	element:SetXY(618, 431)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(1, 1.5)
	effector:Play()
 
 
	-- Layer Layer_3
	element = CreateCompositionElement(PREFIX_PATH.."kranik_anim_[].png")
	element:SetName("Layer_3")
	compositionKranik2:AddElement(element)
	element:SetHotSpot(27, 22)
	element:SetParentElement(compositionKranik2)
	element:SetXY(618, 431)
 
 
	effector = element:GetEffector()
	effector:SetLifeTime(0, 1)
	effector:Play()
 
	compositionKranik2:Play()
 
	return compositionKranik2
end
 
