dev-0330的第一次合并 #6

Closed
45 wants to merge 1 commits from dev-0330 into dev-0524
  1. 4
      .gitignore
  2. BIN
      ColorlessWorld-2024-4-2/Assets/Image/enemyMark.png
  3. 127
      ColorlessWorld-2024-4-2/Assets/Image/enemyMark.png.meta
  4. 89
      ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab
  5. 137
      ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/enemyMark.mat
  6. 8
      ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/enemyMark.mat.meta
  7. 57
      ColorlessWorld-2024-4-2/Assets/Scenes/SampleScene.unity
  8. 238
      ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs
  9. 3
      ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardEntity.cs
  10. 15
      ColorlessWorld-2024-4-2/Assets/Scripts/Card/TurnMaster.cs
  11. 3
      ColorlessWorld-2024-4-2/Assets/Scripts/Card/UsedCard.cs
  12. 36
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/EnemyManager.cs
  13. 28
      ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/EnemyNode.cs
  14. 4
      ColorlessWorld-2024-4-2/Assets/Scripts/GameManager.cs
  15. 19
      ColorlessWorld-2024-4-2/Assets/Scripts/Handler/EffectRangeHandler7_2.cs
  16. 41
      ColorlessWorld-2024-4-2/Assets/Scripts/Handler/EffectRangeHandler8_2.cs
  17. 6
      ColorlessWorld-2024-4-2/Assets/Scripts/Handler/EffectRangeHandlerBase.cs
  18. 14
      ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs
  19. 3
      ColorlessWorld-2024-4-2/Assets/Scripts/Player.cs
  20. 5
      ColorlessWorld-2024-4-2/Assets/Scripts/Tool/CardData_SO/PlayerState_SO.cs
  21. 3
      ColorlessWorld-2024-4-2/Assets/Scripts/Tool/EffectRange.cs
  22. 18
      ColorlessWorld-2024-4-2/Assets/Scripts/Tool/MathTool.cs
  23. 110
      ColorlessWorld-2024-4-2/Assets/Scripts/Tool/getNodeTools.cs
  24. 14
      ColorlessWorld-2024-4-2/Assets/Scripts/UI/EnemyPlanActionUI.cs
  25. 10
      ColorlessWorld-2024-4-2/Assets/Scripts/manager/DestructionManager.cs
  26. 35
      ColorlessWorld-2024-4-2/Assets/Scripts/manager/MapUnityManager.cs
  27. 5
      ColorlessWorld-2024-4-2/Assets/Scripts/manager/SettlementManager.cs
  28. 9
      ColorlessWorld-2024-4-2/Assets/data/card_data.csv
  29. 3
      ColorlessWorld-2024-4-2/UserSettings/EditorUserSettings.asset
  30. 106
      ColorlessWorld-2024-4-2/UserSettings/Layouts/CurrentMaximizeLayout.dwlt
  31. 13
      ColorlessWorld-2024-4-2/UserSettings/Search.index
  32. 76
      ColorlessWorld-2024-4-2/UserSettings/Search.settings

4
.gitignore

