------------------------------------------------ --作者: 杨全福 --日期: 2019-04-15 --文件: PlaneCopyLogic.lua --模块: PlaneCopyLogic --描述: 位面副本逻辑 ------------------------------------------------ local PlaneCopyLogic = { Parent = nil, IsFinish = false, LeaveTimer = 0, } function PlaneCopyLogic:OnEnterScene(parent) self.Parent = parent --设置开关 GameCenter.MapLogicSwitch.CanRide = false GameCenter.MapLogicSwitch.CanFly = false GameCenter.MapLogicSwitch.CanRollDoge = true GameCenter.MapLogicSwitch.CanMandate = true GameCenter.MapLogicSwitch.CanOpenTeam = false GameCenter.MapLogicSwitch.ShowNewFunction = false GameCenter.MapLogicSwitch.UseAutoStrikeBack = true GameCenter.MapLogicSwitch.CanTeleport = false GameCenter.MapLogicSwitch.IsCopyMap = true GameCenter.MapLogicSwitch.IsPlaneCopyMap = true self.IsFinish = false self.LeaveTimer = 0 --关掉菜单 GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_CLOSE_MAINMENU) --打开副本主界面 GameCenter.PushFixEvent(UIEventDefine.UIPlaneCopyMainForm_OPEN, self.Parent.MapCfg.MapId); --进入就开始挂机 if GameCenter.MapLogicSwitch.CanMandate then GameCenter.MapLogicSwitch.HoldFighting = true GameCenter.MandateSystem:Start() else GameCenter.MapLogicSwitch.HoldFighting = false end GameCenter.RegFixEventHandle(LogicEventDefine.EID_EVENT_ON_LP_DEAD, self.OnLPDead, self) end function PlaneCopyLogic:OnLeaveScene() GameCenter.UnRegFixEventHandle(LogicEventDefine.EID_EVENT_ON_LP_DEAD, self.OnLPDead, self) GameCenter.PushFixEvent(UIEventDefine.UIPlaneCopyMainForm_CLOSE); --进入就开始挂机 GameCenter.MandateSystem:End(); GameCenter.MapLogicSwitch.HoldFighting = true GameCenter.MapLogicSwitch.CanMandate = true end function PlaneCopyLogic:OnMsgHandle(msg) if msg.MsgID == GameCenter.Network.GetMsgID("MSG_copyMap.ResCopyMapBitFinish") then self.IsFinish = true self.LeaveTimer = 0.5 end end function PlaneCopyLogic:OnLPDead(obj, sender) GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_INITIATIVE_EXIT_PLANECOPY) GameCenter.PushFixEvent(UILuaEventDefine.UIPanelCopyFailedForm_OPEN) GameCenter.TaskController:Stop() end function PlaneCopyLogic:Update(dt) if self.IsFinish then self.LeaveTimer = self.LeaveTimer - dt if self.LeaveTimer <= 0 then --if GameCenter.MapLogicSwitch:PlaneEndEffectIsFinish(false) then self.IsFinish = false GameCenter.MapLogicSystem:SendLeaveMapMsg(false) --end end end end function PlaneCopyLogic:GetMainUIState() return { [MainFormSubPanel.PlayerHead] = true, --主角头像 [MainFormSubPanel.TargetHead] = true, --目标头像 [MainFormSubPanel.TopMenu] = true, --顶部菜单 [MainFormSubPanel.MiniMap] = true, --小地图 [MainFormSubPanel.FlySwordGrave] = true, --境界 [MainFormSubPanel.TaskAndTeam] = true, --任务和组队 [MainFormSubPanel.Joystick] = true, --摇杆 [MainFormSubPanel.Exp] = true, --经验 [MainFormSubPanel.MiniChat] = true, --小聊天框 [MainFormSubPanel.Skill] = true, --技能 [MainFormSubPanel.SelectPkMode] = true, --选择PK模式 [MainFormSubPanel.FunctionFly] = true, --新功能开启飞行界面 [MainFormSubPanel.FastPrompt] = true, --快速提醒界面 [MainFormSubPanel.FastBts] = true, --快速操作按钮界面 [MainFormSubPanel.Ping] = true, --ping [MainFormSubPanel.SkillWarning] = false, --技能释放警示 [MainFormSubPanel.CustomBtn] = true, --自定义按钮 [MainFormSubPanel.SitDown] = false, --打坐 [MainFormSubPanel.RemotePlayerHead] = true, --远程玩家头像 [MainFormSubPanel.ChangeSkill] = true, --变身技能 } end function PlaneCopyLogic:GetMainLeftUIState() return { [MainLeftSubPanel.Task] = true, --任务分页 [MainLeftSubPanel.Team] = true, --队伍分页 [MainLeftSubPanel.Other] = false, --其他分页 } end return PlaneCopyLogic;