【玉虚论道】我的编队界面提交
parent
989323916b
commit
94b4d550e5
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 51f0ff5ff61c05b41bf59c8ac27bd122
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -401,7 +401,8 @@ UIName = {
|
|||
FightLevelTrialPanel = 400,--山河试炼
|
||||
XunBaoMiZongPanel = 406, --寻宝迷踪
|
||||
XunBaoMiZongMapPanel = 407, --寻宝迷踪地图界面
|
||||
taiChuMiJuan = 408,
|
||||
taiChuMiJuan = 408, --太初密卷
|
||||
WorldArenaMyTeamPanel = 410, --玉虚论道我的编队
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d3f7a6647e58ac34f9f8ba2b45e31601
|
||||
guid: c22a8d54d4eec6b42b97fa0a38139ec2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1d7a7eab4e1c7394cb5371d76a7fc83d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,105 @@
|
|||
require("Base/BasePanel")
|
||||
local WorldArenaMyTeamPanel = Inherit(BasePanel)
|
||||
|
||||
local function OnBeginDrag(self, Pointgo, data)
|
||||
self.oldGrid = Pointgo.transform.parent.parent
|
||||
self.tempInfo.transform.localPosition = Pointgo.transform.parent.parent.localPosition
|
||||
Pointgo.transform.parent:SetParent(self.tempInfo.transform)
|
||||
Pointgo.transform.parent.localPosition = Vector3.zero
|
||||
end
|
||||
local function OnDrag(self, Pointgo, data)
|
||||
local pos = self.tempInfo.transform.localPosition
|
||||
local y = pos.y + data.delta.y >= -300 and pos.y + data.delta.y or -300
|
||||
y = y <= 500 and y or 500
|
||||
self.tempInfo.transform.localPosition = Vector2.New(pos.x , y)
|
||||
end
|
||||
local function OnEndDrag(self, Pointgo, data)
|
||||
Pointgo.transform.parent.localPosition = Vector3.zero
|
||||
local num = 99999
|
||||
local obj = nil
|
||||
for i = 1, 3 do
|
||||
local dis = math.abs( self.tempInfo.transform.localPosition.y - self.gridList[i].transform.localPosition.y )
|
||||
if dis <= num then
|
||||
num = dis
|
||||
obj = self.gridList[i]
|
||||
end
|
||||
end
|
||||
if obj.transform.childCount > 0 then
|
||||
local targetInfo = obj.transform:GetChild(0)
|
||||
targetInfo:SetParent(self.oldGrid.transform)
|
||||
targetInfo.localPosition = Vector3.zero
|
||||
else
|
||||
obj = self.oldGrid
|
||||
end
|
||||
local curInfo = self.tempInfo.transform:GetChild(0)
|
||||
curInfo:SetParent(obj.transform)
|
||||
curInfo.localPosition = Vector3.zero
|
||||
end
|
||||
|
||||
function WorldArenaMyTeamPanel:InitComponent()
|
||||
self.spLoader = SpriteLoader.New()
|
||||
self.btnBack = Util.GetGameObject(self.gameObject, "Frame/BackBtn")
|
||||
self.mask = Util.GetGameObject(self.gameObject, "mask")
|
||||
self.Content = Util.GetGameObject(self.gameObject, "Frame/Content")
|
||||
self.OnBeginDrag = function(p,d) OnBeginDrag(self,p,d) end
|
||||
self.OnDrag= function(p,d) OnDrag(self,p,d) end
|
||||
self.OnEndDrag= function(p,d) OnEndDrag(self,p,d) end
|
||||
self.tempInfo = Util.GetGameObject(self.Content, "tempInfo")
|
||||
|
||||
self.InfoList = {}
|
||||
self.dragViewList = {}
|
||||
self.triggerList = {}
|
||||
self.gridList = {}
|
||||
for i = 1, 3 do
|
||||
self.gridList[i] = Util.GetGameObject(self.Content, "Grid ("..i..")")
|
||||
self.InfoList[i] = Util.GetGameObject(self.Content, "Grid ("..i..")/Info")
|
||||
self.dragViewList[i] = SubUIManager.Open(SubUIConfig.DragView, self.InfoList[i].transform)
|
||||
self.dragViewList[i].transform:SetSiblingIndex(1)
|
||||
self.triggerList[i]=Util.GetEventTriggerListener(self.dragViewList[i].gameObject)
|
||||
self.triggerList[i].onBeginDrag = self.triggerList[i].onBeginDrag + self.OnBeginDrag
|
||||
self.triggerList[i].onDrag = self.triggerList[i].onDrag + self.OnDrag
|
||||
self.triggerList[i].onEndDrag = self.triggerList[i].onEndDrag + self.OnEndDrag
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function WorldArenaMyTeamPanel:BindEvent()
|
||||
Util.AddClick(self.mask, function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(self.btnBack, function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
end
|
||||
--添加事件监听(用于子类重写)
|
||||
function WorldArenaMyTeamPanel:AddListener()
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function WorldArenaMyTeamPanel:RemoveListener()
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function WorldArenaMyTeamPanel:OnOpen(_playerId)
|
||||
self.playerId = _playerId
|
||||
end
|
||||
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
function WorldArenaMyTeamPanel:OnShow()
|
||||
WorldArenaMyTeamPanel:Refresh()
|
||||
end
|
||||
|
||||
function WorldArenaMyTeamPanel:Refresh()
|
||||
end
|
||||
|
||||
|
||||
function WorldArenaMyTeamPanel:OnClose()
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function WorldArenaMyTeamPanel:OnDestroy()
|
||||
self.spLoader:Destroy()
|
||||
end
|
||||
|
||||
return WorldArenaMyTeamPanel
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 41076af950ad21a43a8dd7ab957f7da9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue