117 lines
4.3 KiB
Lua
117 lines
4.3 KiB
Lua
------------------------------------------------
|
|
--作者: 杨全福
|
|
--日期: 2019-06-21
|
|
--文件: LvDuPlaneCopyLogic.lua
|
|
--模块: LvDuPlaneCopyLogic
|
|
--描述: 绿毒副本
|
|
------------------------------------------------
|
|
|
|
local LvDuPlaneCopyLogic = {
|
|
Parent = nil,
|
|
VfxGo = nil,
|
|
IsFinish = false,
|
|
LeaveTimer = 0,
|
|
}
|
|
|
|
function LvDuPlaneCopyLogic: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
|
|
GameCenter.MapLogicSwitch.HoldFighting = true
|
|
|
|
self.IsFinish = false
|
|
self.LeaveTimer = 0
|
|
|
|
local root = GameObject.Find("SceneRoot").transform;
|
|
if root ~= nil then
|
|
local _vfxTrans = root:Find("[vfx]/[near]/m_603changjingFX")
|
|
if _vfxTrans ~= nil then
|
|
self.VfxGo = _vfxTrans.gameObject;
|
|
end
|
|
end
|
|
|
|
--关掉菜单
|
|
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_CLOSE_MAINMENU)
|
|
--打开副本主界面
|
|
GameCenter.PushFixEvent(UIEventDefine.UIPlaneCopyMainForm_OPEN, self.Parent.MapCfg.MapId);
|
|
|
|
GameCenter.RegFixEventHandle(LogicEventDefine.EID_EVENT_ONMONSTER_BRITHVFX_PLAYED, self.OnBossBorn, self);
|
|
end
|
|
|
|
function LvDuPlaneCopyLogic:OnLeaveScene()
|
|
if self.VfxGo ~= nil then
|
|
self.VfxGo:SetActive(false);
|
|
end
|
|
GameCenter.PushFixEvent(UIEventDefine.UIPlaneCopyMainForm_CLOSE);
|
|
GameCenter.UnRegFixEventHandle(LogicEventDefine.EID_EVENT_ONMONSTER_BRITHVFX_PLAYED, self.OnBossBorn, self);
|
|
end
|
|
|
|
function LvDuPlaneCopyLogic:OnMsgHandle(msg)
|
|
if msg.MsgID == GameCenter.Network.GetMsgID("MSG_copyMap.ResCopyMapBitFinish") then
|
|
self.IsFinish = true
|
|
self.LeaveTimer = 2
|
|
end
|
|
end
|
|
|
|
function LvDuPlaneCopyLogic: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 LvDuPlaneCopyLogic:OnBossBorn(obj, sender)
|
|
if self.VfxGo ~= nil then
|
|
self.VfxGo:SetActive(true);
|
|
end
|
|
end
|
|
|
|
function LvDuPlaneCopyLogic: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 LvDuPlaneCopyLogic:GetMainLeftUIState()
|
|
return {
|
|
[MainLeftSubPanel.Task] = true, --任务分页
|
|
[MainLeftSubPanel.Team] = true, --队伍分页
|
|
[MainLeftSubPanel.Other] = false, --其他分页
|
|
}
|
|
end
|
|
|
|
return LvDuPlaneCopyLogic; |