【御剑行】提交

dev_chengFeng
ZhangBiao 2021-10-08 20:49:25 +08:00
parent 81a3db0446
commit 21bdecb465
13 changed files with 2112 additions and 22 deletions

View File

@ -2220,6 +2220,8 @@ GENERAL_POPUP_TYPE={
FourElementReturnLook = 48,--四灵试炼回放界面 FourElementReturnLook = 48,--四灵试炼回放界面
XunBaoMiZong = 46, --寻宝迷踪奖励 XunBaoMiZong = 46, --寻宝迷踪奖励
QiJieTreasure = 50, --七界试炼遗物 QiJieTreasure = 50, --七界试炼遗物
YuJianLastResult = 51, --御剑行上轮奖励
YuJianBet = 52, --御剑行竞猜
} }
--通用信息弹窗类型 --通用信息弹窗类型

View File

@ -226,6 +226,9 @@ ConfigName = {
MServerRankReward="MServerRankReward", MServerRankReward="MServerRankReward",
MServerArenaSetting="MServerArenaSetting", MServerArenaSetting="MServerArenaSetting",
FourQuadrantConfig = "FourQuadrantConfig", FourQuadrantConfig = "FourQuadrantConfig",
RidingSwardConfig = "RidingSwardConfig",
RidingSwardResult = "RidingSwardResult",
RidingSwardSence = "RidingSwardSence",
} }
require "Framework/GameDataBase" require "Framework/GameDataBase"

View File

@ -28,6 +28,10 @@ local contentScripts = {
[GENERAL_POPUP_TYPE.QiJieTreasure] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure"), panelName = "GeneralBigPopup_QiJieTreasure"}, [GENERAL_POPUP_TYPE.QiJieTreasure] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_QiJieTreasure"), panelName = "GeneralBigPopup_QiJieTreasure"},
--寻宝迷踪奖励 --寻宝迷踪奖励
[GENERAL_POPUP_TYPE.XunBaoMiZong] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_XunBaoMiZong"), panelName = "GeneralBigPopup_XunBaoMiZong"}, [GENERAL_POPUP_TYPE.XunBaoMiZong] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_XunBaoMiZong"), panelName = "GeneralBigPopup_XunBaoMiZong"},
--御剑行竞猜
[GENERAL_POPUP_TYPE.YuJianLastResult] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YuJianLastResult"), panelName = "GeneralBigPopup_YuJianLastResult"},
--御剑行上轮奖励
[GENERAL_POPUP_TYPE.YuJianBet] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YuJianBet"), panelName = "GeneralBigPopup_YuJianBet"},
} }
--子模块预设 --子模块预设
local contentPrefabs={} local contentPrefabs={}

View File

@ -0,0 +1,27 @@
----- 御剑行竞猜 -----
local this = {}
function this:InitComponent(gameObject)
self.spLoader = SpriteLoader.New()
end
function this:BindEvent()
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow()
end
function this:OnClose()
end
function this:OnDestroy()
self.spLoader:Destroy()
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 60168d445393dc2409f8ee2c1c1b2a95
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
----- --御剑行上轮排名 -----
local this = {}
function this:InitComponent(gameObject)
self.spLoader = SpriteLoader.New()
end
function this:BindEvent()
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow()
end
function this:OnClose()
end
function this:OnDestroy()
self.spLoader:Destroy()
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b00e5ca3eb99c774a9b506151d5754e2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -59,7 +59,17 @@ end
function RiceCtrlView:SetPlayer() function RiceCtrlView:SetPlayer()
for i = 1, 4 do--#playerDataList do for i = 1, 4 do--#playerDataList do
self.playerRoadList[i] = {} self.playerRoadList[i] = {}
self.playerRoadList[i] = SubUIManager.Open(SubUIConfig.PlayerRiceView,self.roadList.transform,i)--playerDataList[i]) local data
if i == 1 then
data = playerDataList.Line1
elseif i == 2 then
data = playerDataList.Line2
elseif i == 3 then
data = playerDataList.Line3
elseif i == 4 then
data = playerDataList.Line4
end
self.playerRoadList[i] = SubUIManager.Open(SubUIConfig.PlayerRiceView,self.roadList.transform,i,data)
end end
end end

