|
|
- WelecomeView = WelecomeView or BaseClass(BaseView)
-
- function WelecomeView:__init()
- self.base_file = "welecome"
- self.layout_file = "WelecomeView"
- self.layer_name = "Activity"
- self.close_mode = CloseMode.CloseDestroy
- self.destroy_imm = true
- self.hide_maincancas = false
- self.use_background = true
- self.background_alpha = 0
- self.is_set_zdepth = true
- self.gril_anima = "sheep"
- self.model = AutoFightManager:getInstance()
- -- self:AddPreLoadList("ui_anniu_chongdianxiaoqian",{"ui_anniu_chongdianxiaoqian"})
- self:AddPreLoadList("ui_huadongyindao02",{"ui_huadongyindao02"})
- self:AddPreLoadList(self.gril_anima,{self.gril_anima})
- self.load_callback = function ()
- self:LoadSuccess()
- self:InitEvent()
- end
- self.open_callback = function ()
- EventSystem.Fire(GlobalEventSystem,EventName.STOPAUTOFIGHT, false, true)
-
- local main_role = Scene.Instance.main_role
- if main_role and not main_role:IsInState(PoseState.STAND) then
- main_role:DoStand()
- GlobalEventSystem:Fire(EventName.FORCE_STOP_DO_TASK)
- end
-
- local load_finish_fun = function()
- self:AddUIEffect("ui_huadongyindao02", self.effect2, self.layer_name, {x=25, y=-36}, {x = 1, y = 1}, true, nil, nil, nil)
- end
- self:AddUIEffect("ui_kaishimaoxian", self.effect, self.layer_name, nil, {x = 1, y = 1}, true, nil, nil, nil, load_finish_fun)
- end
- self.destroy_callback = function ()
- self:Clear()
- end
- --self.use_local_view = true
- end
-
- function WelecomeView:Clear()
- if self.effect then
- self:ClearUIEffect(self.effect)
- end
-
- if self.anima then
- destroy(self.anima)
- self.anima = nil
- end
- end
-
- function WelecomeView:LoadSuccess()
- self.startBtn = self:GetChild("startBtn").gameObject
- self.click_bg = self:GetChild("click_bg").gameObject
- self.click_bg_tran = self:GetChild("click_bg")
- self.click_bg_tran.sizeDelta = Vector2(ScreenWidth+10,ScreenHeight+10)
- self.effect = self:GetChild("effect")
- self.effect2 = self:GetChild("effect2")
-
- if tonumber(AppConst.EnglineVer) >= 78 then
- local load_back = function(objs)
- if objs and objs[0] then
- self.anima = newObject(objs[0])
- self.anima.transform:SetParent(self.transform)
- SetLocalScale(self.anima.transform, 0.32)
- self.anima.transform.localEulerAngles = Vector3(0, 0, 0)
- SetLocalPosition(self.anima.transform, -236, -336, 0)
- end
- end
- lua_resM:loadPrefab(self,self.gril_anima,self.gril_anima, load_back, ASSETS_LEVEL.HIGHT)
- end
- end
-
- function WelecomeView:InitEvent()
- local function clickHandler(target)
- GlobalEventSystem:Fire(EventName.FORCE_TO_DO_TASK)
- self:Close()
- end
- AddClickEvent(self.startBtn, clickHandler,LuaSoundManager.SOUND_UI.SWITCH)
- AddClickEvent(self.click_bg, clickHandler,LuaSoundManager.SOUND_UI.SWITCH)
- end
|