class 'p01_l08_morf'(Script)

function p01_l08_morf:__init()super()


self.arrObject01={}
self.arrObject02={}
self.arrControler01={}
self.arrControler02={}

self.arrParams01={}
self.arrParams02={}
self.arrCureentParms={}
end

function p01_l08_morf:on_attach()
    self.animator01=anims_morf()
    self.animator02=anims_morf()
    local scene=self:scene()
    self.arrObject01[1]=scene:object('morph01')


    self.arrObject02[1]=scene:object('morph02')
    self.arrObject02[2]=scene:object('ventil')
    self.arrObject02[3]=scene:object('ventil_stick')

    self.click=scene:object('use_morf')


    for i=1,#self.arrObject01 do
        self.arrParams01[i]={timeGrow=0,timeReductionMax=0,timeIdle=0,timeReductionMin=0,
            start_timeGrow=4,start_timeReductionMax=9,start_timeIdle=9,start_timeReductionMin=2,
            time=0,minAlpha=0,maxAlpha=1,alpha=0,startAlpha=0,time_wate=0}
    end

    for j=1,#self.arrObject02 do
       self.arrParams02[j]={timeGrow=0,timeReductionMax=0,timeIdle=0,timeReductionMin=0,
                         start_timeGrow=9,start_timeReductionMax=2,start_timeIdle=4,start_timeReductionMin=9,
                         time=0,minAlpha=0,maxAlpha=1,alpha=0,startAlpha=1,time_wate=0}
    end



   self.animator01:setsParamsFicker(self.arrObject01,self.arrParams01)
   self.animator02:setsParamsFicker(self.arrObject02,self.arrParams02)
end
function p01_l08_morf:on_lb_down()
   local scene=self:scene()
   local selected=scene:overed_object()
   if selected then
    if selected:name()== self.click:name() then
      self:complete()
    end
   end
end


function p01_l08_morf:on_update(dt)
    self.animator01:update(dt)
    self.animator02:update(dt)
end

function p01_l08_morf:complete()
    for i=1,#self.arrObject01 do
        self.arrControler01[i]=self:create_controller(self.arrObject01[i])
        self.arrControler01[i]:alpha(0,1)


    end
   for i=1,#self.arrObject02 do
     self.arrControler02[i]=self:create_controller(self.arrObject02[i])
     self.arrControler02[i]:alpha(1,1)
     --self.arrObject02[i]:hide()
    -- self.arrObject02[i]:show(1)
   end

   self:scene():execute_action('c_morf')
end




