From d9e3aa939dd995faa00a302fc1614820b75317b0 Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Tue, 30 Mar 2021 22:37:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A7=B0=E5=8F=B7=E5=9D=90=E9=AA=91?= =?UTF-8?q?=E6=97=B6=E8=A3=85=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua | 56 ++++++++++++------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua b/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua index b84ebf75e3..09a6891338 100644 --- a/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoMapPanel.lua @@ -251,7 +251,8 @@ function this.MoveTT(targetIndex,_data) this.MapMove(allGridData[curGridIndex].x,0.3) if curGridIndex==targetIndex then Log("待机动画") - this.SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) + -- this.SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) + this.liveNode:SetWalkDir(WALK_DIR.IDLE_FRONT) this.startBtn:GetComponent("Button").enabled=true this.EventTrigger(_data) if curGridIndex>=#allGridData then @@ -443,40 +444,50 @@ local npc local scale ---加载跑图角色 function this.LoadTT() - local mapNpc = "live2d_npc_map" - local mapNpc2 = "live2d_npc_map_nv" - npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2 - scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one * 0.25 or Vector3.one * 0.12 - if not this.liveNode then - this.liveNode = poolManager:LoadLive(npc, this.TT.transform, scale, Vector3.New(0,-42.4,0)) - end - this.SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic") - if this.SkeletonGraphic then - this.SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) + -- local mapNpc = "live2d_npc_map" + -- local mapNpc2 = "live2d_npc_map_nv" + -- npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2 + -- scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one * 0.25 or Vector3.one * 0.12 + -- if not this.liveNode then + -- this.liveNode = poolManager:LoadLive(npc, this.TT.transform, scale, Vector3.New(0,-42.4,0)) + -- end + -- this.SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic") + -- if this.SkeletonGraphic then + -- this.SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) + -- end + if this.liveNode then + this.liveNode:OnClose() end + this.liveNode = PlayerLiveView:New(this.TT,1) + this.liveNode:OnOpen(GetPlayerRoleSingleConFig().Scale7,Vector3.New(0,0,0),WALK_DIR.IDLE_FRONT) end --设置跑图角色方向 function this.SetTTDirection() - if not this.SkeletonGraphic then + if not this.liveNode then return end local nexIndex=curGridIndex+1 if nexIndex>#allGridData then - this.SkeletonGraphic.AnimationState:SetAnimation(0, "touch", true) + -- this.SkeletonGraphic.AnimationState:SetAnimation(0, "touch", true) + this.liveNode:SetWalkDir(WALK_DIR.TOUCH) return end if allGridData[curGridIndex].y==allGridData[nexIndex].y then - this.SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true) + -- this.SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true) if allGridData[curGridIndex].x