更新Debug显示和CameraControl逻辑
This commit is contained in:
parent
3f7c4cc906
commit
6797b1506a
@ -2510,6 +2510,146 @@ Transform:
|
||||
- {fileID: 7721300768295208340}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2844642383101811655
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2459473635733629125}
|
||||
- component: {fileID: 6828237386455592517}
|
||||
- component: {fileID: 1821229862124526660}
|
||||
m_Layer: 5
|
||||
m_Name: DebugText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2459473635733629125
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2844642383101811655}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7721300768295208340}
|
||||
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.000014782, y: -1.1984}
|
||||
m_SizeDelta: {x: 20, y: 8.0737}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &6828237386455592517
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2844642383101811655}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1821229862124526660
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2844642383101811655}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: 'CID=11 PID=11 CIV=0 PW=20
|
||||
|
||||
PST=Attack CST=Attack
|
||||
|
||||
Tech = {climb,strategy,}
|
||||
|
||||
'
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2100000, guid: 79459efec17a4d00a321bdcc27bbc385, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 1
|
||||
m_fontSizeBase: 1
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &3144314437940584699
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2882,7 +3022,7 @@ SpriteRenderer:
|
||||
m_Size: {x: 1.04, y: 0.4}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_WasSpriteAssigned: 0
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &3598485619821367844
|
||||
@ -3821,6 +3961,7 @@ RectTransform:
|
||||
m_Children:
|
||||
- {fileID: 8017188341615964620}
|
||||
- {fileID: 3648716934447262115}
|
||||
- {fileID: 2459473635733629125}
|
||||
m_Father: {fileID: 8275835195553492470}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@ -6101,7 +6242,7 @@ SpriteRenderer:
|
||||
m_Size: {x: 1.04, y: 0.4}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_WasSpriteAssigned: 0
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &7700832997934716087
|
||||
|
||||
@ -187,7 +187,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &6893524809116217944
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2669,6 +2669,181 @@ SpriteRenderer:
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &8427678302211389222
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5726358984275932298}
|
||||
- component: {fileID: 5119744184301341045}
|
||||
- component: {fileID: 5312450703857575453}
|
||||
m_Layer: 0
|
||||
m_Name: DebugText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5726358984275932298
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8427678302211389222}
|
||||
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_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1494252107283779432}
|
||||
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.056, y: -5.2333}
|
||||
m_SizeDelta: {x: 4.3621, y: 1.5949}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!23 &5119744184301341045
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8427678302211389222}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 79459efec17a4d00a321bdcc27bbc385, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!114 &5312450703857575453
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8427678302211389222}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: 'ID 507
|
||||
|
||||
pos 5-7
|
||||
|
||||
'
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2100000, guid: 79459efec17a4d00a321bdcc27bbc385, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 5
|
||||
m_fontSizeBase: 5
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 0
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
_SortingLayer: 0
|
||||
_SortingLayerID: 0
|
||||
_SortingOrder: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_renderer: {fileID: 5119744184301341045}
|
||||
m_maskType: 0
|
||||
--- !u!1 &8570462814627821500
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2717,6 +2892,7 @@ Transform:
|
||||
- {fileID: 7189137405236079512}
|
||||
- {fileID: 2882006479987597949}
|
||||
- {fileID: 2733067475856537485}
|
||||
- {fileID: 5726358984275932298}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8685428117340322119
|
||||
|
||||
@ -924,7 +924,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4648123304325160400
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -934,14 +934,14 @@ RectTransform:
|
||||
m_GameObject: {fileID: 6035190765260954166}
|
||||
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_ConstrainProportionsScale: 0
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1774352506934932859}
|
||||
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: 13.78, y: -2.75}
|
||||
m_AnchoredPosition: {x: 6.66, y: -0.54}
|
||||
m_SizeDelta: {x: 20, y: 10}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7200347576800930521
|
||||
@ -974,8 +974,8 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_text: DebugText
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 5302535af1044152a457ed104f1f4b91, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2100000, guid: 79459efec17a4d00a321bdcc27bbc385, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
@ -1005,7 +1005,7 @@ MonoBehaviour:
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_fontStyle: 1
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
@ -1038,7 +1038,7 @@ MonoBehaviour:
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 1
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &6162041515234446468
|
||||
|
||||
@ -631,6 +631,18 @@ namespace Logic.Action
|
||||
info.Cost: 0;
|
||||
}
|
||||
|
||||
public virtual float GetTime()
|
||||
{
|
||||
//TODO 这里通用返回值要读表
|
||||
return 0.1f;
|
||||
}
|
||||
|
||||
public virtual bool CameraControl()
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public float GetValue()
|
||||
{
|
||||
return 1f;
|
||||
|
||||
@ -133,7 +133,6 @@ namespace Logic
|
||||
UIManager.GameInit(MapData);
|
||||
MapGeneratorLogic.GenerateMap(MapData);
|
||||
MapRenderer.FirstRenderMap();
|
||||
//mapRenderer.CameraFocusOnTile(map.player[map.renko].cityList[0].cityCenter);
|
||||
|
||||
//移动镜头+显示开局提示
|
||||
|
||||
@ -141,7 +140,7 @@ namespace Logic
|
||||
var selfp = MapData.PlayerMap.SelfPlayerData;
|
||||
if(MapData.GetCapitalCityDataByPlayerId(selfp.Id, out var cap)
|
||||
&& MapData.GetGridDataByCityId(cap.Id, out var grid))
|
||||
camera.CameraFocusOnGrid(grid);
|
||||
camera.CameraFocusOnGrid(grid,true);
|
||||
UIManager.CenterMessageUI.SetCenterMessageShow(UICenterMessageID.StartGame,MapData.PlayerMap.SelfPlayerData);
|
||||
GameLogic.ChangeState(GameState.PlayerRound);
|
||||
}
|
||||
|
||||
@ -63,7 +63,6 @@ namespace Logic
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool hasUnit = _main.MapData.GetUnitDataByGid(gridData.Id,out var unitData);
|
||||
//Debug.Log(hasUnit);
|
||||
var roGrid = _main.MapRenderer.ROGridMap[gridData.Id];
|
||||
@ -76,6 +75,8 @@ namespace Logic
|
||||
//如果是由选择人切为选择地块
|
||||
if (roUnit.IsSelectHighlight)
|
||||
{
|
||||
//切换相机镜头
|
||||
_main.MapRenderer.CameraController.CameraFocusOnGrid(gridData);
|
||||
CancelAllHighlight();
|
||||
_main.MapRenderer.ROGridMap[gridData.Id].SetSelectHighlight(true);
|
||||
_main.UIManager.BottomInfoUI.SetBottomInfoShowGrid(gridData.Id);
|
||||
@ -90,6 +91,8 @@ namespace Logic
|
||||
//如果是选择角色
|
||||
else if (!roGrid.IsSelectHighlight)
|
||||
{
|
||||
//切换相机镜头
|
||||
_main.MapRenderer.CameraController.CameraFocusOnGrid(gridData);
|
||||
CancelAllHighlight();
|
||||
_main.MapRenderer.ROUnitMap[unitData.Id].SetSelectHighlight(true);
|
||||
_main.MapRenderer.ROUnitMap[unitData.Id].SetBounceAnim();
|
||||
@ -118,6 +121,8 @@ namespace Logic
|
||||
{
|
||||
CancelAllHighlight();
|
||||
Main.UnitLogic.MoveTo(_main.MapData, _main.MapRenderer.SelectUnitData, gridData,MoveType.ActiveMove);
|
||||
//切换相机镜头
|
||||
_main.MapRenderer.CameraController.CameraFocusOnGrid(gridData);
|
||||
_main.UIManager.BottomInfoUI.UIBottomInfoStatus = false;
|
||||
if (_main.MapRenderer.CheckUnitHasMoveAttackTarget(_main.MapRenderer.SelectUnitData.Id))
|
||||
{
|
||||
@ -134,6 +139,8 @@ namespace Logic
|
||||
//如果是地块点击
|
||||
else if (!roGrid.IsSelectHighlight)
|
||||
{
|
||||
//切换相机镜头
|
||||
_main.MapRenderer.CameraController.CameraFocusOnGrid(gridData);
|
||||
CancelAllHighlight();
|
||||
_main.MapRenderer.ROGridMap[gridData.Id].SetSelectHighlight(true);
|
||||
|
||||
|
||||
@ -10,6 +10,8 @@ namespace TH1Renderer
|
||||
private MapData _mapData;
|
||||
private Main _main;
|
||||
private GameObject _ROCityInfo;
|
||||
private GameObject _RODebugText;
|
||||
private TextMeshProUGUI _debugText;
|
||||
private uint _cityId;
|
||||
|
||||
//-------- Update缓存数据 --------//
|
||||
@ -29,6 +31,8 @@ namespace TH1Renderer
|
||||
Vector3 tpos = Table.Instance.GridToWorld(_gridData,"isCityInfo");
|
||||
|
||||
_ROCityInfo = GameObject.Instantiate(prefab,tpos, Quaternion.identity, father);
|
||||
_RODebugText = _ROCityInfo.transform.Find("CityInfoCanvas/DebugText").gameObject;
|
||||
_debugText = _RODebugText.GetComponent<TextMeshProUGUI>();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
@ -41,6 +45,8 @@ namespace TH1Renderer
|
||||
_cityData.CityInfoRenderMark = false;
|
||||
RenderUpdateCityInfo();
|
||||
}
|
||||
|
||||
RenderUpdateDebug();
|
||||
}
|
||||
|
||||
public void RenderUpdateCityInfo()
|
||||
@ -56,9 +62,39 @@ namespace TH1Renderer
|
||||
//更新城市名,会自动处理不在视野的情况
|
||||
RenderUpdateCityName();
|
||||
_ROCityInfo.SetActive(_mapData.PlayerMap.SelfPlayerData.Sight.CheckIsInSight(_gridData.Id));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void RenderUpdateDebug()
|
||||
{
|
||||
if (DebugCenter.Instance.DebugMode)
|
||||
{
|
||||
if(!_RODebugText.activeSelf)
|
||||
_RODebugText.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_RODebugText.SetActive(false);
|
||||
return;
|
||||
}
|
||||
_debugText.text = "";
|
||||
_debugText.text += $"CID={_cityId} PID={_playerData.Id} CIV={_playerData.PlayerCivId} gold={_playerData.PlayerWealth}\n";
|
||||
//如果不是我方单位,显示city和player的战略
|
||||
if(!_mapData.CheckCityIdBelongPlayerId(_cityId,_mapData.PlayerMap.SelfPlayerData.Id))
|
||||
if (MainEditor.Instance.Data != null)
|
||||
_debugText.text += $"CST={MainEditor.Instance.GetCityStrategy(_cityId)} PST={MainEditor.Instance.GetPlayerStrategy(_playerData.Id)}";
|
||||
|
||||
//如果是首都,展示科技
|
||||
if (_cityData.IsCapital)
|
||||
{
|
||||
_debugText.text += "tech={";
|
||||
foreach (var tech in _playerData.TechTree.TechList)
|
||||
{
|
||||
_debugText.text += tech + ",";
|
||||
}
|
||||
_debugText.text += "}\n";
|
||||
}
|
||||
}
|
||||
private void RenderUpdateCityConnected()
|
||||
{
|
||||
bool st = false;
|
||||
|
||||
@ -9,7 +9,7 @@ using TMPro.Examples;
|
||||
using Unity.IO.LowLevel.Unsafe;
|
||||
using Object = UnityEngine.Object;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
using TMPro;
|
||||
namespace TH1Renderer
|
||||
{
|
||||
|
||||
@ -49,7 +49,9 @@ namespace TH1Renderer
|
||||
_cityBorderDownRight,
|
||||
_selectHighlight,
|
||||
_moveHighlight,
|
||||
_effect;
|
||||
_effect,
|
||||
_RODebugText;
|
||||
private TextMeshPro _debugText;
|
||||
|
||||
public int x, y;
|
||||
string forcesName, civName;
|
||||
@ -285,8 +287,27 @@ namespace TH1Renderer
|
||||
_gridData.CityBuildingRenderMark = false;
|
||||
RenderUpdateCityBuilding(_cityData.Id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void RenderUpdateDebug()
|
||||
{
|
||||
if (DebugCenter.Instance.DebugMode)
|
||||
{
|
||||
if(!_RODebugText.activeSelf)
|
||||
_RODebugText.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_RODebugText.SetActive(false);
|
||||
return;
|
||||
}
|
||||
_debugText.text = "";
|
||||
_debugText.text += $"ID={_gridId}\n";
|
||||
_debugText.text += $"pos={_gridData.Pos.X} {_gridData.Pos.Y}\n";
|
||||
|
||||
}
|
||||
|
||||
public void Init(GridData t)
|
||||
{
|
||||
x = (int)t.Pos.X;
|
||||
@ -314,6 +335,9 @@ namespace TH1Renderer
|
||||
_selectHighlight = _ROGrid.transform.Find("SelectHighlight").gameObject;
|
||||
_moveHighlight = _ROGrid.transform.Find("MoveHighlight").gameObject;
|
||||
_effect = _ROGrid.transform.Find("Effect").gameObject;
|
||||
_RODebugText = _ROGrid.transform.Find("DebugText").gameObject;
|
||||
_debugText = _RODebugText.GetComponent<TextMeshPro>();
|
||||
|
||||
|
||||
foreach(Transform child in _effect.transform)
|
||||
child.gameObject.SetActive(false);
|
||||
@ -326,6 +350,7 @@ namespace TH1Renderer
|
||||
UpdateCityWall();
|
||||
UpdateCityBorder();
|
||||
UpdateFog();
|
||||
RenderUpdateDebug();
|
||||
//UpdateBorder();fog自带updateborder
|
||||
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ namespace TH1Renderer
|
||||
private Transform _gridRenderMap;
|
||||
|
||||
Transform _cityInfoRenderMap;
|
||||
CameraController cameraController;
|
||||
public CameraController CameraController;
|
||||
public EffectManager EffectManager; //特效管理器,管理目前所有特效
|
||||
public ProjectileManager ProjectileManager;
|
||||
|
||||
@ -99,7 +99,7 @@ namespace TH1Renderer
|
||||
}
|
||||
else if (rootObject.name == "Main Camera")
|
||||
{
|
||||
cameraController = rootObject.GetComponent<CameraController>();
|
||||
CameraController = rootObject.GetComponent<CameraController>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -248,11 +248,6 @@ namespace TH1Renderer
|
||||
|
||||
}
|
||||
|
||||
//调整当前相机锁定一个tile
|
||||
public void CameraFocusOnTile(Vector2Int tilePosition)
|
||||
{
|
||||
//cameraController.FocusOnTile(highlightGridMap, tilePosition);
|
||||
}
|
||||
|
||||
//当gridMap出现新的对象时,新建对象
|
||||
public void RenderUpdateGridMap()
|
||||
|
||||
@ -346,8 +346,7 @@ namespace TH1Renderer
|
||||
//初拉单位和selfplayer的视野关系
|
||||
RenderUpdateSelfPlayerSight();
|
||||
//DebugRender
|
||||
if (DebugCenter.Instance.DebugMode)
|
||||
RenderUpdateDebug();
|
||||
RenderUpdateDebug();
|
||||
|
||||
|
||||
|
||||
@ -477,9 +476,25 @@ namespace TH1Renderer
|
||||
|
||||
public void RenderUpdateDebug()
|
||||
{
|
||||
if(!_RODebugText.activeSelf)
|
||||
_RODebugText.SetActive(true);
|
||||
_debugText.text = _unitData.Id.ToString();
|
||||
if (DebugCenter.Instance.DebugMode)
|
||||
{
|
||||
if(!_RODebugText.activeSelf)
|
||||
_RODebugText.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_RODebugText.SetActive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
_debugText.text = "";
|
||||
_debugText.text += $"ID{_unitId} AP{_unitData.AP} MP{_unitData.MP} CP{_unitData.MP}\n";
|
||||
|
||||
//如果不是我方单位,显示军团及unit的战略
|
||||
_debugText.text += $"Lid={_unitData.LegionId}\n";
|
||||
if(!_mapData.CheckUnitIdBelongPlayerId(_unitData.Id,_mapData.PlayerMap.SelfPlayerData.Id))
|
||||
if(MainEditor.Instance.Data != null)
|
||||
_debugText.text += $"ST:{MainEditor.Instance.GetUnitStrategy(_unitId,_unitData.LegionId,_playerData.Id)}";
|
||||
}
|
||||
public void RenderUpdateSelfPlayerSight()
|
||||
{
|
||||
|
||||
@ -11,20 +11,55 @@ public class CameraController : MonoBehaviour
|
||||
public float maxZoom = 15f; // 最大缩放值
|
||||
public float panSpeed = 0.5f; // 拖动地图的速度
|
||||
|
||||
private Vector3 dragOrigin; // 记录拖动起点
|
||||
|
||||
//相机拖动相关参数
|
||||
private Vector3 _dragOrigin; // 记录拖动起点
|
||||
|
||||
|
||||
//相机移动上下边界
|
||||
public float minX = -200f;
|
||||
public float maxX = 200f;
|
||||
public float minY = -60f;
|
||||
public float maxY = 230f;
|
||||
|
||||
//相机移动动画相关参数
|
||||
public float moveSpeed = 0.5f; // 平滑移动速度
|
||||
private Vector3? _smoothTargetPosition = null; //记录相机平滑移动的起点
|
||||
private Vector3 _startPos;
|
||||
private float _moveProgress = 0f;
|
||||
private float _moveDuration = 0.5f; // 可调节移动总时长
|
||||
private bool _isMoving = false;
|
||||
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
HandleSmoothMove();
|
||||
if (UIBlockCameraDrag.IsPointerOnUI) return;
|
||||
HandleZoom(); // 控制缩放
|
||||
HandlePan(); // 控制拖动
|
||||
HandleZoom();
|
||||
HandlePan();
|
||||
|
||||
}
|
||||
|
||||
void HandleSmoothMove()
|
||||
{
|
||||
if (_isMoving && _smoothTargetPosition.HasValue)
|
||||
{
|
||||
_moveProgress += Time.deltaTime / _moveDuration;
|
||||
float t = Mathf.SmoothStep(0, 1, _moveProgress); // 缓动曲线
|
||||
|
||||
Vector3 targetPos = _smoothTargetPosition.Value;
|
||||
Camera.main.transform.position = Vector3.Lerp(_startPos, targetPos, t);
|
||||
|
||||
if (_moveProgress >= 1f)
|
||||
{
|
||||
Camera.main.transform.position = targetPos;
|
||||
_smoothTargetPosition = null;
|
||||
_isMoving = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HandleZoom()
|
||||
{
|
||||
// 获取滚轮输入
|
||||
@ -39,12 +74,12 @@ public class CameraController : MonoBehaviour
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
dragOrigin = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
_dragOrigin = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
}
|
||||
|
||||
if (Input.GetMouseButton(0))
|
||||
{
|
||||
Vector3 difference = dragOrigin - Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
Vector3 difference = _dragOrigin - Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
Vector3 targetPosition = Camera.main.transform.position + difference;
|
||||
|
||||
// 计算当前相机视野的一半宽高
|
||||
@ -63,51 +98,93 @@ public class CameraController : MonoBehaviour
|
||||
Camera.main.transform.position = targetPosition;
|
||||
}
|
||||
}
|
||||
/*void HandlePan()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0)) // 鼠标左键按下,记录起点
|
||||
{
|
||||
dragOrigin = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
}
|
||||
|
||||
if (Input.GetMouseButton(0)) // 鼠标左键拖动
|
||||
{
|
||||
Vector3 difference = dragOrigin - Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
Camera.main.transform.position += difference;
|
||||
}
|
||||
|
||||
if (Input.GetMouseButton(0))
|
||||
{
|
||||
Vector3 difference = dragOrigin - Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||
Vector3 newPosition = Camera.main.transform.position + difference;
|
||||
|
||||
// 限制位置在边界内
|
||||
newPosition.x = Mathf.Clamp(newPosition.x, minX, maxX);
|
||||
newPosition.y = Mathf.Clamp(newPosition.y, minY, maxY);
|
||||
|
||||
Camera.main.transform.position = newPosition;
|
||||
}
|
||||
}*/
|
||||
public void CameraFocusOnGrid(GridData gridData)
|
||||
|
||||
public void CameraFocusOnGrid(GridData gridData, bool Center = false)
|
||||
{
|
||||
Center = false;
|
||||
Vector3 worldPosition = Table.Instance.GridToWorld(gridData);
|
||||
|
||||
float vertExtent = Camera.main.orthographicSize;
|
||||
float horzExtent = vertExtent * Camera.main.aspect;
|
||||
|
||||
float clampedX = Mathf.Clamp(worldPosition.x, minX + horzExtent, maxX - horzExtent);
|
||||
float clampedY = Mathf.Clamp(worldPosition.y, minY + vertExtent, maxY - vertExtent);
|
||||
if (Center)
|
||||
{
|
||||
float clampedX = Mathf.Clamp(worldPosition.x, minX + horzExtent, maxX - horzExtent);
|
||||
float clampedY = Mathf.Clamp(worldPosition.y, minY + vertExtent, maxY - vertExtent);
|
||||
Vector3 finalTarget = new Vector3(clampedX, clampedY, Camera.main.transform.position.z);
|
||||
|
||||
_startPos = Camera.main.transform.position;
|
||||
_smoothTargetPosition = finalTarget;
|
||||
_moveProgress = 0f;
|
||||
_isMoving = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector3 camPos = Camera.main.transform.position;
|
||||
|
||||
// 获取世界坐标 → 屏幕坐标
|
||||
Vector3 screenPos = Camera.main.WorldToScreenPoint(worldPosition);
|
||||
|
||||
float screenWidth = Screen.width;
|
||||
float screenHeight = Screen.height;
|
||||
|
||||
// 原始区域尺寸
|
||||
float boxWidth = 800f;
|
||||
float boxHeight = 500f;
|
||||
|
||||
// 削减左侧150像素后的区域
|
||||
float reducedLeft = 150f;
|
||||
float adjustedBoxWidth = boxWidth - reducedLeft;
|
||||
|
||||
float xMax = (screenWidth + boxWidth) / 2f; // 保持右侧不变
|
||||
float xMin = xMax - adjustedBoxWidth; // 左侧往右收缩150像素
|
||||
float yMin = (screenHeight - boxHeight) / 2f;
|
||||
float yMax = (screenHeight + boxHeight) / 2f;
|
||||
|
||||
|
||||
// 如果点已经在框中,不动
|
||||
if (screenPos.x >= xMin && screenPos.x <= xMax &&
|
||||
screenPos.y >= yMin && screenPos.y <= yMax)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算目标点应该在屏幕中央框内的“目标屏幕位置”
|
||||
float targetScreenX = Mathf.Clamp(screenPos.x, xMin, xMax);
|
||||
float targetScreenY = Mathf.Clamp(screenPos.y, yMin, yMax);
|
||||
Vector3 desiredScreenPos = new Vector3(targetScreenX, targetScreenY, screenPos.z);
|
||||
|
||||
// 将这个屏幕位置转回世界空间
|
||||
Vector3 desiredWorldPos = Camera.main.ScreenToWorldPoint(desiredScreenPos);
|
||||
|
||||
// 计算需要相机移动的 delta = 当前格子位置 - 应该出现在的位置
|
||||
Vector3 offset = worldPosition - desiredWorldPos;
|
||||
Vector3 targetPos = camPos + offset;
|
||||
|
||||
// 限制相机移动范围
|
||||
vertExtent = Camera.main.orthographicSize;
|
||||
horzExtent = vertExtent * Camera.main.aspect;
|
||||
float minXClamp = minX + horzExtent;
|
||||
float maxXClamp = maxX - horzExtent;
|
||||
float minYClamp = minY + vertExtent;
|
||||
float maxYClamp = maxY - vertExtent;
|
||||
|
||||
targetPos.x = Mathf.Clamp(targetPos.x, minXClamp, maxXClamp);
|
||||
targetPos.y = Mathf.Clamp(targetPos.y, minYClamp, maxYClamp);
|
||||
|
||||
// 平滑移动
|
||||
_startPos = camPos;
|
||||
_smoothTargetPosition = new Vector3(targetPos.x, targetPos.y, camPos.z);
|
||||
_moveProgress = 0f;
|
||||
_isMoving = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Camera.main.transform.position = new Vector3(clampedX, clampedY, Camera.main.transform.position.z);
|
||||
}
|
||||
/*public void CameraFocusOnGrid(GridData gridData)
|
||||
{
|
||||
// 将Tilemap的格子坐标转换为世界坐标
|
||||
Vector3 worldPosition = Table.Instance.GridToWorld(gridData);
|
||||
|
||||
// 让摄像机平移到该位置,保持z轴不变
|
||||
Camera.main.transform.position = new Vector3(worldPosition.x, worldPosition.y, Camera.main.transform.position.z);
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -2,20 +2,25 @@
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: LiberationSans SDF - Outline
|
||||
m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3}
|
||||
m_ShaderKeywords: OUTLINE_ON
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- OUTLINE_ON
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 5
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
@ -32,14 +37,14 @@ Material:
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 28684132378477856, guid: 8f586378b4e144a9851e7b34d9b748ee,
|
||||
type: 2}
|
||||
m_Texture: {fileID: 28684132378477856, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OutlineTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _Ambient: 0.5
|
||||
- _Bevel: 0.5
|
||||
@ -50,6 +55,7 @@ Material:
|
||||
- _BumpFace: 0
|
||||
- _BumpOutline: 0
|
||||
- _ColorMask: 15
|
||||
- _CullMode: 0
|
||||
- _Diffuse: 0.5
|
||||
- _FaceDilate: 0.1
|
||||
- _FaceUVSpeedX: 0
|
||||
@ -65,7 +71,7 @@ Material:
|
||||
- _OutlineSoftness: 0
|
||||
- _OutlineUVSpeedX: 0
|
||||
- _OutlineUVSpeedY: 0
|
||||
- _OutlineWidth: 0.1
|
||||
- _OutlineWidth: 0.393
|
||||
- _PerspectiveFilter: 0.875
|
||||
- _Reflectivity: 10
|
||||
- _ScaleRatioA: 0.9
|
||||
@ -102,3 +108,4 @@ Material:
|
||||
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user