View File

@ -1,4 +1,6 @@
local RiceSinglePlayerView = {} local RiceSinglePlayerView = {}
local initSpeed = 20
local RidingSwardSence = ConfigManager.GetConfig(ConfigName.RidingSwardSence)
function RiceSinglePlayerView:New(gameObject) function RiceSinglePlayerView:New(gameObject)
local b = {} local b = {}
@ -14,7 +16,7 @@ function RiceSinglePlayerView:InitComponent()
self.playerTrans = self.player:GetComponent("RectTransform") self.playerTrans = self.player:GetComponent("RectTransform")
self.playerTrans.localPosition = Vector2.New(0,100) self.playerTrans.localPosition = Vector2.New(0,100)
self.curPosX = self.playerTrans.localPosition.x self.curPosX = self.playerTrans.localPosition.x
self.speed = 10 self.speed = initSpeed
FixedUpdateBeat:Add(self.OnUpdate, self)--长按方法注册 FixedUpdateBeat:Add(self.OnUpdate, self)--长按方法注册
end end
@ -31,12 +33,23 @@ end
--设置游戏状态 --设置游戏状态
function RiceSinglePlayerView:SetSinglePlayerState(_state) function RiceSinglePlayerView:SetSinglePlayerState(_state)
local keyFrame = RidingSwardSence[self.data[1]].KeyFrame
self.keyFrameList = {}
for i = 1, #keyFrame do
self.keyFrameList[i] = {}
self.keyFrameList[i].pos = keyFrame[i][1]*initSpeed*30
self.keyFrameList[i].value = keyFrame[i][2]
end
for i,v in ipairs(self.keyFrameList) do
LogRed(string.format( "在:%s位置处效果%s",v.pos,v.value))
end
self.isRunning = _state self.isRunning = _state
end end
--重置游戏 --重置游戏
function RiceSinglePlayerView:ResetSinglePlayer() function RiceSinglePlayerView:ResetSinglePlayer()
self.isRunning = false self.isRunning = false
self.speed = initSpeed
self.playerTrans.localPosition = Vector2.New(0,100) self.playerTrans.localPosition = Vector2.New(0,100)
self.curPosX = self.playerTrans.localPosition.x self.curPosX = self.playerTrans.localPosition.x
end end
@ -45,18 +58,39 @@ end
--upDate --upDate
function RiceSinglePlayerView:OnUpdate() function RiceSinglePlayerView:OnUpdate()
if self.isRunning then if self.isRunning then
-- LogGreen(self.data.." curPosX:"..tostring(self.curPosX)) if self.index == 1 then
self.curPosX = self.curPosX + self.speed + self.data LogYellow("self.speed:"..tostring(self.speed))
self.player.transform.localPosition = Vector2.New(self.curPosX,100) end
if self.curPosX >= 8500 then
YuJianXingManager.FinishResetGame()
else
self.curPosX = self.curPosX + self.speed
self.player.transform.localPosition = Vector2.New(self.curPosX,100)
-- for k,v in pairs(self.keyFrameList) do
for i,v in ipairs(self.keyFrameList) do
if self.curPosX >= v.pos then
if v == 1 then
self.speed = self.speed*1.2
table.remove( self.keyFrameList,i)
elseif v == 2 then
self.speed = self.speed*0.9
table.remove( self.keyFrameList,i)
end
end
end
end
end end
end end
--返回当前位置
function RiceSinglePlayerView:GetCurPosX() function RiceSinglePlayerView:GetCurPosX()
return self.curPosX return self.curPosX
end end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
function RiceSinglePlayerView:OnOpen(_data) function RiceSinglePlayerView:OnOpen(_inedx,_data)
self.index = _inedx
self.data = _data self.data = _data
end end

View File