@ -149,3 +149,7 @@ DerivedDataCache/*
ColorlessWorld-2024-4-2/Library/* ColorlessWorld-2024-4-2/Library/*
ColorlessWorld-2024-4-2/Logs/* ColorlessWorld-2024-4-2/Logs/*
ColorlessWorld-2024-4-2/UserSettings/*

BIN
ColorlessWorld-2024-4-2/Assets/Image/enemyMark.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

127
ColorlessWorld-2024-4-2/Assets/Image/enemyMark.png.meta

@ -0,0 +1,127 @@
fileFormatVersion: 2
guid: 02691098c39ccd6458dd3771b3004071
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 256
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

89
ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab

@ -59,9 +59,12 @@ MonoBehaviour:
locationY: 0 locationY: 0
compalte: 0 compalte: 0
influenced: 0 influenced: 0
markInfluenced: 0
choossedMark: {fileID: 1211505881046303546} choossedMark: {fileID: 1211505881046303546}
hightLigtMark: {fileID: 1502226451502315807}
red: {fileID: 2100000, guid: 876d1c111d915ca45b7304b41dcc1060, type: 2} red: {fileID: 2100000, guid: 876d1c111d915ca45b7304b41dcc1060, type: 2}
yellow: {fileID: 2100000, guid: cf59497cd92e036419cf5cfa2d1e4c79, type: 2} yellow: {fileID: 2100000, guid: cf59497cd92e036419cf5cfa2d1e4c79, type: 2}
enemyMark: {fileID: 2100000, guid: 5bc9b4d525fc54344935f187546b718b, type: 2}
plyerColour: {fileID: 2100000, guid: 8ec571d5570dab34ea8687ab32ac03ac, type: 2} plyerColour: {fileID: 2100000, guid: 8ec571d5570dab34ea8687ab32ac03ac, type: 2}
enemyColour: {fileID: 2100000, guid: 1f241e895118d564d8b61a307da80150, type: 2} enemyColour: {fileID: 2100000, guid: 1f241e895118d564d8b61a307da80150, type: 2}
colourGameObject: {fileID: 7818877686521749494} colourGameObject: {fileID: 7818877686521749494}
@ -123,7 +126,7 @@ GameObject:
- component: {fileID: 1240166201725739929} - component: {fileID: 1240166201725739929}
- component: {fileID: 8781005840710497347} - component: {fileID: 8781005840710497347}
m_Layer: 0 m_Layer: 0
m_Name: Cylinder m_Name: inf
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -194,6 +197,89 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &1502226451502315807
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8900614378456229163}
- component: {fileID: 8485410642332178147}
- component: {fileID: 6124836568472427169}
m_Layer: 0
m_Name: mark
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &8900614378456229163
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1502226451502315807}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.2}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4579690416932963536}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &8485410642332178147
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1502226451502315807}
m_Mesh: {fileID: -5468021829708598221, guid: ae332737a5755ee499c32f566d3a2913, type: 3}
--- !u!23 &6124836568472427169
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1502226451502315807}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
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: 5bc9b4d525fc54344935f187546b718b, 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!1 &7818877686521749494 --- !u!1 &7818877686521749494
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -332,6 +418,7 @@ Transform:
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 5510486009783351286} - {fileID: 5510486009783351286}
- {fileID: 8900614378456229163}
m_Father: {fileID: 2384686249825617783} m_Father: {fileID: 2384686249825617783}
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &2437255636331898785 --- !u!33 &2437255636331898785

137
ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/enemyMark.mat

@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: enemyMark
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHAPREMULTIPLY_ON
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- DepthOnly
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 02691098c39ccd6458dd3771b3004071, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 02691098c39ccd6458dd3771b3004071, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _DstBlendAlpha: 10
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0.5
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 1
- _WorkflowMode: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &1781025284166211548
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

8
ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/enemyMark.mat.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5bc9b4d525fc54344935f187546b718b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

57
ColorlessWorld-2024-4-2/Assets/Scenes/SampleScene.unity

@ -3370,6 +3370,7 @@ Transform:
- {fileID: 1227255859} - {fileID: 1227255859}
- {fileID: 14034787} - {fileID: 14034787}
- {fileID: 409697653} - {fileID: 409697653}
- {fileID: 678393340}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &365854624 --- !u!1 &365854624
@ -5154,7 +5155,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
time: 0.2 time: 0.2
moveSpeed: 2 moveSpeed: 4
--- !u!1 &557438114 --- !u!1 &557438114
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -6434,6 +6435,51 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 669923021} m_GameObject: {fileID: 669923021}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &678393339
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 678393340}
- component: {fileID: 678393341}
m_Layer: 0
m_Name: MapUnityManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &678393340
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 678393339}
serializedVersion: 2
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_Children: []
m_Father: {fileID: 348176937}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &678393341
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 678393339}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d344126aa8082fa48b7e5f19eff09202, type: 3}
m_Name:
m_EditorClassIdentifier:
castPool: []
--- !u!1 &680060074 --- !u!1 &680060074
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -9210,6 +9256,7 @@ MonoBehaviour:
usedCard: {fileID: 1964831963} usedCard: {fileID: 1964831963}
cardDeckNumberText: {fileID: 591146068} cardDeckNumberText: {fileID: 591146068}
usedCardNumberText: {fileID: 1278694494} usedCardNumberText: {fileID: 1278694494}
deleteCardNumberText: {fileID: 263387098}
currentCost: 0 currentCost: 0
totalCost: 0 totalCost: 0
turn: 4 turn: 4
@ -9422,7 +9469,7 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
m_Bits: 2176 m_Bits: 2176
time: 0.2 time: 0.2
moveSpeed: 2 moveSpeed: 4
--- !u!114 &1153479994 --- !u!114 &1153479994
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -9679,7 +9726,7 @@ MonoBehaviour:
cardPrefab: {fileID: 3410471369990512392, guid: d255d4b8a06372542bcbeef98cf4761c, cardPrefab: {fileID: 3410471369990512392, guid: d255d4b8a06372542bcbeef98cf4761c,
type: 3} type: 3}
cardList: 00000000 cardList: 00000000
cardDeck: 1127000012270000132700001427000015270000162700001727000018270000192700001a2700001b2700001c2700001d2700001e270000 cardDeck: 1127000012270000132700001427000015270000162700001727000018270000192700001a2700001b2700001c2700001d2700001e2700001f270000
--- !u!4 &1190351098 --- !u!4 &1190351098
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -10153,6 +10200,7 @@ MonoBehaviour:
templatePlayerState: {fileID: 11400000, guid: afd7daa84e9985b45bd00c91505acb37, templatePlayerState: {fileID: 11400000, guid: afd7daa84e9985b45bd00c91505acb37,
type: 2} type: 2}
playerState: {fileID: 0} playerState: {fileID: 0}
onDrag: 0
textMaxCost: {fileID: 2096369105} textMaxCost: {fileID: 2096369105}
textCurrentCost: {fileID: 791443579} textCurrentCost: {fileID: 791443579}
textMaxStep: {fileID: 219845941} textMaxStep: {fileID: 219845941}
@ -11235,7 +11283,7 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
m_Bits: 2176 m_Bits: 2176
time: 0.2 time: 0.2
moveSpeed: 2 moveSpeed: 4
--- !u!114 &1387589238 --- !u!114 &1387589238
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -15547,6 +15595,7 @@ MonoBehaviour:
cardPrefab: {fileID: 3410471369990512392, guid: d255d4b8a06372542bcbeef98cf4761c, cardPrefab: {fileID: 3410471369990512392, guid: d255d4b8a06372542bcbeef98cf4761c,
type: 3} type: 3}
usedCardList: usedCardList:
deleteCardList:
--- !u!1 &1966305439 --- !u!1 &1966305439
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

238
ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs

@ -8,6 +8,7 @@ using static EnemyNode;
using static UnityEngine.Rendering.DebugUI; using static UnityEngine.Rendering.DebugUI;
using System; using System;
using Unity.VisualScripting; using Unity.VisualScripting;
using System.Data;
public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{ {
@ -52,7 +53,7 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
{ {
Debug.Log("当前费用:" + TurnMaster.Instance.currentCost); Debug.Log("当前费用:" + TurnMaster.Instance.currentCost);
Debug.Log("总费用:" + Usermanager.Instance.totalCost); Debug.Log("总费用:" + Usermanager.Instance.totalCost);
if (TurnMaster.Instance.currentCost - cardEntity.cardOriginalData.Cost < 0) if (GameManager.Instance.playerState.currentCost - cardEntity.cardOriginalData.Cost < 0)
{ {
Debug.Log("费用不足"); Debug.Log("费用不足");
cardEntity.costEnough = false; cardEntity.costEnough = false;
@ -102,11 +103,11 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
private void resetComponentPosition() private void resetComponentPosition()
{ {
//遍历范围预览池消除影响色 //遍历范围预览池消除影响色
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) for (int i = 0; i < MapUnityManager.Instance.castPool.Count; i++)
{ {
GameManager.Instance.player.influencePreviewPool[i].influenced = false; MapUnityManager.Instance.castPool[i].influenced = false;
} }
GameManager.Instance.player.influencePreviewPool.Clear(); MapUnityManager.Instance.castPool.Clear();
//遍历影响池变色 //遍历影响池变色
for (int i = 0; i < cardEntity.influencePreviewPool.Count; i++) for (int i = 0; i < cardEntity.influencePreviewPool.Count; i++)
{ {
@ -128,6 +129,7 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
if (choosed && Mouse.current.rightButton.wasPressedThisFrame) if (choosed && Mouse.current.rightButton.wasPressedThisFrame)
{ {
GameManager.Instance.onDrag = false;
Debug.Log("取消释放"); Debug.Log("取消释放");
canUse = false;//取消释放 canUse = false;//取消释放
ainPanle.SetActive(false); ainPanle.SetActive(false);
@ -146,6 +148,7 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
{ {
return; return;
} }
GameManager.Instance.onDrag = true;
choosed = true; choosed = true;
GetComponent<CanvasGroup>().blocksRaycasts = false; GetComponent<CanvasGroup>().blocksRaycasts = false;
@ -190,7 +193,6 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
//重新调用范围预览 //重新调用范围预览
//GameManager.Instance.player.StepPreviewInfluencedNode(cardEntity.cardOriginalData.CastingRange); //GameManager.Instance.player.StepPreviewInfluencedNode(cardEntity.cardOriginalData.CastingRange);
setCastingRangePreview(cardEntity.cardOriginalData.EffectRange); setCastingRangePreview(cardEntity.cardOriginalData.EffectRange);
Debug.Log(cardEntity.cardOriginalData.CastingRange);
//预览影响范围 //预览影响范围
if (currentNode.influenced) if (currentNode.influenced)
{ {
@ -198,7 +200,6 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
Vector3 face = currentNode.transform.position - GameManager.Instance.playerOn.transform.position; Vector3 face = currentNode.transform.position - GameManager.Instance.playerOn.transform.position;
float euler = Vector3.SignedAngle(-GameManager.Instance.playerOn.transform.forward, face, GameManager.Instance.playerOn.transform.up) + 180; float euler = Vector3.SignedAngle(-GameManager.Instance.playerOn.transform.forward, face, GameManager.Instance.playerOn.transform.up) + 180;
Debug.Log("角度是:" + euler);
setEffectRangePreview(cardEntity.cardOriginalData.EffectRange, euler, currentNode); setEffectRangePreview(cardEntity.cardOriginalData.EffectRange, euler, currentNode);
//influencePreviewPool.Add(currentNode); //influencePreviewPool.Add(currentNode);
@ -213,13 +214,20 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
private void setCastingRangePreview(string effectRange) private void setCastingRangePreview(string effectRange)
{ {
for (int i = 0; i < MapUnityManager.Instance.castPool.Count; i++)
{
MapUnityManager.Instance.castPool[i].influenced = false;
}
MapUnityManager.Instance.castPool.Clear();
if (effectRange == EffectRange.range1) if (effectRange == EffectRange.range1)
{ {
GameManager.Instance.player.StepPreviewInfluencedNode(cardEntity.cardOriginalData.CastingRange); MapUnityManager.Instance.getCastPool(cardEntity.cardOriginalData.EffectRange, cardEntity.cardOriginalData.CastingRange);
//GameManager.Instance.player.StepPreviewInfluencedNode(cardEntity.cardOriginalData.CastingRange);
} }
else else
{ {
GameManager.Instance.player.StepPreviewInfluencedNode(1); MapUnityManager.Instance.getCastPool(cardEntity.cardOriginalData.EffectRange, cardEntity.cardOriginalData.CastingRange);
//GameManager.Instance.player.StepPreviewInfluencedNode(1);
/* MapUnity playerNode = GameManager.Instance.playerOn; /* MapUnity playerNode = GameManager.Instance.playerOn;
MapUnity currentNode = GameManager.Instance.playerOn; MapUnity currentNode = GameManager.Instance.playerOn;
castingPool.Clear(); castingPool.Clear();
@ -236,7 +244,6 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
} }
private void setEffectRangePreview(string effectRange, float euler, MapUnity currentNode) private void setEffectRangePreview(string effectRange, float euler, MapUnity currentNode)
{ {
Debug.Log("作用范围:" + effectRange);
MapUnity playerOnNode = GameManager.Instance.playerOn.transform.GetComponent<MapUnity>(); MapUnity playerOnNode = GameManager.Instance.playerOn.transform.GetComponent<MapUnity>();
var handlers = new Dictionary<string, EffectRangeHandler> var handlers = new Dictionary<string, EffectRangeHandler>
{ {
@ -264,86 +271,9 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
{ {
cardEntity.influencePreviewPool = handler.HandleAngleWithResult(euler); cardEntity.influencePreviewPool = handler.HandleAngleWithResult(euler);
} }
cardEntity.influencePreviewPool=MathTool.RemoveDuplicates(cardEntity.influencePreviewPool);
} }
/* private void showEffectRange3_2(float euler)
{
if (euler > 0 && euler < 45)
{
if (checkNodeInfluencedable(currentNode.unitPool[0]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[0]);
if (checkNodeInfluencedable(currentNode.unitPool[4]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[4]);
}
else if (euler > 45 && euler < 135)
{
if (checkNodeInfluencedable(currentNode.unitPool[1]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[1]);
if (checkNodeInfluencedable(currentNode.unitPool[5]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[5]);
}
else if (euler > 135 && euler < 180)
{
if (checkNodeInfluencedable(currentNode.unitPool[2]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[2]);
if (checkNodeInfluencedable(currentNode.unitPool[0]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[0]);
}
else if (euler > 180 && euler < 225)
{
if (checkNodeInfluencedable(currentNode.unitPool[1]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[1]);
if (checkNodeInfluencedable(currentNode.unitPool[3]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[3]);
}
else if (euler > 225 && euler < 315)
{
if (checkNodeInfluencedable(currentNode.unitPool[2]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[2]);
if (checkNodeInfluencedable(currentNode.unitPool[4]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[4]);
}
else if (euler > 315 && euler < 360)
{
if (checkNodeInfluencedable(currentNode.unitPool[3]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[3]);
if (checkNodeInfluencedable(currentNode.unitPool[5]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[5]);
}
}*/
/* private void showEffectRange2(float euler)
{
if (euler > 0 && euler <= 45)
{
if (checkNodeInfluencedable(currentNode.unitPool[2]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[2]);
}
else if (euler > 45 && euler <= 135)
{
if (checkNodeInfluencedable(currentNode.unitPool[3]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[3]);
}
else if (euler > 135 && euler <= 180)
{
if (checkNodeInfluencedable(currentNode.unitPool[4]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[4]);
}
else if (euler > 180 && euler <= 225)
{
if (checkNodeInfluencedable(currentNode.unitPool[5]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[5]);
}
else if (euler > 225 && euler <= 315)
{
if (checkNodeInfluencedable(currentNode.unitPool[0]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[0]);
}
else if (euler > 315 && euler <= 360)
{
if (checkNodeInfluencedable(currentNode.unitPool[1]))
cardEntity.influencePreviewPool.Add(currentNode.unitPool[1]);
}
}*/
private void getInfluencePreviePoll(MapUnity currentNode, string effecctRange) private void getInfluencePreviePoll(MapUnity currentNode, string effecctRange)
@ -359,7 +289,7 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
private void noAinPanleWork(PointerEventData eventData) private void noAinPanleWork(PointerEventData eventData)
{ {
Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.value); /*Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.value);
if (eventData.pointerCurrentRaycast.gameObject != null) if (eventData.pointerCurrentRaycast.gameObject != null)
{ {
if (Physics.Raycast(ray, out RaycastHit raycastHit)) if (Physics.Raycast(ray, out RaycastHit raycastHit))
@ -367,7 +297,8 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
currentNode = raycastHit.collider.transform.GetComponent<MapUnity>(); currentNode = raycastHit.collider.transform.GetComponent<MapUnity>();
cardEntity.influencePreviewPool.Add(currentNode); cardEntity.influencePreviewPool.Add(currentNode);
} }
} }*/
setEffectRangePreview(cardEntity.cardOriginalData.EffectRange, 30.0f, currentNode);
} }
public void OnDrag(PointerEventData eventData) public void OnDrag(PointerEventData eventData)
@ -383,8 +314,7 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
} }
else else
{ {
//没有范围不需要射线吧,因为不需要指定目标点? noAinPanleWork(eventData);
// noAinPanleWork(eventData);
} }
dyeing(); dyeing();
@ -403,114 +333,9 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
public void OnEndDrag(PointerEventData eventData) public void OnEndDrag(PointerEventData eventData)
{ {
StartCoroutine(OnDragIEnumerator(eventData)); GameManager.Instance.onDrag = false;
/* if (!cardEntity.costEnough)
{
return;
}
choosed = false;
if (canUse)
{
if (eventData.pointerCurrentRaycast.gameObject != null)
{
if (eventData.pointerCurrentRaycast.gameObject.name == "Card")
{
transform.SetParent(eventData.pointerCurrentRaycast.gameObject.transform.parent);
transform.position = eventData.pointerCurrentRaycast.gameObject.transform.position;
eventData.pointerCurrentRaycast.gameObject.transform.position = originalParent.position;
eventData.pointerCurrentRaycast.gameObject.transform.SetParent(originalParent);
GetComponent<CanvasGroup>().blocksRaycasts = true; StartCoroutine(OnDragIEnumerator(eventData));
ainPanle.SetActive(false);//关闭贝塞尔曲线
//遍历范围预览池消除影响色
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++)
{
GameManager.Instance.player.influencePreviewPool[i].influenced = false;
}
//GameManager.Instance.player.influencePreviewPool.Clear();
return;
}
else if (eventData.pointerCurrentRaycast.gameObject.name == "cardSlot")
{
transform.SetParent(eventData.pointerCurrentRaycast.gameObject.transform);
transform.position = eventData.pointerCurrentRaycast.gameObject.transform.position;
GetComponent<CanvasGroup>().blocksRaycasts = true;
ainPanle.SetActive(false);//关闭贝塞尔曲线
//遍历范围预览池消除影响色
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++)
{
GameManager.Instance.player.influencePreviewPool[i].influenced = false;
}
//GameManager.Instance.player.influencePreviewPool.Clear();
return;
}
}
if (ainPanle.activeSelf)
{
ainPanle.SetActive(false);//关闭贝塞尔曲线
}
//先判断该卡牌的类型是否是需要范围
if (cardEntity.cardOriginalData.CastingRange != 0)
{
//检测碰撞的地图节点是否被影响(可释放)
if (currentNode == null || currentNode.influenced == false)
{
//遍历范围预览池消除影响色(红色,卡牌的释放范围)
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++)
{
GameManager.Instance.player.influencePreviewPool[i].influenced = false;
}
//GameManager.Instance.player.influencePreviewPool.Clear();
}
else if (currentNode.influenced)
{
//卡牌释放效果
Debug.Log("卡牌释放前影响格数:" + cardEntity.influencePreviewPool.Count);
cardEntity.use();
Debug.Log("玩家盾量:" + Usermanager.Instance.Shield);
}
//遍历范围预览池消除影响色
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++)
{
GameManager.Instance.player.influencePreviewPool[i].influenced = false;
}
GameManager.Instance.player.influencePreviewPool.Clear();
//遍历影响池变色
for (int i = 0; i < cardEntity.influencePreviewPool.Count; i++)
{
cardEntity.influencePreviewPool[i].influenced = false;
}
cardEntity.influencePreviewPool.Clear();
GetComponent<CanvasGroup>().blocksRaycasts = true;
//其他位置都归位
transform.SetParent(originalParent);
transform.localPosition = originalpoint;
return;
}//范围类,需要指定被影响的节点才能释放
else
{
//卡牌释放效果
cardEntity.use();
Debug.Log("玩家盾量:" + Usermanager.Instance.Shield);
return;
}//无范围类,直接释放
}
else
{
canUse = true;
}*/
} }
private IEnumerator OnDragIEnumerator(PointerEventData eventData) private IEnumerator OnDragIEnumerator(PointerEventData eventData)
@ -551,10 +376,16 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
ainPanle.SetActive(false);//关闭贝塞尔曲线 ainPanle.SetActive(false);//关闭贝塞尔曲线
//遍历范围预览池消除影响色 //遍历范围预览池消除影响色
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) for (int i = 0; i < MapUnityManager.Instance.castPool.Count; i++)
{ {
GameManager.Instance.player.influencePreviewPool[i].influenced = false; MapUnityManager.Instance.castPool[i].influenced = false;
}
MapUnityManager.Instance.castPool.Clear();
for (int i = 0; i < cardEntity.influencePreviewPool.Count; i++)
{
cardEntity.influencePreviewPool[i].influenced = false;
} }
cardEntity.influencePreviewPool.Clear();
//GameManager.Instance.player.influencePreviewPool.Clear(); //GameManager.Instance.player.influencePreviewPool.Clear();
yield break; yield break;
@ -572,18 +403,17 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag
if (currentNode == null || currentNode.influenced == false) if (currentNode == null || currentNode.influenced == false)
{ {
//遍历范围预览池消除影响色(红色,卡牌的释放范围) //遍历范围预览池消除影响色(红色,卡牌的释放范围)
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) for (int i = 0; i < MapUnityManager.Instance.castPool.Count; i++)
{ {
GameManager.Instance.player.influencePreviewPool[i].influenced = false; MapUnityManager.Instance.castPool[i].influenced = false;
} }
//GameManager.Instance.player.influencePreviewPool.Clear(); MapUnityManager.Instance.castPool.Clear();
} }
else if (currentNode.influenced) else if (currentNode.influenced)
{ {
//卡牌释放效果 //卡牌释放效果
yield return StartCoroutine(cardEntity.settle(0)); yield return StartCoroutine(cardEntity.settle(0));
Debug.Log("玩家盾量:" + Usermanager.Instance.Shield);
} }

