剧情提交
parent
20f6a06162
commit
42b91c0a4e
|
@ -0,0 +1,366 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1428594116550580
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1209305863515043212}
|
||||
- component: {fileID: 114728435147945542}
|
||||
m_Layer: 0
|
||||
m_Name: SingleStoryPlayerView
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1209305863515043212
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1428594116550580}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -0.00006055832, y: -0.00002734363, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 667622548077141306}
|
||||
- {fileID: 5354926255981963041}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &114728435147945542
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1428594116550580}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fcf53bbee510dca40b2f81e3c0d426c6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
tweenSequeue:
|
||||
- initV3: {x: 0, y: 0, z: 0}
|
||||
initFloat: 0
|
||||
isInit: 0
|
||||
changeV3: {x: 0.6, y: 0.6, z: 0.6}
|
||||
changeFloat: 0
|
||||
duration: 0.4
|
||||
delay: 0
|
||||
curveType: 6
|
||||
changeType: 4
|
||||
sequeueType: 0
|
||||
loop: 0
|
||||
loopType: 0
|
||||
targetObj: {fileID: 0}
|
||||
- initV3: {x: 0, y: 2000, z: 0}
|
||||
initFloat: 0
|
||||
isInit: 1
|
||||
changeV3: {x: 0, y: -30, z: 0}
|
||||
changeFloat: 0
|
||||
duration: 0.4
|
||||
delay: 0
|
||||
curveType: 6
|
||||
changeType: 1
|
||||
sequeueType: 1
|
||||
loop: 0
|
||||
loopType: 0
|
||||
targetObj: {fileID: 0}
|
||||
- initV3: {x: 0, y: 0, z: 0}
|
||||
initFloat: 0
|
||||
isInit: 1
|
||||
changeV3: {x: 2, y: 2, z: 2}
|
||||
changeFloat: 0
|
||||
duration: 0.4
|
||||
delay: 0
|
||||
curveType: 6
|
||||
changeType: 4
|
||||
sequeueType: 1
|
||||
loop: 0
|
||||
loopType: 0
|
||||
targetObj: {fileID: 0}
|
||||
- initV3: {x: 0, y: -30, z: 0}
|
||||
initFloat: 0
|
||||
isInit: 0
|
||||
changeV3: {x: 0, y: 0, z: 0}
|
||||
changeFloat: 0
|
||||
duration: 0.2
|
||||
delay: 0
|
||||
curveType: 5
|
||||
changeType: 1
|
||||
sequeueType: 0
|
||||
loop: 0
|
||||
loopType: 0
|
||||
targetObj: {fileID: 0}
|
||||
- initV3: {x: 0.6, y: 0.6, z: 0.6}
|
||||
initFloat: 0
|
||||
isInit: 0
|
||||
changeV3: {x: 1.2, y: 1.2, z: 1.2}
|
||||
changeFloat: 0
|
||||
duration: 0.1
|
||||
delay: 0
|
||||
curveType: 6
|
||||
changeType: 4
|
||||
sequeueType: 1
|
||||
loop: 0
|
||||
loopType: 0
|
||||
targetObj: {fileID: 0}
|
||||
- initV3: {x: 1.2, y: 1.2, z: 1.2}
|
||||
initFloat: 0
|
||||
isInit: 0
|
||||
changeV3: {x: 1, y: 1, z: 1}
|
||||
changeFloat: 0
|
||||
duration: 0.1
|
||||
delay: 0
|
||||
curveType: 6
|
||||
changeType: 4
|
||||
sequeueType: 0
|
||||
loop: 0
|
||||
loopType: 0
|
||||
targetObj: {fileID: 0}
|
||||
isPlayAudio: 1
|
||||
isHaveCloseBtn: 0
|
||||
isPlayOnOpen: 0
|
||||
--- !u!1 &5942875296913216803
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 582816968104399264}
|
||||
- component: {fileID: 5198151986810192474}
|
||||
- component: {fileID: 6511557989937711687}
|
||||
m_Layer: 0
|
||||
m_Name: name
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &582816968104399264
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5942875296913216803}
|
||||
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}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 667622548077141306}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5198151986810192474
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5942875296913216803}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &6511557989937711687
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5942875296913216803}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.9647059, g: 0.88235295, b: 0.7137255, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
|
||||
m_FontSize: 60
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 3
|
||||
m_MaxSize: 60
|
||||
m_Alignment: 1
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 1
|
||||
m_VerticalOverflow: 1
|
||||
m_LineSpacing: 1
|
||||
m_Text: New Text
|
||||
--- !u!1 &6647031903676579538
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5354926255981963041}
|
||||
- component: {fileID: 4805031613650723426}
|
||||
m_Layer: 0
|
||||
m_Name: roleRoot
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5354926255981963041
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6647031903676579538}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.0015, y: 0.0015, z: 0.0015}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1209305863515043212}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -0.20000076}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4805031613650723426
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6647031903676579538}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!1 &8731609849687984975
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 667622548077141306}
|
||||
- component: {fileID: 637370238056003773}
|
||||
- component: {fileID: 5951187665514274499}
|
||||
- component: {fileID: 7982736356455454114}
|
||||
- component: {fileID: 2026385636100666405}
|
||||
m_Layer: 0
|
||||
m_Name: nemeDi
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &667622548077141306
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8731609849687984975}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.005, y: 0.005, z: 0.005}
|
||||
m_Children:
|
||||
- {fileID: 582816968104399264}
|
||||
m_Father: {fileID: 1209305863515043212}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0.9264984}
|
||||
m_SizeDelta: {x: 0, y: 65.18}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &637370238056003773
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8731609849687984975}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &5951187665514274499
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8731609849687984975}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 21300000, guid: c234558569e543545880f7460b4b0f81, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
--- !u!114 &7982736356455454114
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8731609849687984975}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -405508275, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 0
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 0
|
||||
m_ChildForceExpandHeight: 0
|
||||
m_ChildControlWidth: 1
|
||||
m_ChildControlHeight: 0
|
||||
--- !u!114 &2026385636100666405
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8731609849687984975}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ffefdec2b867d2d4d8e2a085e267701e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName: lz4/prefabs/map/ui_effect_ditu_huoguang
|
||||
assetBundleVariant: unity3d
|
|
@ -0,0 +1,46 @@
|
|||
require("Modules/Map/Config/MapConfig")
|
||||
local MapPointConfig = ConfigManager.GetConfig(ConfigName.MapPointConfig)
|
||||
MonsterLiveView = {}
|
||||
|
||||
function MonsterLiveView:New(gameObject,iconId)
|
||||
local b = {}
|
||||
b.gameObject = poolManager:LoadAsset("UI_MapPoint", PoolManager.AssetType.GameObject)
|
||||
b.gameObject.name = "EventPoint"
|
||||
b.gameObject:SetActive(true)
|
||||
b.transform = gameObject.transform
|
||||
Util.GetGameObject(b.gameObject, "shadow"):SetActive(true)
|
||||
b.resPath = "UI_MapPoint"
|
||||
b.livePath = MapFloatingConfig[iconId].name
|
||||
b.iconId = iconId
|
||||
b.live2d = poolManager:LoadLive(MapFloatingConfig[iconId].name, Util.GetTransform(b.gameObject, "root"),
|
||||
MapFloatingConfig[iconId].scale, MapFloatingConfig[iconId].position)
|
||||
b.skeleton = b.live2d:GetComponent("SkeletonGraphic")
|
||||
setmetatable(b, { __index = MonsterLiveView })
|
||||
return b
|
||||
end
|
||||
|
||||
-- 设置事件点动画
|
||||
function MonsterLiveView:SetPointAnimation(iconId, index)
|
||||
local skeleton = self.live:GetComponent("SkeletonGraphic")
|
||||
local animation = ANIMATION[iconId]
|
||||
if animation then
|
||||
local aniName = ANIMATION[iconId].animation[index]
|
||||
if aniName then
|
||||
skeleton.AnimationState:SetAnimation(0, aniName, false)
|
||||
end
|
||||
else
|
||||
--Log("当前地图点立绘没有其他动画!")
|
||||
end
|
||||
end
|
||||
|
||||
function MonsterLiveView:OnClose()
|
||||
if self.live2d then
|
||||
poolManager:UnLoadLive(self.livePath, self.live2d)
|
||||
end
|
||||
self.live2d = nil
|
||||
|
||||
if self.gameObject then
|
||||
poolManager:UnLoadAsset(self.resPath, self.gameObject, PoolManager.AssetType.GameObject)
|
||||
self.gameObject = nil
|
||||
end
|
||||
end
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 466fbdaeca854c544bd4a8debb264883
|
||||
timeCreated: 1558942282
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,132 +0,0 @@
|
|||
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
|
|
@ -0,0 +1,169 @@
|
|||
SingleStoryPlayerView = {}
|
||||
local MapPointConfig = ConfigManager.GetConfig(ConfigName.MapPointConfig)
|
||||
|
||||
function SingleStoryPlayerView:New(gameObject)
|
||||
local b = {}
|
||||
b.gameObject = gameObject
|
||||
b.transform = gameObject.transform
|
||||
setmetatable(b, { __index = SingleStoryPlayerView })
|
||||
return b
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:InitComponent()
|
||||
self.roleRoot = Util.GetGameObject(self.gameObject,"roleRoot")
|
||||
self.nameDi = Util.GetGameObject(self.gameObject, "nemeDi")
|
||||
self.name = Util.GetGameObject(self.nameDi, "name"):GetComponent("Text")
|
||||
self.roads = {}
|
||||
self.startPos = {}
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:OnOpen(parent)
|
||||
self.parent = parent
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:SetData(data,playerType)
|
||||
if self.playerLiveView then
|
||||
self.playerLiveView:OnClose()
|
||||
self.playerLiveView = nil
|
||||
end
|
||||
LogGreen("playerType:"..playerType)
|
||||
if playerType == 0 then
|
||||
self:SetRoads0(data)
|
||||
elseif playerType == 1 then
|
||||
self:SetRoads1(data)
|
||||
end
|
||||
self.gameObject.transform.localPosition = self.startPos
|
||||
self.gameObject.transform.localScale = Vector3.one * 1.5
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:SetRoads0(data)
|
||||
for i = 2 ,#data do
|
||||
local road = {}
|
||||
road.indexType = 0
|
||||
local vecs = string.split(data[i],',')
|
||||
road.vec = Vector3.New(tonumber(vecs[1] or 0),tonumber(vecs[2] or 0),tonumber(vecs[2] or 0))
|
||||
table.insert(self.roads,road)
|
||||
end
|
||||
self.startPos = self.roads[1].vec
|
||||
local pointId = data[1]
|
||||
self.playerLiveView = MonsterLiveView.New(self.roleRoot,pointId)
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:SetRoads1(data)
|
||||
self.playerLiveView = PlayerLiveView:New(self.roleRoot,1,nil)
|
||||
self.playerLiveView:OnOpen(GetPlayerRoleSingleConFig().Scale2)
|
||||
self.playerLiveView.name = "npc"
|
||||
self:SetWalkDir(WALK_DIR.IDLE_BACK)
|
||||
PlayUIAnim(self.gameObject)
|
||||
for i = 1 ,#data do
|
||||
local road = {}
|
||||
road.indexType = tonumber(data[i][1]) --这个点是人的还是地图的
|
||||
local vecs = string.split(data[i][2],',')
|
||||
road.vec = Vector3.New(tonumber(vecs[1] or 0),tonumber(vecs[2] or 0),tonumber(vecs[2] or 0))
|
||||
table.insert(self.roads,road)
|
||||
end
|
||||
self.startPos = self.roads[1].vec
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:SetWalkDir(dir)
|
||||
self.playerLiveView:SetWalkDir(dir)
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:RunMap(pathList)
|
||||
if not pathList or #pathList == 0 then
|
||||
self.parent.AsideTriggerJudge(self.roleCurPos,self.isSelf,self)
|
||||
return
|
||||
end
|
||||
|
||||
-- --把最终回调最先入栈
|
||||
-- self.callList:Push(function ()
|
||||
-- local eventPoint = self.parent.AsideTriggerJudge(self.roleCurPos,self.isSelf,self)
|
||||
-- self:RoleWalkEnd(eventPoint)
|
||||
-- end)
|
||||
|
||||
for i=1, #pathList-1 do --最后的点为起点,不处理
|
||||
local data = pathList[i]
|
||||
local v3 = TileMapView.GetLiveTilePos(data.u, data.v)
|
||||
self.callList:Push(function ()
|
||||
self:SetRoleDirAction(data.u, data.v)
|
||||
self.roleCurPos = data
|
||||
local speed = 0.5
|
||||
self.gameObject.transform:DOLocalMove(Vector3(v3.x, v3.y, v3.z - 10), speed, false):OnStart(function () end):OnUpdate(function() --TODO:测试速度
|
||||
self:PlayStepSound()
|
||||
if self.isSelf then
|
||||
local v4 = self.gameObject.transform.localPosition
|
||||
v4.z = TileMapView.ViewCameraPos.z
|
||||
TileMapView.SetCameraPos(v4)
|
||||
end
|
||||
end):OnComplete(function ()
|
||||
self.parent.AsideTriggerJudge(data,self.isSelf,self)
|
||||
--self:SetRoleHitTarget()
|
||||
if self.state == 0 then
|
||||
self:StackPop()
|
||||
end
|
||||
end):SetEase(Ease.Linear)
|
||||
end)
|
||||
end
|
||||
self:StackPop()
|
||||
self:PlayerMove()
|
||||
end
|
||||
|
||||
-- 角色停止行走时的朝向
|
||||
function SingleStoryPlayerView:SetRoleDir(rolePos, iconPos)
|
||||
local u0, v0 = Map_Pos2UV(rolePos)
|
||||
local u, v = Map_Pos2UV(iconPos)
|
||||
if v0 == v then
|
||||
if u0 > u then
|
||||
self.m_roleFaceDir = Vector2.New(-1, 0)
|
||||
--LogGreen("他要朝左左左左左")
|
||||
self.eventpoint = 3
|
||||
else
|
||||
self.m_roleFaceDir = Vector2.New(1, 0)
|
||||
--LogGreen("他要朝右右右右")
|
||||
self.eventpoint = 4
|
||||
end
|
||||
else
|
||||
if v0 > v then
|
||||
self.m_roleFaceDir = Vector2.New(0, 1)
|
||||
--LogGreen("他要朝上上上上")
|
||||
self.eventpoint = 2
|
||||
else
|
||||
self.m_roleFaceDir = Vector2.New(0, -1)
|
||||
--LogGreen("他要朝下下下下下下")
|
||||
self.eventpoint = 1
|
||||
end
|
||||
end
|
||||
self:SetWalkDir(self.eventpoint)
|
||||
end
|
||||
|
||||
|
||||
-- 角色相关
|
||||
function SingleStoryPlayerView:SetRoleDirAction(u, v, isBack)
|
||||
local dU = isBack and self.roleCurPos.u - u or u - self.roleCurPos.u
|
||||
local dV = isBack and self.roleCurPos.v - v or v - self.roleCurPos.v
|
||||
|
||||
if dU > 0 then
|
||||
self:SetWalkDir(WALK_DIR.RUN_RIGHT)
|
||||
elseif dU < 0 then
|
||||
self:SetWalkDir(WALK_DIR.RUN_LEFT)
|
||||
elseif dV < 0 then
|
||||
self:SetWalkDir(WALK_DIR.RUN_UP)
|
||||
elseif dV > 0 then
|
||||
self:SetWalkDir(WALK_DIR.RUN_DOWN)
|
||||
end
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:StackPop()
|
||||
if self.callList:Count() > 0 then
|
||||
self.callList:Pop()()
|
||||
end
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:StopAction()
|
||||
|
||||
end
|
||||
|
||||
function SingleStoryPlayerView:OnClose()
|
||||
|
||||
end
|
||||
return SingleStoryPlayerView
|
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e9b905e36995c49419bb343b9d602499
|
||||
guid: a5e6e759736216e49b20d139d269f993
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
Loading…
Reference in New Issue