@ -6,16 +6,18 @@ local bgList = {"y_yujianxing_bg","y_yujianxing_bg","y_yujianxing_bg","y_yujianx
function this.Initialize() function this.Initialize()
this.curState = 0 --当前比赛状态 this.curState = 0 --当前比赛状态
this.nextSession = 0 --当前比赛场次 this.nextSession = 0 --当前比赛场次
this.curRankId = 0 --当前排行剧本Id this.curResultId = 1 --当前剧本Id
this.curRecordList = 0 --当前纪录数据 this.curRecordList = 0 --当前纪录数据
this.curBetList = 0 --当前竞猜数据 this.curBetList = 0 --当前竞猜数据
this.CloseMap()
end end
--初始化地图 --初始化地图
function this.OpenMap() function this.OpenMap()
local playerData = ConfigManager.GetConfigDataByKey(ConfigName.RidingSwardResult,"Id",this.curResultId)
if not this.riceCtrl then if not this.riceCtrl then
this.riceCtrl = riceCtrl:New() this.riceCtrl = riceCtrl:New()
this.riceCtrl:Awake(bgList) this.riceCtrl:Awake(bgList,playerData)
end end
if this.timer then if this.timer then
this.timer:Stop() this.timer:Stop()
@ -25,21 +27,18 @@ end
--销毁地图--正常 --销毁地图--正常
function this.CloseMap() function this.CloseMap()
if this.riceCtrl then
this.timer = Timer.New(function ()
this.riceCtrl:Dispose()
this.riceCtrl = nil
end,1)
this.timer:Start()
end
end
--销毁地图--立刻
function this.DestroyMap()
if this.riceCtrl then if this.riceCtrl then
this.riceCtrl:Dispose() this.riceCtrl:Dispose()
this.riceCtrl = nil this.riceCtrl = nil
end end
end end
-- --销毁地图--立刻
-- function this.DestroyMap()
-- if this.riceCtrl then
-- this.riceCtrl:Dispose()
-- this.riceCtrl = nil
-- end
-- end
--更新服务器信息 --更新服务器信息
function this.UpdataServerData(msg) function this.UpdataServerData(msg)
@ -51,6 +50,14 @@ function this.SetGameState(_state)
this.riceCtrl:SetGameState(_state) this.riceCtrl:SetGameState(_state)
end end
--游戏结束 重置
function this.FinishResetGame()
Timer.New(function ()
UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.YuJianLastResult)
this.ResetGame()
end,0.3):Start()
end
--重置游戏 --重置游戏
function this.ResetGame() function this.ResetGame()
this.riceCtrl:ResetGame() this.riceCtrl:ResetGame()

View File

@ -39,7 +39,7 @@ function YuJianXingPanel:BindEvent()
end) end)
Util.AddOnceClick(self.btnBet,function () Util.AddOnceClick(self.btnBet,function ()
PopupTipPanel.ShowTip("前往竞猜") UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.YuJianBet)
end) end)
Util.AddOnceClick(self.btnRecord,function () Util.AddOnceClick(self.btnRecord,function ()
@ -47,7 +47,7 @@ function YuJianXingPanel:BindEvent()
end) end)
Util.AddOnceClick(self.btnRank,function () Util.AddOnceClick(self.btnRank,function ()
PopupTipPanel.ShowTip("上一场排名") UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.YuJianLastResult)
end) end)
Util.AddOnceClick(self.btnStore,function () Util.AddOnceClick(self.btnStore,function ()
@ -93,7 +93,7 @@ end
--界面销毁时调用(用于子类重写) --界面销毁时调用(用于子类重写)
function YuJianXingPanel:OnDestroy() function YuJianXingPanel:OnDestroy()
YuJianXingManager.DestroyMap() -- YuJianXingManager.DestroyMap()
end end
return YuJianXingPanel return YuJianXingPanel

View File

@ -39,7 +39,6 @@ function JumpView:OnOpen(jumpId,isRewardItemPop,parent)
self.info.text=GetLanguageStrById(self.jumpSData.Title) self.info.text=GetLanguageStrById(self.jumpSData.Title)
self.btnSureText.text = Language[10556] self.btnSureText.text = Language[10556]
Util.AddOnceClick(self.btnSure, function() Util.AddOnceClick(self.btnSure, function()
YuJianXingManager.DestroyMap()
self:GoToJumpData() self:GoToJumpData()
if parent then if parent then
parent:ClosePanel() parent:ClosePanel()