3
ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardEntity.cs

@ -12,7 +12,7 @@ public class CardEntity : MonoBehaviour
{ {
public CardOriginalData cardOriginalData; public CardOriginalData cardOriginalData;
//public CardOriginalData cardData; //public CardOriginalData cardData;
public List<MapUnity> influencePreviewPool;//卡牌的影响范围 public List<MapUnity> influencePreviewPool=new List<MapUnity>();//卡牌的影响范围
public int cardId; public int cardId;
@ -155,7 +155,6 @@ public class CardEntity : MonoBehaviour
} }
if (cardOriginalData.AdvantageDescription.Length != 0) if (cardOriginalData.AdvantageDescription.Length != 0)
{ {
Debug.Log("优势:" + cardOriginalData.AdvantageDescription + ";");
sb.Append("ÓĹĘĆ:" + cardOriginalData.AdvantageDescription + ";"); sb.Append("ÓĹĘĆ:" + cardOriginalData.AdvantageDescription + ";");
} }
if (sb.Length > 0) if (sb.Length > 0)

15
ColorlessWorld-2024-4-2/Assets/Scripts/Card/TurnMaster.cs

@ -13,6 +13,7 @@ public class TurnMaster : Singleton<TurnMaster>
public Text cardDeckNumberText; public Text cardDeckNumberText;
public Text usedCardNumberText; public Text usedCardNumberText;
public Text deleteCardNumberText;
public int currentCost; public int currentCost;
public int totalCost; public int totalCost;
@ -37,8 +38,8 @@ public class TurnMaster : Singleton<TurnMaster>
} }
public void Start() public void Start()
{ {
totalCost = Usermanager.Instance.totalCost; /*totalCost = Usermanager.Instance.totalCost;
currentCost = totalCost; currentCost = totalCost;*/
} }
private void Update() private void Update()
@ -63,7 +64,7 @@ public class TurnMaster : Singleton<TurnMaster>
//结算buff //结算buff
//结算技能冷却 //结算技能冷却
// EnemyManager.Instance.EnemySkillCoolDown_Observer(); // EnemyManager.Instance.EnemySkillCoolDown_Observer();
EnemyManager.Instance.enemyTurnSettle(0);
turn = Turn.enemyTurn; turn = Turn.enemyTurn;
} }
@ -74,7 +75,7 @@ public class TurnMaster : Singleton<TurnMaster>
//敌人动作如移动,涂色 //敌人动作如移动,涂色
EnemyManager.Instance.EnemyTurn_Observer(); EnemyManager.Instance.EnemyTurn_Observer();
EnemyManager.Instance.enemyTurnSettle(0);
turn = Turn.turnStop; turn = Turn.turnStop;
// EndEnemyTurn();在enemyTurn里面调用 // EndEnemyTurn();在enemyTurn里面调用
@ -83,6 +84,7 @@ public class TurnMaster : Singleton<TurnMaster>
//同步UI //同步UI
cardDeckNumberText.text = cardDeck.cardList.Count.ToString(); cardDeckNumberText.text = cardDeck.cardList.Count.ToString();
usedCardNumberText.text = usedCard.usedCardList.Count.ToString(); usedCardNumberText.text = usedCard.usedCardList.Count.ToString();
deleteCardNumberText.text = usedCard.deleteCardList.Count.ToString();
} }
IEnumerator EndPlayerTurnBegin() IEnumerator EndPlayerTurnBegin()
{ {
@ -105,8 +107,9 @@ public class TurnMaster : Singleton<TurnMaster>
//老吊写的函数 //老吊写的函数
public void restoreResource(int settleTurn) public void restoreResource(int settleTurn)
{ {
totalCost = Usermanager.Instance.totalCost; //totalCost = Usermanager.Instance.totalCost;
currentCost = totalCost; //currentCost = totalCost;
GameManager.Instance.playerState.currentCost = GameManager.Instance.playerState.maxCost;
Usermanager.Instance.Shield = 0; Usermanager.Instance.Shield = 0;
} }
IEnumerator ShuffleWithLosingCards() IEnumerator ShuffleWithLosingCards()

3
ColorlessWorld-2024-4-2/Assets/Scripts/Card/UsedCard.cs

@ -5,5 +5,8 @@ using UnityEngine;
public class UsedCard : MonoBehaviour public class UsedCard : MonoBehaviour
{ {
public GameObject cardPrefab; public GameObject cardPrefab;
[Header("贏華")]
public List<int> usedCardList; public List<int> usedCardList;
[Header("种障")]
public List<int> deleteCardList;
} }

36
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/EnemyManager.cs

@ -1,5 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
@ -154,7 +155,6 @@ public class EnemyManager : Singleton<EnemyManager>
public void AttackRangePreviewInfluencedNode(MapUnity enemyNode, int step,List<MapUnity> influencePreviewPool)//可移动格子预览 public void AttackRangePreviewInfluencedNode(MapUnity enemyNode, int step,List<MapUnity> influencePreviewPool)//可移动格子预览
{ {
influencePreviewPool .Clear(); influencePreviewPool .Clear();
//GameManager.Instance.playerOn.InfluencePool = GameManager.Instance.playerOn.unitPool; //GameManager.Instance.playerOn.InfluencePool = GameManager.Instance.playerOn.unitPool;
MapUnity playerNode = enemyNode; MapUnity playerNode = enemyNode;
@ -519,11 +519,14 @@ public class EnemyManager : Singleton<EnemyManager>
} }
} }
List<MapUnity> disInfluencePreviewPool = influencePreviewPool.Distinct(new MapUnityCompare()).ToList();
//遍历影响池变色 //遍历影响池变色
for (int i = 0; i < influencePreviewPool.Count; i++) foreach ( var i in disInfluencePreviewPool)
{ {
influencePreviewPool[i].influenced = true; i.markInfluenced = true;
influencePreviewPool[i].choossedMark.GetComponent<Renderer>().material = influencePreviewPool[i].red; i.hightLigtMark.GetComponent<Renderer>().material = i.enemyMark;
} }
} }
@ -896,5 +899,30 @@ public class EnemyManager : Singleton<EnemyManager>
} }
} }
List<MapUnity> disInfluencePreviewPool = influencePreviewPool.Distinct(new MapUnityCompare()).ToList ();
influencePreviewPool.Clear();
foreach (var i in disInfluencePreviewPool )
{
influencePreviewPool.Add(i);
}
}
//±È½ÏÀà
class MapUnityCompare : IEqualityComparer<MapUnity>
{
public bool Equals(MapUnity x, MapUnity y)
{
if((x.locationX == y.locationX)&&(x.locationY == y.locationY))
{
return true;
}
return false;
}
public int GetHashCode(MapUnity obj)
{
return obj.locationX.GetHashCode() ^ obj.locationY.GetHashCode();
}
} }
} }

