diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRange.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat similarity index 93% rename from ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRange.mat rename to ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat index 80bd71b0..cf0aebc0 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRange.mat +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat @@ -20,7 +20,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: CastPreRange + m_Name: CastPreRangeBule m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} m_Parent: {fileID: 0} m_ModifiedSerializedProperties: 0 @@ -122,7 +122,7 @@ Material: - _Parallax: 0.005 - _QueueOffset: 0 - _ReceiveShadows: 1 - - _Smoothness: 0.5 + - _Smoothness: 0 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 @@ -131,8 +131,8 @@ Material: - _WorkflowMode: 1 - _ZWrite: 0 m_Colors: - - _BaseColor: {r: 0, g: 1, b: 0.64864874, a: 0.9490196} - - _Color: {r: 0, g: 1, b: 0.64864874, a: 0.9490196} - - _EmissionColor: {r: 0.055535804, g: 0.9056604, b: 0.44363618, a: 1} + - _BaseColor: {r: 0, g: 0.620383, b: 1, a: 0.3529412} + - _Color: {r: 0, g: 0.6203829, b: 1, a: 0.3529412} + - _EmissionColor: {r: 0.16879684, g: 0.05490196, b: 0.90588236, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat.meta b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat.meta new file mode 100644 index 00000000..85f7098b --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 32e8efb5b9333064a9cb9bff03ccf536 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat new file mode 100644 index 00000000..d47e5dcf --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3723055246666905880 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CastPreRangeGreen + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHAPREMULTIPLY_ON + - _EMISSION + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] + m_LightmapFlags: 2 + 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: 0} + 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: 0} + 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 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 1 + - _WorkflowMode: 1 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 0, g: 1, b: 0.64864874, a: 0.3529412} + - _Color: {r: 0, g: 1, b: 0.64864874, a: 0.3529412} + - _EmissionColor: {r: 0.034264863, g: 0.20754719, b: 0.11331992, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRange.mat.meta b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat.meta similarity index 100% rename from ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRange.mat.meta rename to ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat.meta diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat new file mode 100644 index 00000000..cf66b75f --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3723055246666905880 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CastPreRangeRed + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHAPREMULTIPLY_ON + - _EMISSION + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] + m_LightmapFlags: 2 + 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: 0} + 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: 0} + 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 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 1 + - _WorkflowMode: 1 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 0.110657394, b: 0, a: 0.3529412} + - _Color: {r: 1, g: 0.11065737, b: 0, a: 0.3529412} + - _EmissionColor: {r: 0.3207547, g: 0, b: 0.01491883, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat.meta b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat.meta new file mode 100644 index 00000000..c0e8a382 --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b8f5f9808ab9b8b4c903a0f3b2a7fe63 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat new file mode 100644 index 00000000..e02da82e --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat @@ -0,0 +1,138 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3723055246666905880 +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 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CastPreRangeRedWhite + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _ALPHAPREMULTIPLY_ON + - _EMISSION + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: [] + m_LightmapFlags: 2 + 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: 0} + 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: 0} + 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 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 1 + - _WorkflowMode: 1 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 0.3529412} + - _Color: {r: 1, g: 1, b: 1, a: 0.3529412} + - _EmissionColor: {r: 0.3773585, g: 0.3773585, b: 0.3773585, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat.meta b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat.meta new file mode 100644 index 00000000..b4af2675 --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93c7db93411fa374b8c5d1799b69e58c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab index 50de9d7a..fac6a24d 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab @@ -586,6 +586,10 @@ MonoBehaviour: noneColourGameObject: {fileID: 0} whoColour: 2 beforeWhoColour: 2 + redPre: {fileID: 2100000, guid: b8f5f9808ab9b8b4c903a0f3b2a7fe63, type: 2} + greenPre: {fileID: 2100000, guid: e4d58776fca90ec49aa2c7d259c73e27, type: 2} + bluePre: {fileID: 2100000, guid: 32e8efb5b9333064a9cb9bff03ccf536, type: 2} + whitePre: {fileID: 2100000, guid: 93c7db93411fa374b8c5d1799b69e58c, type: 2} whoColourPlane: {fileID: 7818877686521749494} colourBrokenParticle: {fileID: 0} CylinderFloor: {fileID: 8109433587480074365} diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs index 31881f83..700cb3b7 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs @@ -457,17 +457,17 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag //根据卡牌属性改变影响池 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; - Debug.Log("euler是"+ euler); getNodeTools.setEffectRangePreview(cardEntity.cardOriginalData.EffectRange, euler, currentNode,cardEntity); //setEffectRangePreview(cardEntity.cardOriginalData.EffectRange, euler, currentNode); //influencePreviewPool.Add(currentNode); - + //更新涂色预览材质 + SettlementManager.Instance.PreviewSwitchColor(cardEntity.cardOriginalData, currentNode); } //更新效果作用范围内怪物虚血 EnemyManager.Instance.ShowExpHp_Observer(cardEntity.influencePreviewPool); - + } } @@ -522,7 +522,7 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag foreach (MapUnity mapUnity in cardEntity.influencePreviewPool) { mapUnity.PlayerInfluenced(cardEntity.influencePreviewPool); - mapUnity.playerMark.meshRenderer .material = mapUnity.castPreRange; + // mapUnity.playerMark.meshRenderer .material = mapUnity.castPreRange; } } diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs index 5d4e43ee..fe4fe6c4 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs @@ -44,6 +44,12 @@ public class MapUnity : MonoBehaviour public int whoColour; public int beforeWhoColour; + [Header("涂色预览材质")] + public Material redPre; + public Material greenPre; + public Material bluePre; + public Material whitePre; + [Header("材质平面")] public GameObject whoColourPlane;//材质平面 public ParticleSystem colourBrokenParticle; @@ -160,6 +166,25 @@ public class MapUnity : MonoBehaviour whoColour = newColor; RefreshWhoColor(); } + public void switchPreColor(int newColor) + { + Debug.Log("释放颜色"+newColor); + switch (newColor ) + { + case 1: + playerMark.meshRenderer.material = redPre; + break; + case 2: + playerMark.meshRenderer.material = whitePre; + break; + case 3: + playerMark.meshRenderer.material = bluePre; + break; + case 4: + playerMark.meshRenderer.material = greenPre; + break; + } + } public void RegisterUnit() { GameManager.Instance.X[locationX].Y[locationY] = this; diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/manager/SettlementManager.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/manager/SettlementManager.cs index e50ed8c8..f4e75abf 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/manager/SettlementManager.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/manager/SettlementManager.cs @@ -129,7 +129,48 @@ public class SettlementManager : Singleton return mapColorCount; } + //预览涂色颜色 + public void PreviewSwitchColor(CardOriginalData cardOriginalData, MapUnity targetNode) + { + //1red,2white,3blue,4green,5black + ZeroToFiveCircularCounter counter = new ZeroToFiveCircularCounter(); + int offset = 3; + Vector3 face = targetNode.transform.position - GameManager.Instance.playerOn.transform.position; + if (!targetNode.Equals(GameManager.Instance.playerOn)) + { + float euler = Vector3.SignedAngle(-GameManager.Instance.playerOn.transform.forward, face, GameManager.Instance.playerOn.transform.up) + 180; + offset = getEulerOffset(offset, euler); + } + if (!cardOriginalData.nodesColor[0].Equals(Name.none)) + { + targetNode.switchPreColor(Name.stringColorToint(cardOriginalData.nodesColor[0])); + } + // Debug.Log("offset是" + offset); + for (int i = 0; i < cardOriginalData.nodesMark.Length; i++) + { + MapUnity endNode = targetNode; + try + { + string[] marks = cardOriginalData.nodesMark[i].Split("_"); + for (int j = 0; j < marks.Length; j++) + { + MapUnity oldNode = endNode; + endNode = oldNode.unitPool[counter.Add(offset, int.Parse(marks[j]))]; + } + if (endNode != null) + { + // endNode.switchColor(Name.stringColorToint(cardOriginalData.nodesColor[i + 1])); + endNode.switchPreColor(Name.stringColorToint(cardOriginalData.nodesColor[i + 1])); + } + } + catch (Exception e) + { + + } + + } + } private int getEulerOffset(int offset, float euler) { switch (euler)