剧情提交

dev_chengFeng
jiaoyangna 2021-04-22 15:06:47 +08:00
parent a277c5e6fa
commit a0ecd56968
10 changed files with 5831 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: dd024bf0b8d15fa468be00d1743fbbaf
PrefabImporter:
externalObjects: {}
userData:
assetBundleName: lz4/prefabs/map/mapctrl
assetBundleVariant: unity3d

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -376,7 +376,7 @@ UIName = {
ActivityMainPanel = 384, --活动新界面
FifteenDayGiftPanel = 385,--十五日登录
RedpotDebugPanel = 386, -- 红点debug
StoryMapPanel = 387
}
SubUIConfig = {

View File

@ -58,6 +58,7 @@ local isRefeshIcon = true
local curNPCList = {}
--初始化组件(用于子类重写)
function this:InitComponent()
orginLayer = 0
self.bg = Util.GetGameObject(self.gameObject, "bg")
self.sceneTran = Util.GetGameObject(self.gameObject, "scene"):GetComponent("RectTransform")
@ -109,7 +110,7 @@ function this:InitComponent()
-- 无尽
this.btnEndLess = Util.GetGameObject(self.gameObject, "LeftDown/btnRoot/btnEndLess")
this.btnEndLess:SetActive(false)
this.btnEndLess:SetActive(true)
--鸿蒙
this.btnHongMeng=Util.GetGameObject(self.gameObject,"RightDown/btnHongMeng")
@ -256,6 +257,9 @@ end
--绑定事件(用于子类重写)
function this:BindEvent()
Util.AddOnceClick(this.btnEndLess,function()
UIManager.OpenPanel(UIName.StoryMapPanel)
end)
self.trigger = Util.GetEventTriggerListener(self.ctrl)
self.moveTween = self.bg:GetComponent(typeof(UITweenSpring))

View File

@ -0,0 +1,135 @@
require("Base/BasePanel")
StoryMapPanel = Inherit(BasePanel)
local this = StoryMapPanel
require("Modules/Map/Logic/TileMapView")
-- 小地图
local fightMap = require("Modules/Fight/View/FightPointMapView")
--初始化组件(用于子类重写)
function this:InitComponent()
this.TT = Util.GetGameObject(self.gameObject,"scroll/mapParent/TT")
this.startBtn = Util.GetGameObject(self.gameObject,"Start")
this.ViewCameraTran = Util.GetGameObject(self.gameObject,"CameraPos# (1)")
end
--绑定事件(用于子类重写)
function this:BindEvent()
Util.AddClick(this.btnBack, function ()
this:ClosePanel()
end)
Util.AddClick(this.startBtn, function ()
UIManager.camera.clearFlags = CameraClearFlags.Depth
this.liveNode:SetWalkDir(WALK_DIR.RUN_UP)
local timer = 0
LogGreen("timer:"..timer)
this.timer = Timer.New(function()
local v = Vector3.New(this.TT.transform.anchoredPosition3D.x + 800 ,this.TT.transform.anchoredPosition3D.y ,this.TT.transform.anchoredPosition3D.z )
this:RunMap(v,timer)
-- local MoveSpeed = 1
-- this.TT.transform.Translate(Vector3.forward * MoveSpeed * Time.deltaTime, RedBall.transform);
end,1)
this.timer:Start()
end)
end
function this:RunMap(v,timer)
this.TT.transform:DOAnchorPos(v,1):OnComplete(function ()
v = Vector3.New(this.TT.transform.anchoredPosition3D.x + 800 ,this.TT.transform.anchoredPosition3D.y ,this.TT.transform.anchoredPosition3D.z )
--Util.SetLocalPosition(this.ViewCameraTran.transform, this.TT.transform.anchoredPosition3D.x ,this.TT.transform.anchoredPosition3D.y ,this.TT.transform.anchoredPosition3D.z)
timer = timer + 1
if timer > 5 then
return
else
this:RunMap(v,timer)
end
end):SetEase(Ease.Linear)
end
--添加事件监听(用于子类重写)
function this:AddListener()
end
--移除事件监听(用于子类重写)
function this:RemoveListener()
end
--界面打开时调用(用于子类重写)
function this:OnOpen(_mapData)
--this:LoadMapData()
this.LoadTT()
end
--local mapCtrl = "MapCtrl"
-- function this:LoadMapData()
-- UIManager.camera.clearFlags = CameraClearFlags.Depth
-- -- 所有物体的根节点
-- this.mapRoot = poolManager:LoadAsset(mapCtrl, PoolManager.AssetType.GameObject)
-- this.mapRoot.name = mapCtrl
-- this.mapRoot.transform:SetParent(UIManager.uiRoot.transform.parent)
-- this.mapRoot.transform.position = Vector3.New(0, 0, -100)
-- TileMapView.fogSize = 2
-- local curChapter = FightPointPassManager.GetCurChapterIndex()
-- local index = 1
-- index = math.floor((curChapter - 1) % 5 + 1)
-- -- LogPink("#mapIdList:"..#mapIdList.." m_curMapId:"..m_curMapId.." curChapter:"..curChapter.." index:"..index.." State:"..tostring(FightPointPassManager.isOpenNewChapter))
-- TileMapView.AwakeInit(this.mapRoot, 5002, nil, Vector2.New(180, 180))
-- TileMapView.isShowFog = false
-- TileMapController.IsShieldDrag = function()
-- --当栈中有逻辑,则拖动可以打断镜头跟随
-- return false
-- end
-- TileMapController.OnClickTile = this.OnClickTile
-- TileMapController.Init(this.mapRoot, this.dragCtrl)
-- TileMapView.Init()
-- --TileMapView.SetSpriteBG(mapRes[index])
-- -- 设置镜头的尺寸
-- TileMapView.SetMapScale(Screen.height / 1920)
-- -- 设置相机初始化位置
-- local camInitPos = InitCamPos[5002].pos
-- TileMapView.SetCameraPos(camInitPos)
-- -- 设置不点击
-- this.dragCtrl:SetActive(false)
-- end
local npc = "live2d_npc_map_boy"
---加载跑图角色
function this.LoadTT()
this.liveNode = PlayerLiveView:New(this.TT,1)
this.liveNode:OnOpen(GetPlayerRoleSingleConFig().Scale13,Vector3.New(0,-30,0),WALK_DIR.IDLE_FRONT)
--Util.SetLocalPosition(this.ViewCameraTran.transform, this.TT.transform.anchoredPosition3D.x ,this.TT.transform.anchoredPosition3D.y ,this.ViewCameraTran.transform.anchoredPosition3D.z)
end
--设置跑图角色方向
function this.SetTTDirection()
end
function this:OnShow()
end
function this:OnSortingOrderChange()
end
--界面关闭时调用(用于子类重写)
function this:OnClose()
end
--界面销毁时调用(用于子类重写)
function this:OnDestroy()
end
return StoryMapPanel

View File

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

View File

@ -0,0 +1,132 @@
require("Base/BasePanel")
StoryMapPanel = Inherit(BasePanel)
local this = StoryMapPanel
local npc = "live2d_npc_map_boy"
local mapCtrl = "StoryMapCtrl"
local playerSpeed = 0
local oriCameraPos = Vector3.New(18.9,-20,-50)
local targetCameraPos = Vector3.New(18.9,54.9,-50)
local oriPlayerPos = Vector3.New(1918,-2086,-50)
--初始化组件(用于子类重写)
function this:InitComponent()
--this.liveNode = Util.GetGameObject(self.gameObject,"scroll/mapParent/TT")
this.startBtn = Util.GetGameObject(self.gameObject,"Start")
this.btnBack = Util.GetGameObject(self.gameObject,"btnBack")
end
--绑定事件(用于子类重写)
function this:BindEvent()
Util.AddClick(this.btnBack, function ()
this:ClosePanel()
end)
Util.AddClick(this.startBtn, function ()
UIManager.camera.clearFlags = CameraClearFlags.Depth
this.liveNode:SetWalkDir(WALK_DIR.RUN_UP)
local timer = 0
local v = Vector3.New(this.liveNode.transform.localPosition.x ,this.liveNode.transform.localPosition.y + 8 ,this.liveNode.transform.localPosition.z )
this:RunMap(v,timer)
end)
end
function this:RunMap(v,timer)
this.liveNode.transform:DOLocalMove(v,1):OnStart(function ()
end):OnUpdate(function()
local y = this.liveNode.transform.localPosition.y -- - (this.camera.orthographicSize/2)
LogGreen("y:"..y)
if y < oriPlayerPos.y then
y = oriPlayerPos.y
elseif y > targetCameraPos.y then
y = targetCameraPos.y
end
this.viewCameraTran.transform.localPosition = Vector3.New(this.viewCameraTran.transform.localPosition.x,y,this.viewCameraTran.transform.localPosition.z)
end):OnComplete(function ()
LogGreen("this.liveNode.transform.localPosition:"..tostring(this.liveNode.transform.localPosition))
v = Vector3.New(this.liveNode.transform.localPosition.x ,this.liveNode.transform.localPosition.y + 8 ,this.liveNode.transform.localPosition.z)
timer = timer + 1
if timer > 5 then
return
else
this:RunMap(v,timer)
end
end):SetEase(Ease.Linear)
end
--添加事件监听(用于子类重写)
function this:AddListener()
end
--移除事件监听(用于子类重写)
function this:RemoveListener()
end
--界面打开时调用(用于子类重写)
function this:OnOpen(_mapData)
this:LoadMapData()
this.LoadTT()
this:SetCameraPos()
end
function this:LoadMapData()
UIManager.camera.clearFlags = CameraClearFlags.Depth
-- 所有物体的根节点
this.mapRoot = poolManager:LoadAsset(mapCtrl, PoolManager.AssetType.GameObject)
this.mapRoot.name = mapCtrl
this.mapRoot.transform:SetParent(UIManager.uiRoot.transform.parent)
this.mapRoot.transform.position = Vector3.New(0, 0, -100)
this.bgRoot = Util.GetGameObject(this.mapRoot,"StoryBG#")
end
function this:SetCameraPos()
this.viewCameraTran = Util.GetGameObject(this.mapRoot,"CameraPos#")
this.camera = Util.GetGameObject(this.viewCameraTran,"Camera"):GetComponent("Camera")
this.camera.orthographic = true
this.camera.orthographicSize = Screen.height / 100 / 2 / (Screen.height / 1920)
LogGreen("this.camera.orthographicSize:"..tostring(this.camera.orthographicSize))
LogGreen("this.liveNode.transform.localPosition:"..tostring(this.liveNode.transform.localPosition))
LogGreen("this.liveNode.transform.Position:"..tostring(this.liveNode.transform.position))
local y = this.liveNode.transform.position.y
this.viewCameraTran.transform.position = Vector3.New(oriCameraPos.x,y,oriCameraPos.z)
end
---加载跑图角色
function this.LoadTT()
if this.liveNode then
this.liveNode:OnClose()
this.liveNode = nil
end
this.liveNode = PlayerLiveView:New(this.mapRoot,1)
this.liveNode:OnOpen(GetPlayerRoleSingleConFig().Scale7)
end
function this:OnShow()
end
--设置跑图角色方向
function this.SetTTDirection()
end
function this:OnSortingOrderChange()
end
--界面关闭时调用(用于子类重写)
function this:OnClose()
poolManager:UnLoadAsset(mapCtrl, this.mapRoot, PoolManager.AssetType.GameObject)
this.mapRoot = nil
this.liveNode:OnClose()
end
--界面销毁时调用(用于子类重写)
function this:OnDestroy()
end
return StoryMapPanel

View File

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