From 1659541fc3e20879d72f1a50fd54c5ee853333b4 Mon Sep 17 00:00:00 2001 From: 45 <980269297@qq.com> Date: Wed, 4 Dec 2024 19:48:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A0=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E5=8D=A1=E6=95=B0=E5=80=BC=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/GameDate/cardDeckList.asset | 1 + .../MapNodePrefab/CastPreRangeBlack.mat | 137 ++++++++++++++++++ .../MapNodePrefab/CastPreRangeBlack.mat.meta | 8 + .../Prefab/MapNodePrefab/CastPreRangeBule.mat | 3 +- .../MapNodePrefab/CastPreRangeGreen.mat | 4 +- .../Prefab/MapNodePrefab/CastPreRangeRed.mat | 6 +- .../MapNodePrefab/CastPreRangeRedWhite.mat | 4 +- .../Prefab/MapNodePrefab/EnemyColour.mat | 4 +- .../Prefab/MapNodePrefab/HightLight.mat | 8 +- .../Prefab/MapNodePrefab/MapUnity _2.prefab | 1 + .../Assets/Prefab/MapNodePrefab/enemyMark.mat | 4 +- .../Assets/Scripts/Card/CardDrag.cs | 18 ++- .../Assets/Scripts/Card/CardEntity.cs | 22 ++- .../Assets/Scripts/GameManager.cs | 44 ++++-- .../Assets/Scripts/MapUnity.cs | 5 +- 15 files changed, 217 insertions(+), 52 deletions(-) create mode 100644 ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBlack.mat create mode 100644 ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBlack.mat.meta diff --git a/ColorlessWorld-2024-4-2/Assets/GameDate/cardDeckList.asset b/ColorlessWorld-2024-4-2/Assets/GameDate/cardDeckList.asset index 443fbcf7..196b6cbd 100644 --- a/ColorlessWorld-2024-4-2/Assets/GameDate/cardDeckList.asset +++ b/ColorlessWorld-2024-4-2/Assets/GameDate/cardDeckList.asset @@ -18,3 +18,4 @@ MonoBehaviour: - 1003 - 1004 - 2001 + - 1035 diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBlack.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBlack.mat new file mode 100644 index 00000000..5f023caa --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBlack.mat @@ -0,0 +1,137 @@ +%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: CastPreRangeBlack + 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: 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: 0.017326381, b: 0.3207547, a: 0.95686275} + - _Color: {r: 0, g: 0.017326381, b: 0.32075468, a: 0.95686275} + - _EmissionColor: {r: 2, g: 0, b: 0.021570206, 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/CastPreRangeBlack.mat.meta b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBlack.mat.meta new file mode 100644 index 00000000..8d686bbc --- /dev/null +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBlack.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81001e79f776fc64cab816ecbdf1c685 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat index cf0aebc0..14df5379 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeBule.mat @@ -26,10 +26,9 @@ Material: m_ModifiedSerializedProperties: 0 m_ValidKeywords: - _ALPHAPREMULTIPLY_ON - - _EMISSION - _SURFACE_TYPE_TRANSPARENT m_InvalidKeywords: [] - m_LightmapFlags: 2 + m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: 3000 diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat index d47e5dcf..4427a82a 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeGreen.mat @@ -131,8 +131,8 @@ Material: - _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} + - _BaseColor: {r: 0, g: 1, b: 0.64705896, a: 0.87058824} + - _Color: {r: 0, g: 1, b: 0.6470589, a: 0.87058824} - _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/CastPreRangeRed.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat index cf66b75f..8424c0c1 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRed.mat @@ -131,8 +131,8 @@ Material: - _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} + - _BaseColor: {r: 1, g: 0.11065731, b: 0, a: 0.95686275} + - _Color: {r: 1, g: 0.11065727, b: 0, a: 0.95686275} + - _EmissionColor: {r: 2, g: 0, b: 0.021570206, 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 b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat index e02da82e..ead12866 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/CastPreRangeRedWhite.mat @@ -131,8 +131,8 @@ Material: - _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} + - _BaseColor: {r: 0.8113208, g: 0.8113208, b: 0.8113208, a: 0.87058824} + - _Color: {r: 0.8113207, g: 0.8113207, b: 0.8113207, a: 0.87058824} - _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/EnemyColour.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/EnemyColour.mat index f31dc3f3..a78fefd1 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/EnemyColour.mat +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/EnemyColour.mat @@ -16,7 +16,7 @@ Material: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 + m_CustomRenderQueue: 2001 stringTagMap: RenderType: Opaque disabledShaderPasses: [] @@ -102,7 +102,7 @@ Material: - _Metallic: 0 - _OcclusionStrength: 1 - _Parallax: 0.005 - - _QueueOffset: 0 + - _QueueOffset: 1 - _ReceiveShadows: 1 - _Smoothness: 0.5 - _SmoothnessTextureChannel: 0 diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/HightLight.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/HightLight.mat index 9c27f619..ce8151ee 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/HightLight.mat +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/HightLight.mat @@ -30,7 +30,7 @@ Material: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 + m_CustomRenderQueue: 3001 stringTagMap: RenderType: Transparent disabledShaderPasses: @@ -118,7 +118,7 @@ Material: - _Metallic: 0.5 - _OcclusionStrength: 1 - _Parallax: 0.005 - - _QueueOffset: 0 + - _QueueOffset: 1 - _ReceiveShadows: 1 - _Smoothness: 0.5 - _SmoothnessTextureChannel: 0 @@ -129,8 +129,8 @@ Material: - _WorkflowMode: 1 - _ZWrite: 0 m_Colors: - - _BaseColor: {r: 1, g: 0, b: 0, a: 0.60784316} - - _Color: {r: 1, g: 0, b: 0, a: 0.60784316} + - _BaseColor: {r: 0, g: 0.6132076, b: 0.37218037, a: 0.60784316} + - _Color: {r: 0, g: 0.6132076, b: 0.37218034, a: 0.60784316} - _EmissionColor: {r: 32.110424, g: 0, b: 0, 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/MapUnity _2.prefab b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab index fac6a24d..674fe2d8 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/MapUnity _2.prefab @@ -590,6 +590,7 @@ MonoBehaviour: greenPre: {fileID: 2100000, guid: e4d58776fca90ec49aa2c7d259c73e27, type: 2} bluePre: {fileID: 2100000, guid: 32e8efb5b9333064a9cb9bff03ccf536, type: 2} whitePre: {fileID: 2100000, guid: 93c7db93411fa374b8c5d1799b69e58c, type: 2} + blackPre: {fileID: 2100000, guid: 81001e79f776fc64cab816ecbdf1c685, type: 2} whoColourPlane: {fileID: 7818877686521749494} colourBrokenParticle: {fileID: 0} CylinderFloor: {fileID: 8109433587480074365} diff --git a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/enemyMark.mat b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/enemyMark.mat index 0294bd0d..2e8de3e7 100644 --- a/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/enemyMark.mat +++ b/ColorlessWorld-2024-4-2/Assets/Prefab/MapNodePrefab/enemyMark.mat @@ -20,7 +20,7 @@ Material: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 3000 + m_CustomRenderQueue: 3001 stringTagMap: RenderType: Transparent disabledShaderPasses: @@ -108,7 +108,7 @@ Material: - _Metallic: 0.5 - _OcclusionStrength: 1 - _Parallax: 0.005 - - _QueueOffset: 0 + - _QueueOffset: 1 - _ReceiveShadows: 1 - _Smoothness: 0.5 - _SmoothnessTextureChannel: 0 diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs index 700cb3b7..1b700117 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardDrag.cs @@ -194,7 +194,11 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag ready = true; } transform.localPosition = cardOnMouseEnter.originPoint;// + new Vector3(0, 30, 0); - // transform.localScale = new Vector3(1, 1, 1); + // transform.localScale = new Vector3(1, 1, 1); + + //注册拖拽卡牌信息 + GameManager.Instance.currentCardEntity = cardEntity; + GameManager.Instance.currentMapNode = currentNode; if (cardEntity.cardOriginalData.CastingRange != 0) { ainPanleWork(eventData); @@ -438,11 +442,7 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag mapUnity.influenced = false; } cardEntity.influencePreviewPool.Clear(); - currentNode = raycastHit.collider.transform.GetComponent(); - - //注册拖拽卡牌信息 - GameManager.Instance.currentCardEntity = cardEntity; - GameManager .Instance .currentMapNode = currentNode; + currentNode = raycastHit.collider.transform.GetComponent(); //重新调用范围预览 //GameManager.Instance.player.StepPreviewInfluencedNode(cardEntity.cardOriginalData.CastingRange); int castRange = cardEntity.cardOriginalData.CastingRange; @@ -508,7 +508,11 @@ public class CardDrag : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDrag cardEntity.influencePreviewPool.Add(currentNode); } }*/ - getNodeTools.setEffectRangePreview(cardEntity.cardOriginalData.EffectRange, 30.0f, currentNode, cardEntity); + getNodeTools.setEffectRangePreview(cardEntity.cardOriginalData.EffectRange, 30.0f, currentNode, cardEntity); + //更新效果作用范围内怪物虚血 + EnemyManager.Instance.ShowExpHp_Observer(cardEntity.influencePreviewPool); + //更新涂色预览材质 + SettlementManager.Instance.PreviewSwitchColor(cardEntity.cardOriginalData, GameManager .Instance .playerOn ); } public void OnDrag(PointerEventData eventData) diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardEntity.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardEntity.cs index 8fa57ed1..4c28edbd 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardEntity.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/Card/CardEntity.cs @@ -152,18 +152,17 @@ public class CardEntity : MonoBehaviour //debug卡名 //Debug.Log("打出"+cardOriginalData.ChineseName); //Debug.Log("结算时候influencePreviewPool大小" + influencePreviewPool.Count); + //清除预览色 + //遍历影响池变色 + foreach (MapUnity mapUnity in influencePreviewPool) + { + mapUnity.influenced = false; + } + GameManager.Instance.SyncColourCountUI(); //结算效果 //生成子弹节点 - if(cardOriginalData.CastingRange>0) - { - //清除预览色 - //遍历影响池变色 - foreach (MapUnity mapUnity in influencePreviewPool) - { - mapUnity.influenced = false; - } - GameManager.Instance.SyncColourCountUI(); - + if (cardOriginalData.CastingRange>0) + { //遍历范围预览池消除影响色 Debug.Log("清除前红色格数:" + GameManager.Instance.player.influencePreviewPool.Count); @@ -174,11 +173,10 @@ public class CardEntity : MonoBehaviour MapUnityManager.Instance.castPool.Clear(); var bulle = Instantiate(cardBulletPrefab, transform.position, cardBulletPrefab.transform.localRotation); - Debug.Log("发射1"); yield return StartCoroutine(bulle.GetComponent().MoveToDestination(GetComponent().currentNode.transform.position,GameManager .Instance .player .transform .position )); } - Debug.Log("发射2"); + yield return StartCoroutine(DestructionManager.Instance.startDestoryAndUseCard(this.gameObject, cardOriginalData, influencePreviewPool, cardIndex, targetNode)); } diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/GameManager.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/GameManager.cs index 689b41b7..c3c30d49 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/GameManager.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/GameManager.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; @@ -247,6 +248,17 @@ public class GameManager : Singleton sumMiddleText.text = whiteNodeCount.ToString(); sumRightText.text = blackNodeCount.ToString(); float totoalNode = redNodeCount + blueNodeCount + greenNodeCount + whiteNodeCount + blackNodeCount; + //文字位置 + float length = barBox.sizeDelta.x; + redText.transform.localPosition = new Vector3((length * (Red.fillAmount - 1)) * 0.5f, 0, 0); + greenText.transform.localPosition = new Vector3(length * 0.5f * (Green.fillAmount + Red.fillAmount - 1), 0, 0); + blueText.transform.localPosition = new Vector3(length * 0.5f * (Bule.fillAmount + Green.fillAmount - 1), 0, 0); + whiteText.transform.localPosition = new Vector3(length * 0.5f * (White.fillAmount + Bule.fillAmount - 1), 0, 0); + blackText.transform.localPosition = new Vector3(length * 0.5f * White.fillAmount, 0, 0); + + sumPlayerText.transform.localPosition = new Vector3(length * (Bule.fillAmount - 1) * 0.5f, 150, 0); + sumMiddleText.transform.localPosition = new Vector3(whiteText.transform.localPosition.x, 150, 0); + sumRightText.transform.localPosition = new Vector3(blackText.transform.localPosition.x, 150, 0); //颜色 Red.fillAmount = redNodeCountLatest / totoalNode; Green.fillAmount = Red.fillAmount + greenNodeCountLatest / totoalNode; @@ -254,8 +266,23 @@ public class GameManager : Singleton White.fillAmount = Bule.fillAmount + whiteNodeCountLatest / totoalNode; // Black.fillAmount = Bule.fillAmount + blackNodeCountLatest / totoalNode; //预览涂色 - if (onDrag && currentCardEntity != null && currentMapNode != null && currentMapNode .influenced ==true) + if (onDrag && currentCardEntity != null ) { + if(currentCardEntity.cardOriginalData.CastingRange != 0) + { + if( currentMapNode != null && currentMapNode.influenced == true) + { + + } + else + { + return; + } + } + else + { + currentMapNode = playerOn; + } List ints = SettlementManager.Instance.PreviewColorMapUnity(currentCardEntity.cardOriginalData, currentMapNode); for (int i = 0; i < ints.Count; i++) { @@ -382,17 +409,6 @@ public class GameManager : Singleton sumRightTextPre.gameObject.SetActive(false); } - //文字位置 - float length = barBox.sizeDelta.x; - redText.transform.localPosition = new Vector3((length * (Red.fillAmount-1))*0.5f, 0, 0); - greenText.transform.localPosition = new Vector3(length * 0.5f * (Green.fillAmount + Red.fillAmount - 1), 0, 0); - blueText.transform.localPosition = new Vector3(length * 0.5f * (Bule.fillAmount + Green.fillAmount - 1), 0, 0); - whiteText .transform .localPosition = new Vector3 (length * 0.5f * (White.fillAmount + Bule.fillAmount - 1), 0, 0); - blackText.transform.localPosition= new Vector3 (length * 0.5f * White.fillAmount , 0, 0); - - sumPlayerText .transform .localPosition = new Vector3 (length * (Bule.fillAmount - 1) * 0.5f,150,0); - sumMiddleText.transform.localPosition = new Vector3(whiteText.transform.localPosition.x, 150, 0); - sumRightText.transform.localPosition = new Vector3(blackText.transform.localPosition.x, 150, 0); //太阳 string advColor = MapUnityManager.Instance.getAdvNode(); if(lastSunColor != advColor ) @@ -426,9 +442,7 @@ public class GameManager : Singleton sunImage.color = Color.gray; break; } - } - - + } } //统计场地颜色 diff --git a/ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs b/ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs index fe4fe6c4..72119593 100644 --- a/ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs +++ b/ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs @@ -49,7 +49,7 @@ public class MapUnity : MonoBehaviour public Material greenPre; public Material bluePre; public Material whitePre; - + public Material blackPre; [Header("材质平面")] public GameObject whoColourPlane;//材质平面 public ParticleSystem colourBrokenParticle; @@ -183,6 +183,9 @@ public class MapUnity : MonoBehaviour case 4: playerMark.meshRenderer.material = greenPre; break; + case 5: + playerMark.meshRenderer.material = blackPre; + break; } } public void RegisterUnit()