28
ColorlessWorld-2024-4-2/Assets/Scripts/Enemy/EnemyNode.cs

@ -309,6 +309,18 @@ public class EnemyNode : MonoBehaviour,IEnemyObserver
if (EnemyState.currentHP <= 0) if (EnemyState.currentHP <= 0)
{ {
OnDeath(); OnDeath();
}else
{
foreach (var key in EnemyState.abnormalCondition.Keys.ToList())
{
Debug.Log(key);
switch (key)
{
case AbnormalCondition.sleep:
EnemyState.abnormalCondition.Remove(key);
break;
}
}
} }
} }
@ -338,9 +350,6 @@ public class EnemyNode : MonoBehaviour,IEnemyObserver
case AbnormalCondition.disarm: case AbnormalCondition.disarm:
disarmSettle(EnemyState.abnormalCondition[key]); disarmSettle(EnemyState.abnormalCondition[key]);
break; break;
case AbnormalCondition.sleep:
sleepSettle(EnemyState.abnormalCondition[key]);
break;
case AbnormalCondition.bleed: case AbnormalCondition.bleed:
//bleedSettle(EnemyState.abnormalCondition[key]); //bleedSettle(EnemyState.abnormalCondition[key]);
break; break;
@ -350,6 +359,18 @@ public class EnemyNode : MonoBehaviour,IEnemyObserver
} }
abnormalConditionEndCheck(); abnormalConditionEndCheck();
} }
foreach (var key in EnemyState.abnormalCondition.Keys.ToList())
{
Debug.Log(key);
switch (key)
{
case AbnormalCondition.sleep:
sleepSettle(EnemyState.abnormalCondition[key]);
break;
}
abnormalConditionEndCheck();
}
/*for(int i=0;i< EnemyState.abnormalCondition.Count; i++) /*for(int i=0;i< EnemyState.abnormalCondition.Count; i++)
{ {
switch (EnemyState.abnormalCondition[i].key) switch (EnemyState.abnormalCondition[i].key)
@ -410,6 +431,7 @@ public class EnemyNode : MonoBehaviour,IEnemyObserver
{ {
EnemyState.damageMultiplier = 0; EnemyState.damageMultiplier = 0;
EnemyState.stepRangeMultiplier = 0; EnemyState.stepRangeMultiplier = 0;
EnemyState.abnormalCondition[AbnormalCondition.sleep]--;
} }
public void bleedSettle() public void bleedSettle()

4
ColorlessWorld-2024-4-2/Assets/Scripts/GameManager.cs

@ -16,6 +16,9 @@ public class GameManager : Singleton<GameManager>
public PlayerState_SO templatePlayerState;//角色数据ScriptableObject模板 public PlayerState_SO templatePlayerState;//角色数据ScriptableObject模板
public PlayerState_SO playerState;//在游戏中实际使用的数据 public PlayerState_SO playerState;//在游戏中实际使用的数据
[Header("角色动作状态")]
public bool onDrag;//正在拖动卡牌
[Header("角色状态数据UI")] [Header("角色状态数据UI")]
public Text textMaxCost; public Text textMaxCost;
public Text textCurrentCost; public Text textCurrentCost;
@ -86,7 +89,6 @@ public class GameManager : Singleton<GameManager>
public bool SyncColourCountUI() public bool SyncColourCountUI()
{ {
bool result = false; bool result = false;
Debug.Log("Sync");
float playerCount = 0; float playerCount = 0;
float enemyCount = 0; float enemyCount = 0;
float totalCount = 0; float totalCount = 0;

19
ColorlessWorld-2024-4-2/Assets/Scripts/Handler/EffectRangeHandler7_2.cs

@ -15,37 +15,37 @@ public class EffectRangeHandler7_2 : EffectRangeHandlerBase
{ {
{ 30.0f, () => { 30.0f, () =>
{ {
get7_2Node(currentNode,2); get7_2Node(currentNode);
return influencePreviewPool; return influencePreviewPool;
} }
}, },
{ 90.0f, () => { 90.0f, () =>
{ {
get7_2Node(currentNode,3); get7_2Node(currentNode);
return influencePreviewPool; return influencePreviewPool;
} }
}, },
{ 150.0f, () => { 150.0f, () =>
{ {
get7_2Node(currentNode,4); get7_2Node(currentNode);
return influencePreviewPool; return influencePreviewPool;
} }
}, },
{ 210.0f, () => { 210.0f, () =>
{ {
get7_2Node(currentNode,5); get7_2Node(currentNode);
return influencePreviewPool; return influencePreviewPool;
} }
}, },
{ 270.0f, () => { 270.0f, () =>
{ {
get7_2Node(currentNode,0); get7_2Node(currentNode);
return influencePreviewPool; return influencePreviewPool;
} }
}, },
{ 330.0f, () => { 330.0f, () =>
{ {
get7_2Node(currentNode,1); get7_2Node(currentNode);
return influencePreviewPool; return influencePreviewPool;
} }
} }
@ -54,9 +54,9 @@ public class EffectRangeHandler7_2 : EffectRangeHandlerBase
} }
private void get7_2Node(MapUnity currentNode, int value) private void get7_2Node(MapUnity currentNode)
{ {
if (tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 1)])) /*if (tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 1)]))
{ {
tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 1)].unitPool[value]); tryGetNodeInfluencedable(currentNode.unitPool[counter.Subtract(value, 1)].unitPool[value]);
} }
@ -64,7 +64,8 @@ public class EffectRangeHandler7_2 : EffectRangeHandlerBase
{ {
tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value, 1)].unitPool[value]); tryGetNodeInfluencedable(currentNode.unitPool[counter.Add(value, 1)].unitPool[value]);
} }
getongNode(currentNode, value); getongNode(currentNode, value);*/
getNodeTools.getCircleNode(influencePreviewPool,1);
} }

