Files
Main/Assets/GameAssets/Resources/Lua/Logic/Nature/NatureFlySwordData.lua

111 lines
3.3 KiB
Lua
Raw Normal View History

2025-01-25 04:38:09 +08:00
--作者: HJ
--日期: 2020-05-21
--文件: NatureFlySwordData.lua
--模块: NatureFlySwordData
--描述: 飞剑系统子类继承NatureBaseData
------------------------------------------------
local NatureBase = require "Logic.Nature.NatureBaseData"
local SkillSetDate = require "Logic.Nature.NatureSkillSetData"
local ModelData= require "Logic.Nature.NatureBaseModelData"
local FashionData = require "Logic.Nature.NatureFashionData"
local NatureFlySwordData = {
Cfg = nil , --翅膀配置表数据
IsMax = 0, --翅膀最大等级
super = nil, --父类对象
}
function NatureFlySwordData:New()
local _obj = NatureBase:New(NatureEnum.FlySword)
local _M = Utils.DeepCopy(self)
_M.super = _obj
return _M
end
--初始化
function NatureFlySwordData:Initialize()
--初始化化形数据
DataConfig.DataHuaxingFlySword:Foreach(function(k, v)
if v.IfShow and v.IfShow == 1 then
local _data = FashionData:New(v)
self.super.FishionList:Add(_data)
end
end)
self.super.FishionList:Sort(
function(a,b)
return tonumber(a.ModelId) < tonumber(b.ModelId)
end
)
end
--反初始化
function NatureFlySwordData:UnInitialize()
self.Cfg = nil
self.super = nil
self.IsMax = 0
end
--初始化服务器数据
function NatureFlySwordData:InitWingInfo(msg)
if msg then
if msg.huaxinList then
if msg.curUseHuaxin then
self.super.CurModel = msg.curUseHuaxin.modelID
end
self.super:UpDataFashionInfos(msg.huaxinList) --设置化形
self.super:UpDateFashionHit(FunctionStartIdCode.RealmHuaxing)
end
end
end
--更新化形升级结果
function NatureFlySwordData:UpDateFashionInfo(msg)
if msg and msg.curUseHuaxin then
local _config = DataConfig.DataHuaxingFlySword[msg.curUseHuaxin.modelID]
self.super:UpDataFashion(msg.curUseHuaxin, _config)
self.super:UpDateFashionHit(FunctionStartIdCode.RealmHuaxing)
if msg.type == 1 or msg.type == 3 then
self.super.CurModel = msg.curUseHuaxin.modelID
end
GameCenter.PushFixEvent(LogicLuaEventDefine.NATURE_EVENT_WING_UPDATEFASHION,msg.curUseHuaxin.modelID)
end
end
--功能函数!!!!!!!!!!!!!!!
--获取模型相机大小
function NatureFlySwordData:Get3DUICamerSize(modelid)
local _info = DataConfig.DataHuaxingFlySword[modelid]
if _info then
return _info.CameraSize
end
return self.super:GetCameraSize(modelid)
end
function NatureFlySwordData:GetModelYPosition(modelid)
local _info = DataConfig.DataHuaxingFlySword[modelid]
if _info and _info.ModelYPos then
return _info.ModelYPos / self:Get3DUICamerSize(modelid)
end
return 0
end
function NatureFlySwordData:GetModelRoteZPosition(modelid)
local _info = DataConfig.DataHuaxingFlySword[modelid]
if _info and _info.ModelRZPos then
return _info.ModelRZPos
end
return 0
end
function NatureFlySwordData:GetModelPosition(modelid)
local _info = DataConfig.DataHuaxingFlySword[modelid]
if _info and _info.ModelYPos and _info.ModelXPos then
return Vector3(_info.ModelXPos / _info.CameraSize, _info.ModelYPos / _info.CameraSize, 0)
end
return 0
end
return NatureFlySwordData