【称号坐骑时装】 修改提交
parent
095701c33f
commit
9637337c39
|
|
@ -1,6 +1,6 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1773938178805642000
|
||||
--- !u!1 &89243130255385257
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
|
|
@ -8,23 +8,23 @@ GameObject:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6932949317651037597}
|
||||
- component: {fileID: 7371842824170146327}
|
||||
- component: {fileID: 8973778804028359391}
|
||||
- component: {fileID: 2174688939603908941}
|
||||
- component: {fileID: 7469979320189928875}
|
||||
- component: {fileID: 6759772556053112342}
|
||||
m_Layer: 0
|
||||
m_Name: npc_map
|
||||
m_Name: npc_map_boy
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6932949317651037597
|
||||
--- !u!224 &2174688939603908941
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1773938178805642000}
|
||||
m_GameObject: {fileID: 89243130255385257}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
|
|
@ -37,21 +37,21 @@ RectTransform:
|
|||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7371842824170146327
|
||||
--- !u!222 &7469979320189928875
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1773938178805642000}
|
||||
m_GameObject: {fileID: 89243130255385257}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &8973778804028359391
|
||||
--- !u!114 &6759772556053112342
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1773938178805642000}
|
||||
m_GameObject: {fileID: 89243130255385257}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d85b887af7e6c3f45a2e2d2920d641bc, type: 3}
|
||||
|
|
@ -65,7 +65,7 @@ MonoBehaviour:
|
|||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
skeletonDataAsset: {fileID: 11400000, guid: df18fda9517bbe149807dd2370a5ec52, type: 2}
|
||||
skeletonDataAsset: {fileID: 11400000, guid: 562a97ae093228b4292e6d014614c8d2, type: 2}
|
||||
initialSkinName: default
|
||||
initialFlipX: 0
|
||||
initialFlipY: 0
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a83b259ad6308c0438fc673d4b5c849a
|
||||
guid: 903d0a23fb5988849b3ae2a2d860e764
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 91dfc2171cabcbb45a5fdd199acf31d0
|
||||
guid: c9114030d2ee7314ea097e0e3d71514f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
npc_map.png
|
||||
npc_map_boy.png
|
||||
size: 1024,1024
|
||||
format: RGBA8888
|
||||
filter: Linear,Linear
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 55446c81e8e877d46a06a2ffaacebfb3
|
||||
guid: 50239e0a793830741808078467df08f6
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
Before Width: | Height: | Size: 495 KiB After Width: | Height: | Size: 495 KiB |
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e9d5deb31374e724aa3049c3c5582557
|
||||
guid: f8c00ee3a4e9d35468bfd7e5e04ab522
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
|
|
@ -75,7 +75,7 @@ TextureImporter:
|
|||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: f6e2b2a19ecab4744a8febeb409e6e9a
|
||||
spriteID: bfdd412c6c06a1c4186542b1b360d165
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 61e4f1d4dfbfd2f4d90edeff45238e27
|
||||
guid: 94c46000d9317434a9c9d3c493d3e070
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
|
@ -10,8 +10,8 @@ MonoBehaviour:
|
|||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a6b194f808b1af6499c93410e504af42, type: 3}
|
||||
m_Name: npc_map_Atlas
|
||||
m_Name: npc_map_boy_Atlas
|
||||
m_EditorClassIdentifier:
|
||||
atlasFile: {fileID: 4900000, guid: 55446c81e8e877d46a06a2ffaacebfb3, type: 3}
|
||||
atlasFile: {fileID: 4900000, guid: 50239e0a793830741808078467df08f6, type: 3}
|
||||
materials:
|
||||
- {fileID: 2100000, guid: 96310d409aca2ad47986bbfb4dfbc122, type: 2}
|
||||
- {fileID: 2100000, guid: 6719379fde3b2b646a1b525e069b69cd, type: 2}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a7f1ea032e2d4aa41b6575cfcf77b292
|
||||
guid: a35ea0640c94e314aa52f747c9a8f4f1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
|
|
@ -7,7 +7,7 @@ Material:
|
|||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: npc_map_Material
|
||||
m_Name: npc_map_boy_Material
|
||||
m_Shader: {fileID: 4800000, guid: 1e8a610c9e01c3648bac42585e5fc676, type: 3}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 4
|
||||
|
|
@ -20,7 +20,7 @@ Material:
|
|||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: e9d5deb31374e724aa3049c3c5582557, type: 3}
|
||||
m_Texture: {fileID: 2800000, guid: f8c00ee3a4e9d35468bfd7e5e04ab522, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 96310d409aca2ad47986bbfb4dfbc122
|
||||
guid: 6719379fde3b2b646a1b525e069b69cd
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
|
|
@ -10,12 +10,12 @@ MonoBehaviour:
|
|||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f1b3b4b945939a54ea0b23d3396115fb, type: 3}
|
||||
m_Name: npc_map_SkeletonData
|
||||
m_Name: npc_map_boy_SkeletonData
|
||||
m_EditorClassIdentifier:
|
||||
atlasAssets:
|
||||
- {fileID: 11400000, guid: a7f1ea032e2d4aa41b6575cfcf77b292, type: 2}
|
||||
- {fileID: 11400000, guid: a35ea0640c94e314aa52f747c9a8f4f1, type: 2}
|
||||
scale: 0.01
|
||||
skeletonJSON: {fileID: 4900000, guid: 61e4f1d4dfbfd2f4d90edeff45238e27, type: 3}
|
||||
skeletonJSON: {fileID: 4900000, guid: 94c46000d9317434a9c9d3c493d3e070, type: 3}
|
||||
fromAnimation: []
|
||||
toAnimation: []
|
||||
duration: []
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: df18fda9517bbe149807dd2370a5ec52
|
||||
guid: 562a97ae093228b4292e6d014614c8d2
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
|
|
@ -2328,10 +2328,17 @@ PLAYER_WALK_DIR = {
|
|||
RIDE_WALK_DIR = {
|
||||
IDLE_FRONT = {animation = "idle2", y = 0},
|
||||
IDLE_BACK = {animation = "idle3", y = 0},
|
||||
IDLE_RIGHT = {animation = "idle1", y = 0},
|
||||
IDLE_LEFT = {animation = "idle2", y = 0},
|
||||
IDLE_RIGHT = {animation = "idle1", y = 180},
|
||||
IDLE_LEFT = {animation = "idle1", y = 0},
|
||||
RUN_RIGHT = {animation = "run1", y = 180},
|
||||
RUN_LEFT = {animation = "run1", y = 0},
|
||||
RUN_UP = {animation = "run3", y = 0},
|
||||
RUN_DOWN = {animation = "run2", y = 0},
|
||||
}
|
||||
PlayerHeadIconType = {
|
||||
Head = 1,
|
||||
HeadFrame = 2,
|
||||
Designation = 3,
|
||||
Ride = 4,
|
||||
Skin = 5,
|
||||
}
|
||||
|
|
@ -4,9 +4,9 @@ local this = ExpeditionMainPanel
|
|||
local nodeGrid = {}
|
||||
local nodeItemGrid = {}
|
||||
local timer = Timer.New()
|
||||
local npc = ""
|
||||
-- local npc
|
||||
local GetCurNodeInfo = {}--当前操作层数据
|
||||
local SkeletonGraphic--动画组件
|
||||
-- local SkeletonGraphic--动画组件
|
||||
local isPlayerMove = false--是否在播放人物行走动画
|
||||
local isAllHaveAttack = false--是否有状态不一致情况 说明不是失败过 就是未领取圣物状态
|
||||
local nodeGoTable = {}
|
||||
|
|
@ -60,14 +60,21 @@ function ExpeditionMainPanel:InitComponent()
|
|||
end
|
||||
--self.mask = Util.GetGameObject(self.parent, "mask")
|
||||
--self.mask:SetActive(false)
|
||||
npc = NameManager.roleSex == ROLE_SEX.BOY and "live2d_npc_map" or "live2d_npc_map_nv"
|
||||
local scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one * 0.26 or Vector3.one * 0.16
|
||||
self.liveNode = poolManager:LoadLive(npc, Util.GetTransform(self.parent, "playerLive"), scale, Vector3.zero)
|
||||
SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
if SkeletonGraphic then
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
|
||||
-- npc = NameManager.roleSex == ROLE_SEX.BOY and "live2d_npc_map" or "live2d_npc_map_nv"
|
||||
-- local scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one * 0.26 or Vector3.one * 0.16
|
||||
-- self.liveNode = poolManager:LoadLive(npc, Util.GetTransform(self.parent, "playerLive"), scale, Vector3.zero)
|
||||
-- SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
-- if SkeletonGraphic then
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
-- end
|
||||
if self.liveNode then
|
||||
self.liveNode:OnClose()
|
||||
end
|
||||
self.liveNode = PlayerLiveView:New(Util.GetTransform(self.parent, "playerLive"),1)
|
||||
self.liveNode:OnOpen(25,nil,WALK_DIR.IDLE_FRONT)
|
||||
|
||||
self.singlePre = Util.GetGameObject(self.transform, "singlePre")
|
||||
self.grid = Util.GetGameObject(self.transform, "rect/grid")
|
||||
self.Holy = Util.GetGameObject(self.gameObject, "bg/Holy")
|
||||
|
|
@ -279,7 +286,7 @@ function ExpeditionMainPanel:SingleLayNodeShow(go,layNodeListData)
|
|||
end
|
||||
end
|
||||
if self.liveNode then
|
||||
self.liveNode:SetActive(true)--玩家形象立绘
|
||||
self.liveNode.leader:SetActive(true)--玩家形象立绘
|
||||
end
|
||||
if layNodeListData[1].lay == #AllLayNodeList then--最后奖励节点
|
||||
Util.GetGameObject(nodeGo, "itemList"):GetComponent("RectTransform").anchoredPosition = Vector3.New(2,140,0)
|
||||
|
|
@ -555,6 +562,9 @@ function ExpeditionMainPanel:OnClose()
|
|||
timer2:Stop()
|
||||
timer2 = nil
|
||||
end
|
||||
if self.liveNode then
|
||||
self.liveNode:OnClose()
|
||||
end
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
@ -567,10 +577,10 @@ function ExpeditionMainPanel:OnDestroy()
|
|||
-- end
|
||||
--end
|
||||
--live2dList = {}
|
||||
if self.liveNode then
|
||||
poolManager:UnLoadLive(npc, self.liveNode, PoolManager.AssetType.GameObject)
|
||||
self.liveNode = nil
|
||||
end
|
||||
-- if self.liveNode then
|
||||
-- poolManager:UnLoadLive(npc, self.liveNode, PoolManager.AssetType.GameObject)
|
||||
-- self.liveNode = nil
|
||||
-- end
|
||||
layListGrid = {}
|
||||
if UI_effect_ExpeditionReward and curexpeditionNodeConfigIcon then
|
||||
poolManager:UnLoadAsset(curexpeditionNodeConfigIcon, UI_effect_ExpeditionReward, PoolManager.AssetType.GameObject)
|
||||
|
|
@ -599,9 +609,10 @@ function ExpeditionMainPanel:SetCurAlpha(text, a)
|
|||
text.color = color
|
||||
end
|
||||
function ExpeditionMainPanel:PlayerMovePosFun(nodeGo,curItemGo)
|
||||
self.liveNode.transform:SetParent(nodeGo.transform)
|
||||
self.liveNode.transform.localPosition = Vector3.zero
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
self.liveNode.leader.transform:SetParent(nodeGo.transform)
|
||||
self.liveNode.leader.transform.localPosition = Vector3.zero
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
self.liveNode:SetWalkDir(WALK_DIR.IDLE_FRONT)
|
||||
end
|
||||
function ExpeditionMainPanel:SingleNodeInfoIconShow(nodeGo,layNodeData)
|
||||
local infoIcon = Util.GetGameObject(nodeGo, "infoIcon")
|
||||
|
|
@ -644,22 +655,25 @@ function ExpeditionMainPanel:PlayerMoveFun()
|
|||
isPlayerMove = true
|
||||
if not targetPosGoAndData.pos then return end
|
||||
targetPosGoAndData.pos:SetActive(true)
|
||||
self.liveNode.transform:SetParent(targetPosGoAndData.pos.transform)
|
||||
local oldPos = self.liveNode.transform.localPosition
|
||||
self.liveNode.leader.transform:SetParent(targetPosGoAndData.pos.transform)
|
||||
local oldPos = self.liveNode.leader.transform.localPosition
|
||||
local targetPos = targetPosGoAndData.pos.transform.localPosition - Vector3.New(0,69,0)
|
||||
if oldPos.x - targetPos.x > 0 then
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
||||
self.liveNode:SetWalkDir(WALK_DIR.RUN_LEFT)
|
||||
else
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
self.liveNode:SetWalkDir(WALK_DIR.RUN_RIGHT)
|
||||
end
|
||||
--self.mask:SetActive(isPlayerMove)
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
local timeNum = math.abs(oldPos.y - targetPos.y)/350--350/1s
|
||||
--玩家行走
|
||||
self.liveNode.transform:DOLocalMove(targetPos, timeNum, false):OnStart(function ()
|
||||
self.liveNode.leader.transform:DOLocalMove(targetPos, timeNum, false):OnStart(function ()
|
||||
end):OnComplete(function ()
|
||||
--Log("行走完毕")
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
self.liveNode:SetWalkDir(WALK_DIR.IDLE_FRONT)
|
||||
--self.mask:SetActive(isPlayerMove)
|
||||
--隐藏该层级所有形象
|
||||
--播放下落动画
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ local fightAnim = {
|
|||
[4] = "bnoss",
|
||||
[1] = "idle",
|
||||
}
|
||||
local mapNpc = "live2d_npc_map"
|
||||
local mapNpc2 = "live2d_npc_map_nv"
|
||||
local npc, scale
|
||||
-- local mapNpc = "live2d_npc_map"
|
||||
-- local mapNpc2 = "live2d_npc_map_nv"
|
||||
-- local npc
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function FightPointPassMainPanel:InitComponent()
|
||||
|
|
@ -672,11 +672,11 @@ function FightPointPassMainPanel:OnClose()
|
|||
end
|
||||
|
||||
this.animTimer = nil
|
||||
|
||||
if this.liveNode then
|
||||
--Log("==YSP== 删除立绘")
|
||||
poolManager:UnLoadLive(npc, this.liveNode)
|
||||
this.liveNode=nil
|
||||
this.liveNode:OnClose()
|
||||
end
|
||||
if this.liveNode then
|
||||
this.liveNode:OnClose()
|
||||
end
|
||||
if this.timer then
|
||||
this.timer:Stop()
|
||||
|
|
@ -764,11 +764,11 @@ function this.RefreshLittleMap()
|
|||
this.mapImage.sprite=Util.LoadSprite(data.ChapterBg)
|
||||
|
||||
--加载立绘
|
||||
if this.liveNode then
|
||||
return
|
||||
end
|
||||
npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one * 0.14 or Vector3.one * 0.07
|
||||
-- if this.liveNode then
|
||||
-- return
|
||||
-- end
|
||||
-- npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
-- scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one * 0.14 or Vector3.one * 0.07
|
||||
local curLevel = 0
|
||||
if not FightPointPassManager.IsChapterClossState() then
|
||||
curLevel = math.floor(FightPointPassManager.lastPassFightId/10)%100
|
||||
|
|
@ -777,15 +777,25 @@ function this.RefreshLittleMap()
|
|||
end
|
||||
this.btnMapRadarBG.fillAmount = curLevel / curAllLevelNum
|
||||
this.RadarBGText.text = curLevel .."/".. curAllLevelNum
|
||||
this.liveNode = poolManager:LoadLive(npc, this.btnMap.transform, scale, Vector3.New(0,-52.4,0))
|
||||
local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
|
||||
if SkeletonGraphic then
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
if FightPointPassManager.GetRoleDirection()==1 then
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
||||
else
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
end
|
||||
-- this.liveNode = poolManager:LoadLive(npc, this.btnMap.transform, scale, Vector3.New(0,-52.4,0))
|
||||
-- local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
|
||||
-- if SkeletonGraphic then
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
-- if FightPointPassManager.GetRoleDirection()==1 then
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
||||
-- else
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
-- end
|
||||
-- end
|
||||
if this.liveNode then
|
||||
this.liveNode:OnClose()
|
||||
end
|
||||
this.liveNode = PlayerLiveView:New(this.btnMap.transform,1)
|
||||
this.liveNode:OnOpen(10,Vector3.New(0,-40,0))
|
||||
if FightPointPassManager.GetRoleDirection()==1 then
|
||||
this.liveNode:SetWalkDir(WALK_DIR.RUN_LEFT)
|
||||
else
|
||||
this.liveNode:SetWalkDir(WALK_DIR.RUN_RIGHT)
|
||||
end
|
||||
end
|
||||
--检查地图点数据
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ local curMiddleFightId = 0
|
|||
local difficultType = FightDifficultyState.SimpleLevel
|
||||
local curDifficulSData = {}
|
||||
|
||||
local mapNpc = "live2d_npc_map"
|
||||
local mapNpc2 = "live2d_npc_map_nv"
|
||||
local npc, scale
|
||||
-- local mapNpc = "live2d_npc_map"
|
||||
-- local mapNpc2 = "live2d_npc_map_nv"
|
||||
-- local npc, scale
|
||||
--文字描述
|
||||
local chaterInfoList = {}
|
||||
--初始化组件(用于子类重写)
|
||||
|
|
@ -27,17 +27,26 @@ function FightSmallChoosePanel:InitComponent()
|
|||
end
|
||||
self.selectMap = Util.GetGameObject(self.gameObject, "curMap/selectMap")
|
||||
|
||||
npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one or Vector3.one * 0.5
|
||||
-- npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
-- scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one or Vector3.one * 0.5
|
||||
|
||||
self.liveNode = poolManager:LoadLive(npc, Util.GetTransform(self.selectMap, "pos"), scale, Vector3.zero)
|
||||
local SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
if SkeletonGraphic then
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
-- self.liveNode = poolManager:LoadLive(npc, Util.GetTransform(self.selectMap, "pos"), scale, Vector3.zero)
|
||||
-- local SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
-- if SkeletonGraphic then
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
-- if FightPointPassManager.GetRoleDirection()==1 then
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
||||
-- else
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
-- end
|
||||
-- end
|
||||
if self.liveNode == nil then
|
||||
self.liveNode = PlayerLiveView:New(Util.GetTransform(self.selectMap, "pos"),1)
|
||||
self.liveNode:OnOpen(60,Vector3.New(0,40,0))
|
||||
if FightPointPassManager.GetRoleDirection()==1 then
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
||||
self.liveNode:SetWalkDir(WALK_DIR.RUN_LEFT)
|
||||
else
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
self.liveNode:SetWalkDir(WALK_DIR.RUN_RIGHT)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -88,18 +97,27 @@ end
|
|||
|
||||
--初始化界面
|
||||
function FightSmallChoosePanel:OnShowPanelData()
|
||||
-- if self.liveNode == nil then
|
||||
-- npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
-- scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one or Vector3.one * 0.5
|
||||
-- self.liveNode = poolManager:LoadLive(npc, Util.GetTransform(self.selectMap, "pos"), scale, Vector3.zero)
|
||||
-- end
|
||||
-- local SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
-- if SkeletonGraphic then
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
-- if FightPointPassManager.GetRoleDirection()==1 then
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
||||
-- else
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
-- end
|
||||
-- end
|
||||
if self.liveNode == nil then
|
||||
npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one or Vector3.one * 0.5
|
||||
self.liveNode = poolManager:LoadLive(npc, Util.GetTransform(self.selectMap, "pos"), scale, Vector3.zero)
|
||||
end
|
||||
local SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
if SkeletonGraphic then
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
||||
self.liveNode = PlayerLiveView:New(Util.GetTransform(self.selectMap, "pos"),1)
|
||||
self.liveNode:OnOpen(60,Vector3.New(0,40,0))
|
||||
if FightPointPassManager.GetRoleDirection()==1 then
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
||||
self.liveNode:SetWalkDir(WALK_DIR.RUN_LEFT)
|
||||
else
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
||||
self.liveNode:SetWalkDir(WALK_DIR.RUN_RIGHT)
|
||||
end
|
||||
end
|
||||
local curMiddleConFigData = mainLevelSettingConfig[curMiddleFightId]
|
||||
|
|
@ -168,7 +186,9 @@ function FightSmallChoosePanel:SelectRenPos(_parent)
|
|||
end
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function FightSmallChoosePanel:OnClose()
|
||||
|
||||
if self.liveNode then
|
||||
self.liveNode:OnClose()
|
||||
end
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
@ -176,10 +196,10 @@ function FightSmallChoosePanel:OnDestroy()
|
|||
|
||||
--SubUIManager.Close(self.UpView)
|
||||
smallListGo = {}
|
||||
if self.liveNode then
|
||||
poolManager:UnLoadLive(npc, self.liveNode, PoolManager.AssetType.GameObject)
|
||||
self.liveNode = nil
|
||||
end
|
||||
-- if self.liveNode then
|
||||
-- poolManager:UnLoadLive(npc, self.liveNode, PoolManager.AssetType.GameObject)
|
||||
-- self.liveNode = nil
|
||||
-- end
|
||||
end
|
||||
|
||||
return FightSmallChoosePanel
|
||||
|
|
@ -13,19 +13,19 @@ local mainLevelSettingConFig = ConfigManager.GetConfig(ConfigName.MainLevelSetti
|
|||
-- 缩放值
|
||||
local offsetScale = math.min(Screen.width/3241, Screen.height/1920)
|
||||
local rootParent = nil
|
||||
local SkeletonGraphic
|
||||
-- local SkeletonGraphic
|
||||
local curMiddleFightId = 0
|
||||
-- 设置角色行走方向
|
||||
local WALK_DIR = {
|
||||
RIGHT = {animation = "move2", y = 0},
|
||||
LEFT = {animation = "move2", y = 180},
|
||||
UP = {animation = "move3", y = 0},
|
||||
DOWN = {animation = "move", y = 0},
|
||||
}
|
||||
-- local WALK_DIR = {
|
||||
-- RIGHT = {animation = "move2", y = 0},
|
||||
-- LEFT = {animation = "move2", y = 180},
|
||||
-- UP = {animation = "move3", y = 0},
|
||||
-- DOWN = {animation = "move", y = 0},
|
||||
-- }
|
||||
|
||||
local mapNpc = "live2d_npc_map"
|
||||
local mapNpc2 = "live2d_npc_map_nv"
|
||||
local npc, scale
|
||||
-- local mapNpc = "live2d_npc_map"
|
||||
-- local mapNpc2 = "live2d_npc_map_nv"
|
||||
-- local npc, scale
|
||||
|
||||
function this:InitComponent(root)
|
||||
-- 地图点击拖动
|
||||
|
|
@ -33,13 +33,18 @@ function this:InitComponent(root)
|
|||
this.dragCtrl = Util.GetGameObject(root, "mapParent/Ctrl")
|
||||
this.selectMap = Util.GetGameObject(root, "mapParent/selectMap")
|
||||
|
||||
npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one or Vector3.one * 0.5
|
||||
this.liveNode = poolManager:LoadLive(npc, Util.GetTransform(root, "mapParent/selectMap/Image (1)/roleRoot"), scale, Vector3.zero)
|
||||
SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
if SkeletonGraphic then
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
-- npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
-- scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one or Vector3.one * 0.5
|
||||
-- this.liveNode = poolManager:LoadLive(npc, Util.GetTransform(root, "mapParent/selectMap/Image (1)/roleRoot"), scale, Vector3.zero)
|
||||
-- SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
-- if SkeletonGraphic then
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
-- end
|
||||
if this.liveNode then
|
||||
this.liveNode:OnClose()
|
||||
end
|
||||
this.liveNode = PlayerLiveView:New(Util.GetTransform(root, "mapParent/selectMap/Image (1)/roleRoot"),1)
|
||||
this.liveNode:OnOpen(170,Vector3.New(0,40,0),WALK_DIR.IDLE_FRONT)
|
||||
end
|
||||
local IsPlayAni = false
|
||||
local curSmallFightId = 0
|
||||
|
|
@ -85,14 +90,18 @@ function this:LoadMapData()
|
|||
-- 设置镜头的尺寸
|
||||
TileMapController.SetScale(TileMapView.GetMapScale() * offsetScale)
|
||||
|
||||
-- if this.liveNode == nil then
|
||||
-- npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
-- scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one or Vector3.one * 0.5
|
||||
-- this.liveNode = poolManager:LoadLive(npc, Util.GetTransform(root, "mapParent/selectMap/Image (1)/roleRoot"), scale, Vector3.zero)
|
||||
-- SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
-- if SkeletonGraphic then
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
-- end
|
||||
-- end
|
||||
if this.liveNode == nil then
|
||||
npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one or Vector3.one * 0.5
|
||||
this.liveNode = poolManager:LoadLive(npc, Util.GetTransform(root, "mapParent/selectMap/Image (1)/roleRoot"), scale, Vector3.zero)
|
||||
SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
if SkeletonGraphic then
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
end
|
||||
this.liveNode = PlayerLiveView:New(Util.GetTransform(root, "mapParent/selectMap/Image (1)/roleRoot"),1)
|
||||
this.liveNode:OnOpen(170,Vector3.New(0,40,0),WALK_DIR.IDLE_FRONT)
|
||||
end
|
||||
this._BuildFlag = {}
|
||||
this._BuildFlagClick = {}
|
||||
|
|
@ -165,7 +174,7 @@ function this.SetRoleWalk(middleFightId)
|
|||
local targetPos = tagerPos
|
||||
local speed = 5 -- 越大越慢
|
||||
|
||||
this.liveNode.transform:DOLocalMove(targetPos, speed / 5, false):OnStart(function ()
|
||||
this.liveNode.leader.transform:DOLocalMove(targetPos, speed / 5, false):OnStart(function ()
|
||||
this.SetRoleDirAction(targetPos.x, targetPos.y, pos.x, pos.y)
|
||||
end):OnUpdate(function() --TODO:测试速度
|
||||
|
||||
|
|
@ -176,7 +185,8 @@ function this.SetRoleWalk(middleFightId)
|
|||
openPanel:OnRefreshMiddleClick()
|
||||
openPanel:OnRefreshBackClick()
|
||||
end
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
this.liveNode:SetWalkDir(WALK_DIR.IDLE_FRONT)
|
||||
UIManager.OpenPanel(UIName.UnlockCheckpointPopup,FightPointPassManager.curOpenFight)
|
||||
end):SetEase(Ease.Linear)
|
||||
end
|
||||
|
|
@ -186,20 +196,21 @@ function this.SetRoleDirAction(targetU, targetV, u0, v0)
|
|||
local dV = targetV - v0
|
||||
|
||||
if dU > 0 then
|
||||
this.SetWalkDir(WALK_DIR.RIGHT)
|
||||
this.SetWalkDir(WALK_DIR.RUN_RIGHT)
|
||||
elseif dU < 0 then
|
||||
this.SetWalkDir(WALK_DIR.LEFT)
|
||||
this.SetWalkDir(WALK_DIR.RUN_LEFT)
|
||||
elseif dV < 0 then
|
||||
this.SetWalkDir(WALK_DIR.UP)
|
||||
this.SetWalkDir(WALK_DIR.RUN_UP)
|
||||
elseif dV > 0 then
|
||||
this.SetWalkDir(WALK_DIR.DOWN)
|
||||
this.SetWalkDir(WALK_DIR.RUN_DOWN)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function this.SetWalkDir(dir)
|
||||
SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, dir.y, 0)
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, dir.animation, true)
|
||||
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, dir.y, 0)
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, dir.animation, true)
|
||||
this.liveNode:SetWalkDir(dir)
|
||||
end
|
||||
|
||||
-- 单击
|
||||
|
|
@ -255,18 +266,21 @@ function this.AddPointFunc(type, clickTipFunc)
|
|||
flagEventPool[type] = clickTipFunc
|
||||
end
|
||||
function this.SelectRenPos(_parent,ChapterRolePosition)
|
||||
if this.liveNode then
|
||||
this.liveNode:SetActive(true)
|
||||
this.liveNode.transform:SetParent(_parent.transform)
|
||||
this.liveNode.transform.localScale = scale * 0.25
|
||||
this.liveNode:GetComponent("RectTransform").anchoredPosition3D = Vector3.New(ChapterRolePosition[1]+30, ChapterRolePosition[2]-100, 10)
|
||||
if this.liveNode and this.liveNode.leader then
|
||||
this.liveNode.leader:SetActive(true)
|
||||
this.liveNode.leader.transform:SetParent(_parent.transform)
|
||||
-- this.liveNode.leader.transform.localScale = scale * 0.25
|
||||
this.liveNode.leader:GetComponent("RectTransform").anchoredPosition3D = Vector3.New(ChapterRolePosition[1]+30, ChapterRolePosition[2]-100, 10)
|
||||
end
|
||||
end
|
||||
function this:Dispose()
|
||||
-- if this.liveNode then
|
||||
-- this.liveNode.transform:SetParent(Util.GetGameObject(rootParent, "mapParent/selectMap/Image (1)/roleRoot").transform)
|
||||
-- poolManager:UnLoadLive(npc, this.liveNode, PoolManager.AssetType.GameObject)
|
||||
-- this.liveNode = nil
|
||||
-- end
|
||||
if this.liveNode then
|
||||
this.liveNode.transform:SetParent(Util.GetGameObject(rootParent, "mapParent/selectMap/Image (1)/roleRoot").transform)
|
||||
poolManager:UnLoadLive(npc, this.liveNode, PoolManager.AssetType.GameObject)
|
||||
this.liveNode = nil
|
||||
this.liveNode:OnClose()
|
||||
end
|
||||
UIManager.camera.clearFlags = CameraClearFlags.Skybox
|
||||
TileMapView.Exit()
|
||||
|
|
|
|||
|
|
@ -292,6 +292,10 @@ function this.LoadRole(u, v)
|
|||
-- scale = NameManager.roleSex == ROLE_SEX.BOY and 1 or 0.5
|
||||
-- this.NpcGO = poolManager:LoadLive(npc, Util.GetTransform(this.role, "root/ui/roleRoot"), Vector3.one * scale, Vector3.zero)
|
||||
-- this.NpcGO.name = "npc"
|
||||
if this.NpcGO then
|
||||
this.NpcGO:OnClose()
|
||||
this.NpcGO = nil
|
||||
end
|
||||
this.NpcGO = PlayerLiveView:New(Util.GetTransform(this.role, "root/ui/roleRoot"),1, nil)
|
||||
this.NpcGO:OnOpen()
|
||||
this.NpcGO.name = "npc"
|
||||
|
|
|
|||
|
|
@ -302,15 +302,15 @@ function this:BindEvent()
|
|||
-- view:SetAutoMove()
|
||||
-- end
|
||||
curNPCList = {}
|
||||
-- PlayerManager.GetMainPlayerNPCData(function(NPCList)
|
||||
-- for i = 1, #NPCList do
|
||||
-- local view = MainPlayerView.New(false, this.btnClickMove, rect, Vector2.New(math.random(rect.xMin, rect.xMax), math.random(rect.yMin, rect.yMax)),NPCList[i].sex)
|
||||
-- view.NameText.text = NPCList[i].userName or NPCList[i].name
|
||||
-- view:SetAutoMove()
|
||||
-- view.leader.transform.name = "MainPlayerView"..i
|
||||
-- table.insert(curNPCList,view)
|
||||
-- end
|
||||
-- end)
|
||||
PlayerManager.GetMainPlayerNPCData(function(NPCList)
|
||||
for i = 1, #NPCList do
|
||||
local view = MainPlayerView.New(false, this.btnClickMove, rect, Vector2.New(math.random(rect.xMin, rect.xMax), math.random(rect.yMin, rect.yMax)),NPCList[i].sex)
|
||||
view.NameText.text = NPCList[i].userName or NPCList[i].name
|
||||
view:SetAutoMove()
|
||||
view.leader.transform.name = "MainPlayerView"..i
|
||||
table.insert(curNPCList,view)
|
||||
end
|
||||
end)
|
||||
self.playerView = MainPlayerView.New(true, this.btnClickMove, rect, Vector2.New(-1210, 0))
|
||||
table.insert(curNPCList,self.playerView)
|
||||
--角色点击行走
|
||||
|
|
|
|||
|
|
@ -17,24 +17,29 @@ function MainPlayerView.New(isSelf, root, rect, pos,_sex)
|
|||
instance.leader.transform.localPosition = Vector3.zero
|
||||
instance.leader.transform.localScale = Vector3.one
|
||||
|
||||
local sex, npc, scale
|
||||
local _sex, npc, scale
|
||||
if isSelf then
|
||||
instance.NameText = Util.GetGameObject(instance.leader, "name/text"):GetComponent("Text")
|
||||
Util.GetGameObject(instance.leader, "name/text"):SetActive(true)
|
||||
Util.GetGameObject(instance.leader, "name/text2"):SetActive(false)
|
||||
sex = NameManager.roleSex
|
||||
-- instance.NpcGO = PlayerLiveView:New(instance.roleRootTran,1, nil)
|
||||
_sex = NameManager.roleSex
|
||||
instance.NpcGO = PlayerLiveView:New(instance.roleRootTran,1, nil)
|
||||
else
|
||||
instance.NameText = Util.GetGameObject(instance.leader, "name/text2"):GetComponent("Text")
|
||||
Util.GetGameObject(instance.leader, "name/text"):SetActive(false)
|
||||
Util.GetGameObject(instance.leader, "name/text2"):SetActive(true)
|
||||
sex = _sex or math.random(0,1)
|
||||
_sex = _sex or math.random(0,1)
|
||||
|
||||
local zuoqi = 0
|
||||
if _sex == 0 then zuoqi = 80008 end
|
||||
local PlayerLiveViewData = {
|
||||
skin = 80012,
|
||||
sex = _sex,
|
||||
ride = zuoqi,
|
||||
}
|
||||
-- instance.NpcGO = PlayerLiveView:New(instance.roleRootTran,2, PlayerLiveViewData)
|
||||
instance.NpcGO = PlayerLiveView:New(instance.roleRootTran,2, PlayerLiveViewData)
|
||||
end
|
||||
instance.NpcGO = PlayerLiveView:New(instance.roleRootTran,1, nil)
|
||||
-- instance.NpcGO = PlayerLiveView:New(instance.roleRootTran,1, nil)
|
||||
instance.NpcGO:OnOpen()
|
||||
instance.NameText.text = PlayerManager.nickName
|
||||
instance.rect = rect
|
||||
|
|
|
|||
|
|
@ -332,9 +332,19 @@ end
|
|||
function this.SetPlayerRide(value)
|
||||
PlayerManager.ride = value
|
||||
end
|
||||
--设置玩家坐骑等级
|
||||
function this.SetPlayerRideLv(value)
|
||||
PlayerManager.rideLevel = value
|
||||
function this.GetPlayerDesignation(value)
|
||||
--加判断是否到时间 卸掉
|
||||
return PlayerManager.designation
|
||||
end
|
||||
--设置玩家皮肤
|
||||
function this.GetPlayerSkin(value)
|
||||
--加判断是否到时间 卸掉
|
||||
return PlayerManager.skin
|
||||
end
|
||||
--设置玩家坐骑
|
||||
function this.GetPlayerRide(value)
|
||||
--加判断是否到时间 卸掉
|
||||
return PlayerManager.ride
|
||||
end
|
||||
--初始化所以激活的称号 时装 坐骑
|
||||
function this.InitSkinTitleMountData(userSkinList,userTitleList,userMountList)
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ this.firsthead = nil
|
|||
this.playerHeadList = {}--背景前三头像
|
||||
this.playerScrollHead={}--滚动条头像
|
||||
|
||||
local mapNpc = "live2d_npc_map"
|
||||
local mapNpc2 = "live2d_npc_map_nv"
|
||||
local npc, scale
|
||||
-- local mapNpc = "live2d_npc_map"
|
||||
-- local mapNpc2 = "live2d_npc_map_nv"
|
||||
local npc
|
||||
--初始化组件(用于子类重写)
|
||||
function RankingSingleListPanel:InitComponent()
|
||||
|
||||
|
|
@ -82,6 +82,9 @@ function RankingSingleListPanel:OnClose()
|
|||
SoundManager.PlayOldMusic()
|
||||
RankingManager.isRequest=0
|
||||
this.noneImage:SetActive(false)
|
||||
if npc then
|
||||
npc:OnClose()
|
||||
end
|
||||
-- if this.liveNode then
|
||||
-- --Log("==YSP== 删除立绘")
|
||||
-- poolManager:UnLoadLive(npc, this.liveNode)
|
||||
|
|
@ -91,11 +94,14 @@ end
|
|||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function RankingSingleListPanel:OnDestroy()
|
||||
if this.liveNode then
|
||||
--Log("==YSP== 删除立绘")
|
||||
poolManager:UnLoadLive(npc, this.liveNode)
|
||||
this.liveNode=nil
|
||||
if npc then
|
||||
npc:OnClose()
|
||||
end
|
||||
-- if this.liveNode then
|
||||
-- --Log("==YSP== 删除立绘")
|
||||
-- poolManager:UnLoadLive(npc, this.liveNode)
|
||||
-- this.liveNode=nil
|
||||
-- end
|
||||
for _, playerHead in ipairs(this.playerHeadList) do
|
||||
playerHead:Recycle()
|
||||
end
|
||||
|
|
@ -196,18 +202,30 @@ function this.SetHeadsInfo(data,root,index,name,level)
|
|||
this.SetInfoShow(this.firstHeadinfoGo,data,sData.rankType)
|
||||
--data.sex
|
||||
--加载立绘
|
||||
if this.liveNode then
|
||||
--Log("==YSP== 删除立绘")
|
||||
poolManager:UnLoadLive(npc, this.liveNode)
|
||||
this.liveNode=nil
|
||||
end
|
||||
npc = data.sex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
local scale = data.sex == ROLE_SEX.BOY and Vector3.one * 0.32 or Vector3.one * 0.19
|
||||
this.liveNode = poolManager:LoadLive(npc, this.livePrefab.transform, scale, Vector3.New(0,-158.31,0))
|
||||
local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
|
||||
if SkeletonGraphic then
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
-- if this.liveNode then
|
||||
-- --Log("==YSP== 删除立绘")
|
||||
-- poolManager:UnLoadLive(npc, this.liveNode)
|
||||
-- this.liveNode=nil
|
||||
-- end
|
||||
-- npc = data.sex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
||||
-- local scale = data.sex == ROLE_SEX.BOY and Vector3.one * 0.32 or Vector3.one * 0.19
|
||||
-- this.liveNode = poolManager:LoadLive(npc, this.livePrefab.transform, scale, Vector3.New(0,-158.31,0))
|
||||
-- local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
|
||||
-- if SkeletonGraphic then
|
||||
-- SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
-- end
|
||||
if npc then
|
||||
npc:OnClose()
|
||||
npc = nil
|
||||
end
|
||||
local curPlayerLiveViewData = {
|
||||
skin = PlayerManager.GetPlayerSkin(),
|
||||
sex = math.random(0,1),
|
||||
ride = 80008,
|
||||
}
|
||||
npc = PlayerLiveView:New(this.livePrefab.transform,2, curPlayerLiveViewData)
|
||||
npc:OnOpen(25,Vector3.New(0,-118.65,0),WALK_DIR.IDLE_LEFT)
|
||||
|
||||
Util.AddOnceClick(this.firstheadClick,function()
|
||||
UIManager.OpenPanel(UIName.PlayerInfoPopup, data.uid)
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
--坐骑
|
||||
local SettingPlayerRide = quick_class("SettingPlayerRide")
|
||||
local this = SettingPlayerRide
|
||||
|
||||
local live2dRoot
|
||||
local live2dRoot2
|
||||
local curPlayerHeadIconConfig
|
||||
local curItemConfig
|
||||
function SettingPlayerRide:ctor(mainPanel, gameObject)
|
||||
self.mainPanel = mainPanel
|
||||
self.gameObject = gameObject
|
||||
|
|
@ -10,17 +13,43 @@ function SettingPlayerRide:ctor(mainPanel, gameObject)
|
|||
end
|
||||
--初始化组件(用于子类重写)
|
||||
function SettingPlayerRide:InitComponent(gameObject)
|
||||
this.live2dRootParent = Util.GetGameObject(gameObject, "live2dRootParent")
|
||||
this.live2dRootParent2 = Util.GetGameObject(gameObject, "live2dRootParent2")
|
||||
this.name = Util.GetGameObject(gameObject, "name/Text"):GetComponent("Text")
|
||||
Util.GetGameObject(gameObject, "skinProInfo/getInfoImage/Text"):GetComponent("Text").text = "获取途径"
|
||||
this.getInfo = Util.GetGameObject(gameObject, "skinProInfo/getInfo"):GetComponent("Text")
|
||||
Util.GetGameObject(gameObject, "skinProInfo/proImage/Text"):GetComponent("Text").text = "属性加成"
|
||||
this.goToBtn = Util.GetGameObject(gameObject, "goToBtn")
|
||||
this.goToBtnText = Util.GetGameObject(gameObject, "goToBtn/Text"):GetComponent("Text")
|
||||
this.stateImg = Util.GetGameObject(gameObject, "stateImg"):GetComponent("Image")
|
||||
this.lefeTime = Util.GetGameObject(gameObject, "lefeTime"):GetComponent("Text")
|
||||
|
||||
this.itemPre = Util.GetGameObject(gameObject, "itemPre")
|
||||
this.itemGrid = Util.GetGameObject(gameObject, "rect/grid")
|
||||
this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.itemGrid.transform,this.itemPre,
|
||||
nil,Vector2.New(494.3,525.5),1,1,Vector2.New(0,0))
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.moveTween.MomentumAmount = 1
|
||||
this.scrollView.moveTween.Strength = 2
|
||||
|
||||
this.proPre = Util.GetGameObject(gameObject, "skinProInfo/proPre")
|
||||
this.proGrid = Util.GetGameObject(gameObject, "skinProInfo/proGrid")
|
||||
this.scrollViewPro=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.proGrid.transform,this.proPre,
|
||||
nil,Vector2.New(458.2,159.6),1,2,Vector2.New(0,0))
|
||||
this.scrollViewPro.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
|
||||
this.scrollViewPro.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||
this.scrollViewPro.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
||||
this.scrollViewPro.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
||||
this.scrollViewPro.moveTween.MomentumAmount = 1
|
||||
this.scrollViewPro.moveTween.Strength = 2
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function SettingPlayerRide:BindEvent()
|
||||
Util.AddClick(this.goToBtn, function()
|
||||
NetManager.ActiveUserMountRequest(80008,function()
|
||||
LogBlue("骑上金牛")
|
||||
PlayerManager.SetPlayerRide(80008)
|
||||
end)
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
|
|
@ -38,11 +67,122 @@ end
|
|||
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
function SettingPlayerRide:OnShow()
|
||||
this.ShowPanelData()
|
||||
end
|
||||
--显示信息
|
||||
function this.ShowPanelData()
|
||||
|
||||
local rideList = ConfigManager.GetAllConfigsDataByKey(ConfigName.PlayerHeadIcon,"Type",PlayerHeadIconType.Ride)
|
||||
--设置滚动区信息
|
||||
local curUserRideId = PlayerManager.GetPlayerRide()
|
||||
local curUserRideConFig,isGet,isUser
|
||||
this.scrollView:SetData(rideList,function(index,root)
|
||||
if curUserRideId <= 0 and index == 1 then
|
||||
curUserRideConFig,isGet,isUser = rideList[index],PlayerManager.userMountList[rideList[index].Id],curUserRideId == rideList[index].Id
|
||||
end
|
||||
this.ShowRideInfo(root,rideList[index])
|
||||
end, not false, not false)
|
||||
if curUserRideId > 0 then
|
||||
local data = ConfigManager.GetConfigData(ConfigName.PlayerHeadIcon,curUserRideId)
|
||||
this.SingleRideClickShowInfo(data,true,true)
|
||||
else
|
||||
this.SingleRideClickShowInfo(curUserRideConFig,isGet,isUser)
|
||||
end
|
||||
end
|
||||
|
||||
function this.ShowRideInfo(go,data)
|
||||
local PlayerHeadIconConfig = data
|
||||
LogBlue("PlayerHeadIconConfig "..PlayerHeadIconConfig.Id)
|
||||
local itemConFig = ConfigManager.GetConfigData(ConfigName.ItemConfig,PlayerHeadIconConfig.ItemId)
|
||||
Util.GetGameObject(go, "iconMask/icon"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(itemConFig.ResourceID))
|
||||
Util.GetGameObject(go, "noGetImage/noGetImage/Text"):GetComponent("Text").text = "暂未解锁"
|
||||
Util.GetGameObject(go, "GetImage/GetImage/Text"):GetComponent("Text").text = "使用中"
|
||||
local noGetImage = Util.GetGameObject(go, "noGetImage")
|
||||
local GetImage = Util.GetGameObject(go, "GetImage")
|
||||
local setImage = Util.GetGameObject(go, "GetImage")
|
||||
setImage:SetActive(false)
|
||||
local isGet = false
|
||||
if PlayerManager.userMountList[PlayerHeadIconConfig.Id] then
|
||||
isGet = true
|
||||
end
|
||||
local isUser = false
|
||||
if PlayerManager.GetPlayerRide() == PlayerHeadIconConfig.Id then
|
||||
isUser = true
|
||||
end
|
||||
noGetImage:SetActive(not isGet)
|
||||
GetImage:SetActive(isUser)
|
||||
Util.AddOnceClick(go, function()
|
||||
setImage:SetActive(true)
|
||||
this.SingleRideClickShowInfo(data,isGet,isUser)
|
||||
end)
|
||||
|
||||
end
|
||||
function this.SingleRideClickShowInfo(data,isGet,isUser)
|
||||
curPlayerHeadIconConfig = data
|
||||
curItemConfig = ConfigManager.GetConfigData(ConfigName.ItemConfig,curPlayerHeadIconConfig.ItemId)
|
||||
this.name.text = curItemConfig.Name
|
||||
this.getInfo.text = curItemConfig.ItemDescribe
|
||||
this.scrollViewPro:SetData(curPlayerHeadIconConfig.UnlockProperty,function(index,root)
|
||||
local propertyConfig = ConfigManager.GetConfigData(ConfigName.PropertyConfig, curPlayerHeadIconConfig.UnlockProperty[index][1])
|
||||
Util.GetGameObject(root, "proValue"):GetComponent("Text").text = GetLanguageStrById(propertyConfig.Info).." ".. GetPropertyFormatStr(propertyConfig.Style, curPlayerHeadIconConfig.UnlockProperty[index][2])
|
||||
end, not false, not false)
|
||||
if not isGet and not isUser then
|
||||
this.goToBtnText.text = "获取途径"
|
||||
elseif isGet and not isUser then
|
||||
this.goToBtnText.text = "骑乘"
|
||||
elseif isGet and isUser then
|
||||
this.goToBtnText.text ="取消骑乘"
|
||||
end
|
||||
local setateImageStr = curPlayerHeadIconConfig.Time == 0 and "c_zuoqi_yongjiu_zh" or "c_zuoqi_xianshi_zh"
|
||||
this.stateImg.sprite = Util.LoadSprite(setateImageStr)
|
||||
this.lefeTime.text = curPlayerHeadIconConfig.Time == 0 and "" or "到期时间:"
|
||||
if live2dRoot then
|
||||
live2dRoot:OnClose()
|
||||
end
|
||||
if live2dRoot2 then
|
||||
live2dRoot2:OnClose()
|
||||
end
|
||||
local curPlayerLiveViewData = {
|
||||
skin = PlayerManager.GetPlayerSkin(),
|
||||
sex = NameManager.roleSex,
|
||||
ride = curPlayerHeadIconConfig.Id,
|
||||
}
|
||||
live2dRoot = PlayerLiveView:New(this.live2dRootParent,2, curPlayerLiveViewData)
|
||||
live2dRoot:OnOpen(25,nil,WALK_DIR.IDLE_LEFT)
|
||||
local ridePlayerLiveViewData = {
|
||||
ride = curPlayerHeadIconConfig.Id,
|
||||
}
|
||||
live2dRoot2 = PlayerLiveView:New(this.live2dRootParent2,2, ridePlayerLiveViewData)
|
||||
live2dRoot2:OnOpen(80,nil,WALK_DIR.IDLE_LEFT)
|
||||
|
||||
Util.AddOnceClick(this.goToBtn, function()
|
||||
if not isGet and not isUser then
|
||||
PopupTipPanel.ShowTip( curItemConfig.ItemDescribe)
|
||||
elseif isGet and not isUser then
|
||||
NetManager.ActiveUserMountRequest(curPlayerHeadIconConfig.Id,function(msg)
|
||||
LogBlue("骑上金牛: "..curPlayerHeadIconConfig.Id)
|
||||
PlayerManager.SetPlayerRide(curPlayerHeadIconConfig.Id)
|
||||
PlayerManager.SetPlayerMountTime(curPlayerHeadIconConfig.Id,msg.validTime)
|
||||
--刷新主城自己npc
|
||||
end)
|
||||
elseif isGet and isUser then
|
||||
NetManager.ActiveUserMountRequest(0,function()
|
||||
LogBlue("取消骑乘")
|
||||
PlayerManager.SetPlayerRide(0)
|
||||
--刷新主城自己npc
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function SettingPlayerRide:OnClose()
|
||||
|
||||
|
||||
if live2dRoot then
|
||||
live2dRoot:OnClose()
|
||||
end
|
||||
if live2dRoot2 then
|
||||
live2dRoot2:OnClose()
|
||||
end
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ function PlayerLiveView:New(gameObject,_Type, PlayerLiveViewData,orginLayer)
|
|||
instance.PlayerLiveViewData = {
|
||||
ride = PlayerManager.ride,
|
||||
skin = PlayerManager.skin,
|
||||
sex = NameManager.roleSex,
|
||||
designation = PlayerManager.designation
|
||||
}
|
||||
end
|
||||
|
|
@ -80,8 +81,17 @@ function PlayerLiveView:RemoveListener()
|
|||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function PlayerLiveView:OnOpen()
|
||||
function PlayerLiveView:OnOpen(scale,pos,dir)
|
||||
self:OnShowLive()
|
||||
if scale then
|
||||
self.leader.transform.localScale = Vector3.New(scale,scale,scale)
|
||||
end
|
||||
if pos then
|
||||
self.leader.transform.localPosition = pos
|
||||
end
|
||||
if dir then
|
||||
self:SetWalkDir(dir)
|
||||
end
|
||||
end
|
||||
|
||||
--加载三个立绘(称号 坐骑 皮肤)
|
||||
|
|
@ -105,7 +115,7 @@ function PlayerLiveView:OnShowLive()
|
|||
--时装
|
||||
if self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 then
|
||||
self.playerLiveGo:SetActive(true)
|
||||
local skinId = tonumber( tostring(self.PlayerLiveViewData.skin) .. tostring(NameManager.roleSex))--皮肤 有男女之分 所以在id后加0 or 1
|
||||
local skinId = tonumber( tostring(self.PlayerLiveViewData.skin) .. tostring(self.PlayerLiveViewData.sex))--皮肤 有男女之分 所以在id后加0 or 1
|
||||
local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,skinId)
|
||||
local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName)
|
||||
local curLocalScale = Vector3.New(curArtResourcesConfig.Scale,curArtResourcesConfig.Scale,curArtResourcesConfig.Scale)
|
||||
|
|
@ -202,59 +212,75 @@ end
|
|||
function PlayerLiveView:SetWalkDir(dir)
|
||||
LogBlue("PlayerLiveView dir : "..dir)
|
||||
if dir == WALK_DIR.IDLE_FRONT then-- 站立_向前
|
||||
if self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 then
|
||||
if (self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0) and (self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE_FRONT,RIDE_WALK_DIR.IDLE_FRONT)
|
||||
else
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE)
|
||||
elseif self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 and (not self.PlayerLiveViewData.ride or self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride <= 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE,nil)
|
||||
elseif self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 and (not self.PlayerLiveViewData.skin or self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin <= 0) then
|
||||
self:SetWalkDirInfo(nil,RIDE_WALK_DIR.IDLE_FRONT)
|
||||
end
|
||||
self:SetSiblingIndexPlayerOrRide(1)
|
||||
elseif dir == WALK_DIR.IDLE_BACK then-- 站立_向后
|
||||
if self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 then
|
||||
if (self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0) and (self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE_BACK,RIDE_WALK_DIR.IDLE_BACK)
|
||||
else
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLEBACK)
|
||||
elseif self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 and (not self.PlayerLiveViewData.ride or self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride <= 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLEBACK,nil)
|
||||
elseif self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 and (not self.PlayerLiveViewData.skin or self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin <= 0) then
|
||||
self:SetWalkDirInfo(nil,RIDE_WALK_DIR.IDLE_BACK)
|
||||
end
|
||||
self:SetSiblingIndexPlayerOrRide(2)
|
||||
elseif dir == WALK_DIR.LEFT then-- 站立_向左
|
||||
if self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 then
|
||||
elseif dir == WALK_DIR.IDLE_LEFT then-- 站立_向左
|
||||
if (self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0) and (self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE_LEFT,RIDE_WALK_DIR.IDLE_LEFT)
|
||||
else
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE)
|
||||
elseif self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 and (not self.PlayerLiveViewData.ride or self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride <= 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE,nil)
|
||||
elseif self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 and (not self.PlayerLiveViewData.skin or self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin <= 0) then
|
||||
self:SetWalkDirInfo(nil,RIDE_WALK_DIR.IDLE_LEFT)
|
||||
end
|
||||
self:SetSiblingIndexPlayerOrRide(2)
|
||||
elseif dir == WALK_DIR.RIGHT then-- 站立_向右
|
||||
if self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 then
|
||||
elseif dir == WALK_DIR.IDLE_RIGHT then-- 站立_向右
|
||||
if (self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0) and (self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE_RIGHT,RIDE_WALK_DIR.IDLE_RIGHT)
|
||||
else
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE)
|
||||
elseif self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 and (not self.PlayerLiveViewData.ride or self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride <= 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.IDLE,nil)
|
||||
elseif self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 and (not self.PlayerLiveViewData.skin or self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin <= 0) then
|
||||
self:SetWalkDirInfo(nil,RIDE_WALK_DIR.IDLE_RIGHT)
|
||||
end
|
||||
self:SetSiblingIndexPlayerOrRide(2)
|
||||
elseif dir == WALK_DIR.RUN_RIGHT then-- 跑_向右
|
||||
if self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 then
|
||||
if (self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0) and (self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.RUN_RIGHT,RIDE_WALK_DIR.RUN_RIGHT)
|
||||
else
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.RIGHT)
|
||||
elseif self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 and (not self.PlayerLiveViewData.ride or self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride <= 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.RIGHT,nil)
|
||||
elseif self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 and (not self.PlayerLiveViewData.skin or self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin <= 0) then
|
||||
self:SetWalkDirInfo(nil,RIDE_WALK_DIR.RUN_RIGHT)
|
||||
end
|
||||
self:SetSiblingIndexPlayerOrRide(2)
|
||||
elseif dir == WALK_DIR.RUN_LEFT then-- 跑_向左
|
||||
if self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 then
|
||||
if (self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0) and (self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.RUN_LEFT,RIDE_WALK_DIR.RUN_LEFT)
|
||||
else
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.LEFT)
|
||||
elseif self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 and (not self.PlayerLiveViewData.ride or self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride <= 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.LEFT,nil)
|
||||
elseif self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 and (not self.PlayerLiveViewData.skin or self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin <= 0) then
|
||||
self:SetWalkDirInfo(nil,RIDE_WALK_DIR.RUN_LEFT)
|
||||
end
|
||||
self:SetSiblingIndexPlayerOrRide(2)
|
||||
elseif dir == WALK_DIR.RUN_UP then-- 跑_向上
|
||||
if self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 then
|
||||
if (self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0) and (self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.RUN_UP,RIDE_WALK_DIR.RUN_UP)
|
||||
else
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.UP)
|
||||
elseif self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 and (not self.PlayerLiveViewData.ride or self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride <= 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.UP,nil)
|
||||
elseif self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 and (not self.PlayerLiveViewData.skin or self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin <= 0) then
|
||||
self:SetWalkDirInfo(nil,RIDE_WALK_DIR.RUN_UP)
|
||||
end
|
||||
self:SetSiblingIndexPlayerOrRide(2)
|
||||
elseif dir == WALK_DIR.RUN_DOWN then-- 跑_向下
|
||||
if self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 then
|
||||
if (self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0) and (self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.RUN_DOWN,RIDE_WALK_DIR.RUN_DOWN)
|
||||
else
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.DOWN)
|
||||
elseif self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 and (not self.PlayerLiveViewData.ride or self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride <= 0) then
|
||||
self:SetWalkDirInfo(PLAYER_WALK_DIR.DOWN,nil)
|
||||
elseif self.PlayerLiveViewData.ride and self.PlayerLiveViewData.ride > 0 and (not self.PlayerLiveViewData.skin or self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin <= 0) then
|
||||
self:SetWalkDirInfo(nil,RIDE_WALK_DIR.DOWN)
|
||||
end
|
||||
self:SetSiblingIndexPlayerOrRide(1)
|
||||
elseif dir == WALK_DIR.JINGYA then-- 惊讶
|
||||
|
|
@ -278,17 +304,26 @@ function PlayerLiveView:SetWalkDir(dir)
|
|||
end
|
||||
end
|
||||
function PlayerLiveView:SetWalkDirInfo(playerDir,RideDir)
|
||||
if not playerDir then return end
|
||||
if RideDir then
|
||||
LogBlue("ssssssssssssssssss")
|
||||
if playerDir and not RideDir then
|
||||
LogBlue("PlayerLiveView playerDir : "..playerDir.animation .." ".. playerDir.y)
|
||||
self.playerLiveSkeletonGraphic.transform.localEulerAngles = Vector3.New(0, playerDir.y, 0)
|
||||
self.playerLiveSkeletonGraphic.AnimationState:SetAnimation(0, playerDir.animation, true)
|
||||
elseif not playerDir and RideDir then
|
||||
LogBlue("PlayerLiveView playerDir : "..RideDir.animation .." ".. RideDir.y)
|
||||
self.rideLivSkeletonGraphic.transform.localEulerAngles = Vector3.New(0, RideDir.y, 0)
|
||||
self.rideLivSkeletonGraphic.AnimationState:SetAnimation(0, RideDir.animation, true)
|
||||
elseif playerDir and RideDir then
|
||||
LogBlue("PlayerLiveView playerDir : "..playerDir.animation .." ".. playerDir.y.." RideDir : "..RideDir.animation .." ".. RideDir.y)
|
||||
self.playerLiveSkeletonGraphic.transform.localEulerAngles = Vector3.New(0, playerDir.y, 0)
|
||||
self.playerLiveSkeletonGraphic.AnimationState:SetAnimation(0, playerDir.animation, true)
|
||||
self.rideLivSkeletonGraphic.transform.localEulerAngles = Vector3.New(0, RideDir.y, 0)
|
||||
self.rideLivSkeletonGraphic.AnimationState:SetAnimation(0, RideDir.animation, true)
|
||||
end
|
||||
if RideDir then
|
||||
|
||||
else
|
||||
LogBlue("PlayerLiveView playerDir : "..playerDir.animation .." ".. playerDir.y)
|
||||
self.playerLiveSkeletonGraphic.transform.localEulerAngles = Vector3.New(0, playerDir.y, 0)
|
||||
self.playerLiveSkeletonGraphic.AnimationState:SetAnimation(0, playerDir.animation, true)
|
||||
|
||||
end
|
||||
end
|
||||
function PlayerLiveView:SetSiblingIndexPlayerOrRide(type)
|
||||
|
|
@ -315,6 +350,10 @@ function PlayerLiveView:OnClose()
|
|||
poolManager:UnLoadAsset(self.titleLiveStr, self.titleLive, PoolManager.AssetType.GameObject)
|
||||
self.titleLive = nil
|
||||
end
|
||||
if self.leader then
|
||||
poolManager:UnLoadAsset("PlayerLiveView",self.leader, PoolManager.AssetType.GameObject)
|
||||
self.leader = nil
|
||||
end
|
||||
end
|
||||
|
||||
return PlayerLiveView
|
||||
Loading…
Reference in New Issue