41
ColorlessWorld-2024-4-2/Assets/Scripts/Handler/EffectRangeHandler8_2.cs

@ -54,48 +54,19 @@ public class EffectRangeHandler8_2 : EffectRangeHandlerBase
} }
public bool tryGetNodeInfluencedableList(MapUnity node,List<MapUnity> nodeList)
{
bool canPass = true;
if (node == null)
{
canPass = false;
return canPass;
}
Debug.Log("×ø±êX" + node.locationX + "×ø±êY" + node.locationY);
if (node.TryGetComponent<EnemyNode>(out EnemyNode enemyNode))
{
Debug.Log("JJKK");
if (enemyNode.enemyType == EnemyNode.EnemyType.block)
{
Debug.Log("AABB");
canPass = false;
nodeList.Add(node);
}
Debug.Log("DDFF");
}
if (canPass)
{
nodeList.Add(node);
}
return canPass;
}
private void get8_2Node(MapUnity node, List<MapUnity> influencePreviewPool) private void get8_2Node(MapUnity node, List<MapUnity> influencePreviewPool)
{ {
Debug.Log("½øÈë8_2");
influencePreviewPool.Add(node); influencePreviewPool.Add(node);
getNearbyNode(influencePreviewPool); getNodeTools.getCircleNode(influencePreviewPool,3);
getNearbyNode(influencePreviewPool); /*while (influencePreviewPool.Contains(node))
getNearbyNode(influencePreviewPool);
while (influencePreviewPool.Contains(node))
{ {
influencePreviewPool.Remove(node); influencePreviewPool.Remove(node);
} }*/
} }
public void getNearbyNode(List<MapUnity> nodeList) /* public void getNearbyNode(List<MapUnity> nodeList)
{ {
// 创建一个副本以避免遍历时修改原集合 // 创建一个副本以避免遍历时修改原集合
List<MapUnity> nodesCopy = new List<MapUnity>(nodeList); List<MapUnity> nodesCopy = new List<MapUnity>(nodeList);
@ -112,7 +83,7 @@ public class EffectRangeHandler8_2 : EffectRangeHandlerBase
// 遍历完成后统一修改原集合 // 遍历完成后统一修改原集合
nodeList.AddRange(nodesToAdd); nodeList.AddRange(nodesToAdd);
} }*/
} }

6
ColorlessWorld-2024-4-2/Assets/Scripts/Handler/EffectRangeHandlerBase.cs

@ -18,18 +18,14 @@ public class EffectRangeHandlerBase : EffectRangeHandler
canPass = false; canPass = false;
return canPass; return canPass;
} }
Debug.Log("currentNode"+ currentNode.enemyNode);
/*if (currentNode.TryGetComponent<EnemyNode>(out EnemyNode enemyNode))*/ /*if (currentNode.TryGetComponent<EnemyNode>(out EnemyNode enemyNode))*/
if (currentNode.enemyNode!=null) if (currentNode.enemyNode!=null)
{ {
Debug.Log("JJKK");
if (currentNode.enemyNode.enemyType.Equals(EnemyNode.EnemyType.block)) if (currentNode.enemyNode.enemyType.Equals(EnemyNode.EnemyType.block))
{ {
Debug.Log("AABB");
canPass = false; canPass = false;
influencePreviewPool.Add(currentNode); influencePreviewPool.Add(currentNode);
} }
Debug.Log("DDFF");
} }
if (canPass) if (canPass)
@ -41,7 +37,6 @@ public class EffectRangeHandlerBase : EffectRangeHandler
public List<MapUnity> HandleAngleWithResult(float angle) public List<MapUnity> HandleAngleWithResult(float angle)
{ {
Debug.Log("角度大小" + angle);
foreach (var kvp in angleActions) foreach (var kvp in angleActions)
{ {
if (Math.Abs(angle - kvp.Key) < Epsilon) if (Math.Abs(angle - kvp.Key) < Epsilon)
@ -49,7 +44,6 @@ public class EffectRangeHandlerBase : EffectRangeHandler
return kvp.Value(); return kvp.Value();
} }
} }
Debug.Log("数组大小" + influencePreviewPool.Count);
return influencePreviewPool; return influencePreviewPool;
} }

14
ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs

@ -12,10 +12,14 @@ public class MapUnity : MonoBehaviour
[Header("UI效果范围控件")] [Header("UI效果范围控件")]
public bool influenced;//被选中 public bool influenced;//被选中
public bool markInfluenced;//需要被高亮显示
public GameObject choossedMark;//被选中激活 public GameObject choossedMark;//被选中激活
// public List<MapUnity> InfluencePool;//Ó°Ïì³Ø public GameObject hightLigtMark;//被选中高亮
public Material red; public Material red;
public Material yellow; public Material yellow;
public Material enemyMark;
[Header("涂色控件")] [Header("涂色控件")]
public Material plyerColour;//玩家颜色 public Material plyerColour;//玩家颜色
@ -77,6 +81,14 @@ public class MapUnity : MonoBehaviour
{ {
choossedMark.SetActive(false); choossedMark.SetActive(false);
} }
if (markInfluenced)
{
hightLigtMark.SetActive(true);
}
else
{
hightLigtMark.SetActive(false);
}
//根据涂色角色改变颜色 //根据涂色角色改变颜色
if (whoColour == WhoColour.playerColour ) if (whoColour == WhoColour.playerColour )

3
ColorlessWorld-2024-4-2/Assets/Scripts/Player.cs

@ -34,8 +34,7 @@ public class Player : MonoBehaviour
if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, playerLayerMask.value) && raycastHit.collider.gameObject.tag == "Player") if (Physics.Raycast(ray, out RaycastHit raycastHit, 500, playerLayerMask.value) && raycastHit.collider.gameObject.tag == "Player")
{ {
Debug.Log(raycastHit.collider.gameObject.name); Debug.Log(raycastHit.collider.gameObject.name);
MapUnityManager mapUnityManager = new MapUnityManager(); influencePreviewPool.AddRange(MapUnityManager.Instance.findReachableTiles(GameManager.Instance.playerOn, GameManager.Instance.playerState.currentStepRange));
influencePreviewPool.AddRange(mapUnityManager.findReachableTiles(GameManager.Instance.playerOn, GameManager.Instance.playerState.currentStepRange));
//±éÀúÓ°Ïì³Ø±äÉ« //±éÀúÓ°Ïì³Ø±äÉ«
for (int i = 0; i < influencePreviewPool.Count; i++) for (int i = 0; i < influencePreviewPool.Count; i++)
{ {

5
ColorlessWorld-2024-4-2/Assets/Scripts/Tool/CardData_SO/PlayerState_SO.cs

@ -24,5 +24,10 @@ public class PlayerState_SO : ScriptableObject
public float currentHP; public float currentHP;
private void Start()
{
maxCost = 3;
}
} }

3
ColorlessWorld-2024-4-2/Assets/Scripts/Tool/EffectRange.cs

@ -40,4 +40,7 @@ public class EffectRange
public const string range8_1 = "8_1"; public const string range8_1 = "8_1";
public const string range8_2 = "8_2"; public const string range8_2 = "8_2";
public static readonly List<string> speRange = new List<string> {range2, range3_1, range3_2, range3_3, range4_1,
range4_2, range4_3, range5_1, range5_2, range5_3, range6_1, range6_2, range6_3, range7_1, range7_2, range8_1 , range8_2};
} }

18
ColorlessWorld-2024-4-2/Assets/Scripts/Tool/MathTool.cs

@ -39,4 +39,22 @@ public class MathTool
return numbers; return numbers;
} }
public static List<T> RemoveDuplicates<T>(List<T> list)
{
List<T> result = new List<T>();
HashSet<T> set = new HashSet<T>();
foreach (T item in list)
{
if (set.Add(item))
{
result.Add(item);
}
} }
return result;
}
}

110
ColorlessWorld-2024-4-2/Assets/Scripts/Tool/getNodeTools.cs

@ -1,9 +1,14 @@
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
using UnityEngine.UIElements;
public class getNodeTools public class getNodeTools
{ {
[Header("瞄准射线图层剔除")]
public LayerMask layerMask;
public bool tryGetNodeInfluencedable(MapUnity currentNode, List<MapUnity> nodeList) public bool tryGetNodeInfluencedable(MapUnity currentNode, List<MapUnity> nodeList)
{ {
bool canPass = true; bool canPass = true;
@ -23,5 +28,110 @@ public class getNodeTools
return canPass; return canPass;
} }
public static void getLongNodes(MapUnity currentNode, int angle, int range,List<MapUnity> results)
{
List<MapUnity> result = new List<MapUnity>();
MapUnity currentCheckNode = currentNode;
for (int i = 0; i < range; i++)
{
if (tryGetNode(currentCheckNode.unitPool[angle], results))
{
currentCheckNode = currentCheckNode.unitPool[angle];
}
else
{
return;
}
}
}
public static bool tryGetNode(MapUnity currentNode, List<MapUnity> results)
{
bool canPass = true;
if (currentNode == null)
{
canPass = false;
return canPass;
}
/*if (currentNode.TryGetComponent<EnemyNode>(out EnemyNode enemyNode))*/
if (currentNode.enemyNode != null)
{
if (currentNode.enemyNode.enemyType.Equals(EnemyNode.EnemyType.block))
{
canPass = false;
results.Add(currentNode);
}
}
if (canPass)
{
results.Add(currentNode);
}
return canPass;
}
public static void getCircleNode(List<MapUnity> nodeList,int range)
{
for (int i = 0;i < range;i++)
{
getNearbyNode(nodeList);
}
}
public static void getNearbyNode(List<MapUnity> nodeList)
{
// 创建一个副本以避免遍历时修改原集合
List<MapUnity> nodesCopy = new List<MapUnity>(nodeList);
List<MapUnity> nodesToAdd = new List<MapUnity>(); // 临时列表存储要添加的节点
foreach (var node in nodesCopy)
{
for (int i = 0; i < 6; i++)
{
tryGetNode(node.unitPool[i], nodesToAdd);
}
}
// 遍历完成后统一修改原集合
nodeList.AddRange(nodesToAdd);
}
public static void checkListPass(List<MapUnity> mapUnityList)
{
for (int i = 0; i < mapUnityList.Count; i++)
{
if (!checkNodePass(mapUnityList[i]))
{
mapUnityList.RemoveAt(i);
}
}
}
public static bool checkNodePass(MapUnity mapUnity)
{
LayerMask layerMask=new LayerMask();
int blockLayer = LayerMask.NameToLayer("Block");
layerMask |= (1 << blockLayer);
bool canPass=true;
//MapUnity playerOnNode = GameManager.Instance.playerOn.transform.GetComponent<MapUnity>();
var playerOnNode=GameManager.Instance.player;
float distance = Vector3.Distance(playerOnNode.transform.position, mapUnity.transform.position);
Vector3 dir = mapUnity.transform.position - playerOnNode.transform.position;
Ray ray = new Ray(playerOnNode.transform.position, dir);
if (Physics.Raycast(ray, out RaycastHit raycastHit, distance, layerMask.value))
{
canPass = false;
}
/* if (!canPass)
{*/
Debug.Log("距离是" + distance + ",结果是:" + canPass+",角度是:"+dir);
//}
return canPass;
}
} }

14
ColorlessWorld-2024-4-2/Assets/Scripts/UI/EnemyPlanActionUI.cs

@ -14,7 +14,7 @@ public class EnemyPlanActionUI : MonoBehaviour
private void OnMouseEnter() private void OnMouseEnter()
{ {
if (TurnMaster.Instance.turn == TurnMaster.Turn.playerTurn) if (TurnMaster.Instance.turn == TurnMaster.Turn.playerTurn &&GameManager .Instance .onDrag ==false )
{ {
MapUnity currentMapUnity = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY]; MapUnity currentMapUnity = GameManager.Instance.X[enemyNode.positionX].Y[enemyNode.positionY];
@ -134,21 +134,21 @@ public class EnemyPlanActionUI : MonoBehaviour
{ {
for (int i = 0; i < step + 1; i++) for (int i = 0; i < step + 1; i++)
{ {
enemyNode.pasth[i].choossedMark.GetComponent<Renderer>().material = enemyNode.pasth[i].yellow; enemyNode.pasth[i].hightLigtMark.GetComponent<Renderer>().material = enemyNode.pasth[i].yellow;
} }
} }
else if (enemyNode.pasth.Count - 1 == step) else if (enemyNode.pasth.Count - 1 == step)
{ {
for (int i = 0; i < step; i++) for (int i = 0; i < step; i++)
{ {
enemyNode.pasth[i].choossedMark.GetComponent<Renderer>().material = enemyNode.pasth[i].yellow; enemyNode.pasth[i].hightLigtMark.GetComponent<Renderer>().material = enemyNode.pasth[i].yellow;
} }
} }
else else
{ {
for (int i = 0; i < enemyNode.pasth.Count; i++) for (int i = 0; i < enemyNode.pasth.Count; i++)
{ {
enemyNode.pasth[i].choossedMark.GetComponent<Renderer>().material = enemyNode.pasth[i].yellow; enemyNode.pasth[i].hightLigtMark.GetComponent<Renderer>().material = enemyNode.pasth[i].yellow;
} }
} }
} }
@ -160,7 +160,7 @@ public class EnemyPlanActionUI : MonoBehaviour
{ {
for (int i = 0; i < enemyNode.oppositePasth.Count; i++) for (int i = 0; i < enemyNode.oppositePasth.Count; i++)
{ {
enemyNode.oppositePasth[i].choossedMark.GetComponent<Renderer>().material = enemyNode.pasth[i].yellow; enemyNode.oppositePasth[i].hightLigtMark.GetComponent<Renderer>().material = enemyNode.pasth[i].yellow;
} }
} }
break; break;
@ -185,9 +185,9 @@ public class EnemyPlanActionUI : MonoBehaviour
//±éÀúÓ°Ïì³Ø±äÉ« //±éÀúÓ°Ïì³Ø±äÉ«
for (int i = 0; i < enemyNode.rangePool.Count; i++) for (int i = 0; i < enemyNode.rangePool.Count; i++)
{ {
enemyNode.rangePool[i].influenced = false; enemyNode.rangePool[i].markInfluenced = false;
} }
enemyNode.rangePool.Clear(); //enemyNode.rangePool.Clear();
} }
} }

10
ColorlessWorld-2024-4-2/Assets/Scripts/manager/DestructionManager.cs

@ -22,11 +22,17 @@ public class DestructionManager : Singleton<DestructionManager>
GameManager.Instance.SyncColourCountUI(); GameManager.Instance.SyncColourCountUI();
//遍历范围预览池消除影响色 //遍历范围预览池消除影响色
Debug.Log("清除前红色格数:" + GameManager.Instance.player.influencePreviewPool.Count); Debug.Log("清除前红色格数:" + GameManager.Instance.player.influencePreviewPool.Count);
for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++) /*for (int i = 0; i < GameManager.Instance.player.influencePreviewPool.Count; i++)
{ {
GameManager.Instance.player.influencePreviewPool[i].influenced = false; GameManager.Instance.player.influencePreviewPool[i].influenced = false;
} }
GameManager.Instance.player.influencePreviewPool.Clear(); GameManager.Instance.player.influencePreviewPool.Clear();*/
for (int i = 0; i < MapUnityManager.Instance.castPool.Count; i++)
{
MapUnityManager.Instance.castPool[i].influenced = false;
}
MapUnityManager.Instance.castPool.Clear();
//GetComponent<CanvasGroup>().blocksRaycasts = true; //GetComponent<CanvasGroup>().blocksRaycasts = true;

35
ColorlessWorld-2024-4-2/Assets/Scripts/manager/MapUnityManager.cs

@ -1,9 +1,13 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using UnityEditor.Experimental.GraphView;
using UnityEngine; using UnityEngine;
public class MapUnityManager : MonoBehaviour public class MapUnityManager : Singleton<MapUnityManager>
{ {
public List<MapUnity> castPool=new List<MapUnity>();//记录预览影响的对象池
public List<MapUnity> findReachableTiles(MapUnity startNode, int movePoints) public List<MapUnity> findReachableTiles(MapUnity startNode, int movePoints)
{ {
List<MapUnity> reachableNodes = new List<MapUnity>(); List<MapUnity> reachableNodes = new List<MapUnity>();
@ -38,4 +42,33 @@ public class MapUnityManager : MonoBehaviour
return reachableNodes; return reachableNodes;
} }
public void getCastPool(string effectRange,int castRange)
{
MapUnity playerOn = GameManager.Instance.playerOn;
if (EffectRange.speRange.Contains(effectRange))
{
for (int i = 0; i < 6; i++)
{
getNodeTools.getLongNodes(playerOn, i, castRange, castPool);
}
}
else
{
castPool.Add(playerOn);
getNodeTools.getCircleNode(castPool, castRange);
while (castPool.Contains(playerOn))
{
castPool.Remove(playerOn);
}
}
//castPool.Distinct().ToList();
//getNodeTools.checkListPass(castPool);
//遍历影响池变色
for (int i = 0; i < castPool.Count; i++)
{
castPool[i].influenced = true;
castPool[i].choossedMark.GetComponent<Renderer>().material = castPool[i].red;
}
}
} }

5
ColorlessWorld-2024-4-2/Assets/Scripts/manager/SettlementManager.cs

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Unity.VisualScripting; using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
using UnityEngine.Playables;
public class SettlementManager : Singleton<SettlementManager> public class SettlementManager : Singleton<SettlementManager>
{ {
@ -46,6 +47,7 @@ public class SettlementManager : Singleton<SettlementManager>
{ {
Dictionary<string, string> trueFunctionVal = new Dictionary<string, string>(); Dictionary<string, string> trueFunctionVal = new Dictionary<string, string>();
bool canAdv = GameManager.Instance.SyncColourCountUI(); bool canAdv = GameManager.Instance.SyncColourCountUI();
GameManager.Instance.playerState.currentCost -= cardOriginalData.Cost;
if (canAdv) if (canAdv)
{ {
trueFunctionVal.AddRange(cardOriginalData.AdvantageFunctionVal); trueFunctionVal.AddRange(cardOriginalData.AdvantageFunctionVal);
@ -80,7 +82,7 @@ public class SettlementManager : Singleton<SettlementManager>
abnormalConditionWork(kvp.Key, int.Parse(kvp.Value), influencePreviewPool); abnormalConditionWork(kvp.Key, int.Parse(kvp.Value), influencePreviewPool);
break; break;
case CardFunction.costRestore: case CardFunction.costRestore:
TurnMaster.Instance.currentCost += int.Parse(kvp.Value); GameManager.Instance.playerState.currentCost += int.Parse(kvp.Value);
break; break;
case CardFunction.dyeing: case CardFunction.dyeing:
dyeingWork(influencePreviewPool); dyeingWork(influencePreviewPool);
@ -117,6 +119,7 @@ public class SettlementManager : Singleton<SettlementManager>
} }
} }
GameManager.Instance.SyncColourCountUI();
} }

9
ColorlessWorld-2024-4-2/Assets/data/card_data.csv

@ -1,8 +1,8 @@
ID,名称,费用,稀有度,功能,数值,施法范围,作用范围,消耗,优势功能,数值,卡牌类型,优势描述,图片路径 ID,名称,费用,稀有度,功能,数值,施法范围,作用范围,消耗,优势功能,数值,卡牌类型,优势描述,图片路径
10001,射击,1,1,1,7,1,1,0,1,7,1,,PlayerIcon 10001,射击,1,1,1,7,3,1,0,1,7,1,,PlayerIcon
10002,护盾,1,1,2,5,0,1,0,2,5,1,,PlayerIcon 10002,护盾,1,1,2,5,0,0,0,2,5,1,,PlayerIcon
10003,毒药,1,1,4,6,3,1,0,4,10,1,施加4层中毒,PlayerIcon 10003,毒药,1,1,4,6,3,1,0,4,10,1,施加4层中毒,PlayerIcon
10004,枫叶炸弹,2,2,9,2,1,7_2,0,9;4,2;4,1,施加4层中毒,PlayerIcon 10004,枫叶炸弹,2,2,9,2,2,7_2,0,9;4,2;4,1,施加4层中毒,PlayerIcon
10005,花粉,0,2,8,1,4,1,0,8,2,1,施加1层沉睡,PlayerIcon 10005,花粉,0,2,8,1,4,1,0,8,2,1,施加1层沉睡,PlayerIcon
10006,致残,2,1,7,2,2,1,0,7;9,2;2,1,施加2层流血,PlayerIcon 10006,致残,2,1,7,2,2,1,0,7;9,2;2,1,施加2层流血,PlayerIcon
10007,滋养,1,2,12;13,3;1,0,0,0,12,3,1,无需丢弃,PlayerIcon 10007,滋养,1,2,12;13,3;1,0,0,0,12,3,1,无需丢弃,PlayerIcon
@ -12,4 +12,5 @@
10011,草团,2,1,1;14,5;0,1,6_2,1,1;14,8;0,1,造成3点伤害,PlayerIcon 10011,草团,2,1,1;14,5;0,1,6_2,1,1;14,8;0,1,造成3点伤害,PlayerIcon
10012,穿刺射击,2,1,1,8,1,5_1,0,1;4,8;4,1,施加4层中毒,PlayerIcon 10012,穿刺射击,2,1,1,8,1,5_1,0,1;4,8;4,1,施加4层中毒,PlayerIcon
10013,森林之怒,3,3,1,20,3,1,0,1;15,20;0,1,造成场地差伤害,PlayerIcon 10013,森林之怒,3,3,1,20,3,1,0,1;15,20;0,1,造成场地差伤害,PlayerIcon
10014,巨树之弓,2,1,1;14,13;0,1,5_3,0,1;14;5,13;0;1,1,施加1层虚弱,PlayerIcon 10014,巨树之弓,2,1,1;14,13;0,3,5_3,0,1;14;5,13;0;1,1,施加1层虚弱,PlayerIcon
10015,炸弹,0,1,1,5,0,8_2,0,1,5,1,,PlayerIcon

1 ID 名称 费用 稀有度 功能 数值 施法范围 作用范围 消耗 优势功能 数值 卡牌类型 优势描述 图片路径
2 10001 射击 1 1 1 7 1 3 1 0 1 7 1 PlayerIcon
3 10002 护盾 1 1 2 5 0 1 0 0 2 5 1 PlayerIcon
4 10003 毒药 1 1 4 6 3 1 0 4 10 1 施加4层中毒 PlayerIcon
5 10004 枫叶炸弹 2 2 9 2 1 2 7_2 0 9;4 2;4 1 施加4层中毒 PlayerIcon
6 10005 花粉 0 2 8 1 4 1 0 8 2 1 施加1层沉睡 PlayerIcon
7 10006 致残 2 1 7 2 2 1 0 7;9 2;2 1 施加2层流血 PlayerIcon
8 10007 滋养 1 2 12;13 3;1 0 0 0 12 3 1 无需丢弃 PlayerIcon
12 10011 草团 2 1 1;14 5;0 1 6_2 1 1;14 8;0 1 造成3点伤害 PlayerIcon
13 10012 穿刺射击 2 1 1 8 1 5_1 0 1;4 8;4 1 施加4层中毒 PlayerIcon
14 10013 森林之怒 3 3 1 20 3 1 0 1;15 20;0 1 造成场地差伤害 PlayerIcon
15 10014 巨树之弓 2 1 1;14 13;0 1 3 5_3 0 1;14;5 13;0;1 1 施加1层虚弱 PlayerIcon
16 10015 炸弹 0 1 1 5 0 8_2 0 1 5 1 PlayerIcon

3
ColorlessWorld-2024-4-2/UserSettings/EditorUserSettings.asset

@ -6,9 +6,6 @@ EditorUserSettings:
serializedVersion: 4 serializedVersion: 4
m_ConfigSettings: m_ConfigSettings:
RecentlyUsedSceneGuid-0: RecentlyUsedSceneGuid-0:
value: 0052010304020f0b0858582012770844124f1929292d2068292a1b62e7b9313a
flags: 0
RecentlyUsedSceneGuid-1:
value: 5a08575f5207595a0f5d59741173094444164f7d7d2a23317c7a4465bbe1646d value: 5a08575f5207595a0f5d59741173094444164f7d7d2a23317c7a4465bbe1646d
flags: 0 flags: 0
vcSharedLogLevel: vcSharedLogLevel:

106
ColorlessWorld-2024-4-2/UserSettings/Layouts/CurrentMaximizeLayout.dwlt

@ -46,10 +46,10 @@ MonoBehaviour:
m_Tooltip: m_Tooltip:
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 409.6 x: 410.4
y: 73.6 y: 73.6
width: 769.99994 width: 769.19995
height: 466.2 height: 465.4
m_SerializedDataModeController: m_SerializedDataModeController:
m_DataMode: 0 m_DataMode: 0
m_PreferredDataMode: 0 m_PreferredDataMode: 0
@ -102,10 +102,10 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 21 y: 21
width: 769.99994 width: 769.19995
height: 445.2 height: 444.4
m_Scale: {x: 0.50130206, y: 0.50130206} m_Scale: {x: 0.50078124, y: 0.50078124}
m_Translation: {x: 385, y: 222.6} m_Translation: {x: 384.59998, y: 222.2}
m_MarginLeft: 0 m_MarginLeft: 0
m_MarginRight: 0 m_MarginRight: 0
m_MarginTop: 0 m_MarginTop: 0
@ -113,12 +113,12 @@ MonoBehaviour:
m_LastShownAreaInsideMargins: m_LastShownAreaInsideMargins:
serializedVersion: 2 serializedVersion: 2
x: -768 x: -768
y: -444.04367 y: -443.70673
width: 1536 width: 1536
height: 888.08734 height: 887.41345
m_MinimalGUI: 1 m_MinimalGUI: 1
m_defaultScale: 0.50130206 m_defaultScale: 0.50078124
m_LastWindowPixelSize: {x: 962.49994, y: 582.75} m_LastWindowPixelSize: {x: 961.49994, y: 581.75}
m_ClearInEditMode: 1 m_ClearInEditMode: 1
m_NoCameraWarning: 1 m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 00000000000000000000 m_LowResolutionForAspectRatios: 00000000000000000000
@ -169,7 +169,7 @@ MonoBehaviour:
x: 0 x: 0
y: 0 y: 0
width: 1119.2 width: 1119.2
height: 487.2 height: 486.4
m_MinSize: {x: 200, y: 50} m_MinSize: {x: 200, y: 50}
m_MaxSize: {x: 16192, y: 8096} m_MaxSize: {x: 16192, y: 8096}
vertical: 0 vertical: 0
@ -191,8 +191,8 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 0 y: 0
width: 347.2 width: 348
height: 487.2 height: 486.4
m_MinSize: {x: 201, y: 221} m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021} m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 6} m_ActualView: {fileID: 6}
@ -223,8 +223,8 @@ MonoBehaviour:
serializedVersion: 2 serializedVersion: 2
x: 62.4 x: 62.4
y: 73.6 y: 73.6
width: 346.2 width: 347
height: 466.2 height: 465.4
m_SerializedDataModeController: m_SerializedDataModeController:
m_DataMode: 0 m_DataMode: 0
m_PreferredDataMode: 0 m_PreferredDataMode: 0
@ -238,9 +238,9 @@ MonoBehaviour:
m_SceneHierarchy: m_SceneHierarchy:
m_TreeViewState: m_TreeViewState:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
m_SelectedIDs: m_SelectedIDs: e4cd0000
m_LastClickedID: 0 m_LastClickedID: 52708
m_ExpandedIDs: be2bfcff062cfcff262dfcff72bbfffff0bbffff58bdffff2afbffffd46c0000426d0000f46d0000046f0000366f0000926f0000aa700000507100009a710000c2710000ea7100000472000060720000ba720000c47200000a7300002c730000 m_ExpandedIDs: 0a80feff9681feffa0cc000086cd0000cace000014cf0000dcd00000
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@ -279,10 +279,10 @@ MonoBehaviour:
m_Children: [] m_Children: []
m_Position: m_Position:
serializedVersion: 2 serializedVersion: 2
x: 347.2 x: 348
y: 0 y: 0
width: 771.99994 width: 771.19995
height: 487.2 height: 486.4
m_MinSize: {x: 102, y: 121} m_MinSize: {x: 102, y: 121}
m_MaxSize: {x: 4002, y: 4021} m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 2} m_ActualView: {fileID: 2}
@ -312,10 +312,10 @@ MonoBehaviour:
m_Tooltip: m_Tooltip:
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 409.6 x: 410.4
y: 73.6 y: 73.6
width: 769.99994 width: 769.19995
height: 466.2 height: 465.4
m_SerializedDataModeController: m_SerializedDataModeController:
m_DataMode: 0 m_DataMode: 0
m_PreferredDataMode: 0 m_PreferredDataMode: 0
@ -356,9 +356,9 @@ MonoBehaviour:
floating: 0 floating: 0
collapsed: 0 collapsed: 0
displayed: 1 displayed: 1
snapOffset: {x: -322, y: -280.8} snapOffset: {x: -322, y: 24.8}
snapOffsetDelta: {x: 0, y: 0} snapOffsetDelta: {x: 0, y: 0}
snapCorner: 3 snapCorner: 1
id: unity-scene-view-toolbar id: unity-scene-view-toolbar
index: 0 index: 0
layout: 1 layout: 1
@ -635,9 +635,9 @@ MonoBehaviour:
m_PlayAudio: 0 m_PlayAudio: 0
m_AudioPlay: 0 m_AudioPlay: 0
m_Position: m_Position:
m_Target: {x: 2.4415243, y: -1.7079823, z: 2.0844522} m_Target: {x: 3.9131052, y: -11.547329, z: 5.253002}
speed: 2 speed: 2
m_Value: {x: 2.4415243, y: -1.7079823, z: 2.0844522} m_Value: {x: 3.9131052, y: -11.547329, z: 5.253002}
m_RenderMode: 0 m_RenderMode: 0
m_CameraMode: m_CameraMode:
drawMode: 0 drawMode: 0
@ -683,13 +683,13 @@ MonoBehaviour:
m_GridAxis: 1 m_GridAxis: 1
m_gridOpacity: 0.5 m_gridOpacity: 0.5
m_Rotation: m_Rotation:
m_Target: {x: 0.22429028, y: -0.017527353, z: 0.0038717669, w: 0.97460735} m_Target: {x: -0.5857513, y: -0.0031634637, z: 0.0022860928, w: -0.81048596}
speed: 2 speed: 2
m_Value: {x: 0.2242356, y: -0.017523078, z: 0.0038708227, w: 0.9743697} m_Value: {x: -0.5857492, y: -0.0031634523, z: 0.0022860847, w: -0.81048304}
m_Size: m_Size:
m_Target: 3.4315991 m_Target: 11.411661
speed: 2 speed: 2
m_Value: 3.4315991 m_Value: 11.411661
m_Ortho: m_Ortho:
m_Target: 0 m_Target: 0
speed: 2 speed: 2
@ -730,9 +730,9 @@ MonoBehaviour:
m_Position: m_Position:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 487.2 y: 486.4
width: 1119.2 width: 1119.2
height: 283.59998 height: 284.4
m_MinSize: {x: 101, y: 121} m_MinSize: {x: 101, y: 121}
m_MaxSize: {x: 4001, y: 4021} m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 11} m_ActualView: {fileID: 11}
@ -763,9 +763,9 @@ MonoBehaviour:
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 62.4 x: 62.4
y: 560.8 y: 560
width: 1118.2 width: 1118.2
height: 262.59998 height: 263.4
m_SerializedDataModeController: m_SerializedDataModeController:
m_DataMode: 0 m_DataMode: 0
m_PreferredDataMode: 0 m_PreferredDataMode: 0
@ -787,24 +787,24 @@ MonoBehaviour:
m_SkipHidden: 0 m_SkipHidden: 0
m_SearchArea: 1 m_SearchArea: 1
m_Folders: m_Folders:
- Assets/Scripts/UI - Assets/Prefab/MapNodePrefab
m_Globs: [] m_Globs: []
m_OriginalText: m_OriginalText:
m_ImportLogFlags: 0 m_ImportLogFlags: 0
m_FilterByTypeIntersection: 0 m_FilterByTypeIntersection: 0
m_ViewMode: 1 m_ViewMode: 1
m_StartGridSize: 64 m_StartGridSize: 62
m_LastFolders: m_LastFolders:
- Assets/Scripts/UI - Assets/Prefab/MapNodePrefab
m_LastFoldersGridSize: -1 m_LastFoldersGridSize: 62
m_LastProjectPath: D:\GitInventory_0330\test_45\ColorlessWorld-2024-4-2 m_LastProjectPath: D:\GitInventory_0524\test_45\ColorlessWorld-2024-4-2
m_LockTracker: m_LockTracker:
m_IsLocked: 0 m_IsLocked: 0
m_FolderTreeState: m_FolderTreeState:
scrollPos: {x: 0, y: 141.40002} scrollPos: {x: 0, y: 79}
m_SelectedIDs: 6e760000 m_SelectedIDs: 58070000
m_LastClickedID: 30318 m_LastClickedID: 1880
m_ExpandedIDs: 000000009a7400009c74000000ca9a3bffffff7f m_ExpandedIDs: 000000000c060000cc0600000c07000000ca9a3bffffff7f
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@ -832,7 +832,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
m_SelectedIDs: m_SelectedIDs:
m_LastClickedID: 0 m_LastClickedID: 0
m_ExpandedIDs: 000000009a7400009c74000000ca9a3bffffff7f m_ExpandedIDs: 000000000c06000000ca9a3bffffff7f
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@ -857,9 +857,9 @@ MonoBehaviour:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_ResourceFile: m_ResourceFile:
m_ListAreaState: m_ListAreaState:
m_SelectedInstanceIDs: 700d0000 m_SelectedInstanceIDs: 4ad00000
m_LastClickedInstanceID: 3440 m_LastClickedInstanceID: 53322
m_HadKeyboardFocusLastEvent: 1 m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c6230000f06f00003a7b000058cc00005ecc00006ed400004e6e0000e07200000a7000000e7000000281000056cf00000000000094760000 m_ExpandedInstanceIDs: c6230000f06f00003a7b000058cc00005ecc00006ed400004e6e0000e07200000a7000000e7000000281000056cf00000000000094760000
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
@ -885,7 +885,7 @@ MonoBehaviour:
m_ResourceFile: m_ResourceFile:
m_NewAssetIndexInList: -1 m_NewAssetIndexInList: -1
m_ScrollPosition: {x: 0, y: 0} m_ScrollPosition: {x: 0, y: 0}
m_GridSize: 64 m_GridSize: 62
m_SkipHiddenPackages: 0 m_SkipHiddenPackages: 0
m_DirectoriesAreaWidth: 207 m_DirectoriesAreaWidth: 207
--- !u!114 &11 --- !u!114 &11
@ -910,9 +910,9 @@ MonoBehaviour:
m_Pos: m_Pos:
serializedVersion: 2 serializedVersion: 2
x: 62.4 x: 62.4
y: 560.8 y: 560
width: 1118.2 width: 1118.2
height: 262.59998 height: 263.4
m_SerializedDataModeController: m_SerializedDataModeController:
m_DataMode: 0 m_DataMode: 0
m_PreferredDataMode: 0 m_PreferredDataMode: 0

13
ColorlessWorld-2024-4-2/UserSettings/Search.index

@ -1,13 +0,0 @@
{
"name": "Assets",
"roots": ["Assets"],
"includes": [],
"excludes": [],
"options": {
"types": true,
"properties": true,
"extended": false,
"dependencies": false
},
"baseScore": 999
}

76
ColorlessWorld-2024-4-2/UserSettings/Search.settings

@ -1,75 +1 @@
trackSelection = true {}
refreshSearchWindowsInPlayMode = false
fetchPreview = true
defaultFlags = 0
keepOpen = false
queryFolder = "Assets"
onBoardingDoNotAskAgain = true
showPackageIndexes = false
showStatusBar = false
scopes = {
}
providers = {
packages = {
active = true
priority = 90
defaultAction = null
}
profilermarkers = {
active = false
priority = 100
defaultAction = null
}
store = {
active = true
priority = 100
defaultAction = null
}
log = {
active = false
priority = 210
defaultAction = null
}
scene = {
active = true
priority = 50
defaultAction = null
}
find = {
active = true
priority = 25
defaultAction = null
}
performance = {
active = false
priority = 100
defaultAction = null
}
adb = {
active = false
priority = 2500
defaultAction = null
}
asset = {
active = true
priority = 25
defaultAction = null
}
}
objectSelectors = {
}
recentSearches = [
]
searchItemFavorites = [
]
savedSearchesSortOrder = 0
showSavedSearchPanel = false
hideTabs = false
expandedQueries = [
]
queryBuilder = false
ignoredProperties = "id;name;classname;imagecontentshash"
helperWidgetCurrentArea = "all"
disabledIndexers = ""
minIndexVariations = 2
findProviderIndexHelper = true
Loading…
Cancel
Save