Compare commits

...

2 Commits

  1. 2
      ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Blue.mat
  2. 2
      ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Green.mat
  3. 2
      ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Matal.mat
  4. 2
      ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Red.mat
  5. 2
      ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_White.mat
  6. 2
      ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Yellow.mat
  7. 27
      ColorlessWorld-2024-4-2/Assets/Plugins/Microsoft.CSharp.dll.meta
  8. 21
      ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity/MapInforManager.cs
  9. 17
      ColorlessWorld-2024-4-2/Assets/Scripts/Tool/Name.cs
  10. 258
      ColorlessWorld-2024-4-2/Assets/Scripts/Weapon/WeaponNode.cs
  11. 241
      ColorlessWorld-2024-4-2/Assets/TextMesh Pro/Resources/Fonts & Materials/BackGroundLightSourceHanSansCN-Normal SDF.asset

2
ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Blue.mat

@ -349,7 +349,7 @@ Material:
- _MainTexRefine: {r: 1, g: 1, b: 1, a: 0}
- _MaskPannerAndRotation: {r: 0, g: 0, b: 0, a: 0}
- _MaskRefine: {r: 0, g: 1, b: 1, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.5, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.3695656, a: 0}
- _Panner_Rotation: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tex2Tiling: {r: 5, g: 0.33, b: 0, a: 0}

2
ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Green.mat

@ -349,7 +349,7 @@ Material:
- _MainTexRefine: {r: 1, g: 1, b: 1, a: 0}
- _MaskPannerAndRotation: {r: 0, g: 0, b: 0, a: 0}
- _MaskRefine: {r: 0, g: 1, b: 1, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.5, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.4673913, a: 0}
- _Panner_Rotation: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tex2Tiling: {r: 5, g: 0.33, b: 0, a: 0}

2
ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Matal.mat

@ -349,7 +349,7 @@ Material:
- _MainTexRefine: {r: 1, g: 1, b: 1, a: 0}
- _MaskPannerAndRotation: {r: 0, g: 0, b: 0, a: 0}
- _MaskRefine: {r: 0, g: 1, b: 1, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.5, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.29347885, a: 0}
- _Panner_Rotation: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tex2Tiling: {r: 5, g: 0.33, b: 0, a: 0}

2
ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Red.mat

@ -349,7 +349,7 @@ Material:
- _MainTexRefine: {r: 1, g: 1, b: 1, a: 0}
- _MaskPannerAndRotation: {r: 0, g: 0, b: 0, a: 0}
- _MaskRefine: {r: 0, g: 1, b: 1, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.5, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.4673913, a: 0}
- _Panner_Rotation: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tex2Tiling: {r: 5, g: 0.33, b: 0, a: 0}

2
ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_White.mat

@ -30,7 +30,7 @@ Material:
m_Ints: []
m_Floats: []
m_Colors:
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.09347254, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.07608679, a: 0}
- _Tex2offset: {r: 0.6, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []
--- !u!114 &558137770919511581

2
ColorlessWorld-2024-4-2/Assets/Particle Eff/Eff_UI/mat_FloorsPanel/mat_Yellow.mat

@ -349,7 +349,7 @@ Material:
- _MainTexRefine: {r: 1, g: 1, b: 1, a: 0}
- _MaskPannerAndRotation: {r: 0, g: 0, b: 0, a: 0}
- _MaskRefine: {r: 0, g: 1, b: 1, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.5, a: 0}
- _MaskTilingAndOffset: {r: 0.5, g: 1, b: 0.29347885, a: 0}
- _Panner_Rotation: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Tex2Tiling: {r: 5, g: 0.33, b: 0, a: 0}

27
ColorlessWorld-2024-4-2/Assets/Plugins/Microsoft.CSharp.dll.meta

@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: a94cf6fef2879da4c91e5ef768aadf4e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

21
ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity/MapInforManager.cs

@ -17,11 +17,26 @@ public class MapInforManager : Singleton<MapInforManager>
bool isShow = true;
switch (mapUnity.whoColour)
{
case Name.NodeColor.Red:
/* case Name.NodeColor.Red:
infotText.text = "普通的红色地块。";
break;
break;*/
case Name.NodeColor.Holy:
infotText.text = "特殊的黑色地块,不能被其他颜色更改。";
infotText.text = "圣光地块:白色计数+2,只能被诅咒地块转化。";
break;
case Name.NodeColor.Curse:
infotText.text = "诅咒地块:黑色计数+3,只能被圣光地块转化。";
break;
case Name.NodeColor.Lava:
infotText.text = "岩浆地块:特殊的红色地块,转化时会销毁上面的物品。";
break;
case Name.NodeColor.Glacier:
infotText.text = "冰川地块:+3蓝色计数,被岩浆地块转化时地块消失。";
break;
case Name.NodeColor.Void:
infotText.text = "虚无地块:+2黑色计数,不可选中。";
break;
case Name.NodeColor.Quicksand:
infotText.text = "流沙地块:+3黄色计数,被转化时地块消失。";
break;
default:
isShow = false;

17
ColorlessWorld-2024-4-2/Assets/Scripts/Tool/Name.cs

@ -1291,7 +1291,7 @@ public static class Name
//每有黑色+n
public const string everyBlackNodeAddScore = "everyBlackNodeAddScore";
//每有白色+n
public const string everyWhiteNodeAddScore = "everyBlackNodeAddScore";
public const string everyWhiteNodeAddScore = "everyWhiteNodeAddScore";
//每有圣光+n
public const string everyHolyNodeAddScore = "everyHolyNodeAddScore";
//每有炸弹+n
@ -1306,6 +1306,9 @@ public static class Name
public static readonly HashSet<string> PlayerResultSet = new HashSet<string> { addScore,mulScore, repetWeaponNode, redNodeCount, blueNodeCount
,yellowNodeCount,mostNodeCount,leastNodeCount,allNodeCount,drawCard,isIgnoreCondition,everyRedNodeAddScore,everyYellowNodeAddScore,everyBlueNodeAddScore};
public static readonly HashSet<string> EveryResultSet = new HashSet<string> {everyBelieverAddScore,everyBelieverAddScore,everyBombAddScore,everyHolyNodeAddScore,everyWhiteNodeAddScore,
everyRedNodeAddScore,everyYellowNodeAddScore,everyBlueNodeAddScore};
public static readonly Dictionary<string, float> PlayerBasicResultSet = new Dictionary<string, float> { {addScore,0.4f}, {redNodeCount, 0.1f }, {blueNodeCount,0.1f}
,{yellowNodeCount,0.1f},{ everyRedNodeAddScore,0.1f},{ everyYellowNodeAddScore,0.1f},{everyBlueNodeAddScore,0.1f}};
@ -1343,12 +1346,12 @@ public static class Name
public static class EveryNodeAddScoreResultSet
{
public static readonly HashSet<string> BasiclSet = new HashSet<string> { "4_1" };
public static readonly HashSet<string> BasiclWithoutConditionSet = new HashSet<string> { "5_1" };
public static readonly HashSet<string> SimpleSet = new HashSet<string> { "3_1" };
public static readonly HashSet<string> ElementarySet = new HashSet<string> { "2_1" };
public static readonly HashSet<string> IntermediateSet = new HashSet<string> { "1_1" };
public static readonly HashSet<string> AdvancedSet = new HashSet<string> { "1_2" };
public static readonly HashSet<string> BasiclSet = new HashSet<string> { "3_1" };
public static readonly HashSet<string> BasiclWithoutConditionSet = new HashSet<string> { "4_1" };
public static readonly HashSet<string> SimpleSet = new HashSet<string> { "2_1" };
public static readonly HashSet<string> ElementarySet = new HashSet<string> { "1_1" };
public static readonly HashSet<string> IntermediateSet = new HashSet<string> { "1_2" };
public static readonly HashSet<string> AdvancedSet = new HashSet<string> { "1_3" };
}
public static class DomainFunction

258
ColorlessWorld-2024-4-2/Assets/Scripts/Weapon/WeaponNode.cs

@ -3,11 +3,13 @@ using System.Collections;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.SocialPlatforms.Impl;
using UnityEngine.UI;
using UnityEngine.UIElements;
using static TMPro.SpriteAssetUtilities.TexturePacker_JsonArray;
@ -15,7 +17,7 @@ using static UnityEngine.InputSystem.InputControlScheme.MatchResult;
using Image = UnityEngine.UI.Image;
using Match = System.Text.RegularExpressions.Match;
public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDragHandler,IPointerExitHandler ,IPointerEnterHandler
public class WeaponNode : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler, IPointerExitHandler, IPointerEnterHandler
{
[Header("图标")]
public Image nodeImage;
@ -52,7 +54,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
public int extraMostNodeCount = 0;
public int extraLeastNodeCount = 0;
public int extraAllNodeCount = 0;
public bool isIgnoreCondition=false;
public bool isIgnoreCondition = false;
public bool isDoubleSettle = false;
public string resultDescription;
public string conditionDescription;
@ -64,7 +66,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
//public Sprite gemImage;
public bool isGemImage;//标志是否是领域类型宝石
[Header("信息板计时器")]
public float time =0.5f;
public float time = 0.5f;
float currentTime;
bool isShow;
bool isOn;
@ -73,7 +75,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
private void Update()
{
//SettleScore();
if(isOn &&isShow ==false )
if (isOn && isShow == false)
{
if (currentTime > 0)
{
@ -92,9 +94,9 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
isShow = true;
}
}
}
private void Start()
{
currentTime = time;
@ -108,18 +110,18 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
//score = 0;
//scoreMul = 0f;
resetCountBeforeSettle();
if (isIgnoreCondition||ConditionCheck(position))
if (isIgnoreCondition || ConditionCheck(position))
{
Debug.Log("结算成功节点2"+"位置"+position);
Debug.Log("结算成功节点2" + "位置" + position);
isActive = true;
if (isDoubleSettle)
if (isDoubleSettle)
{
SettleFunction(position, result,ref score);
SettleFunction(position, result, ref score);
}
SettleFunction(position, result, ref score);
}
else if(!Name.WeaponNodeCondition.PlayerConvertSet.Contains(condition))
else if (!Name.WeaponNodeCondition.PlayerConvertSet.Contains(condition))
{
isActive = false;
}
@ -178,15 +180,15 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
}
}
public virtual void SettleFunction(int position,string result, ref int score)
public virtual void SettleFunction(int position, string result, ref int score)
{
Debug.Log("结算成功节点3");
string[] keys = result.Split("_");
for (int j = 0; j < keys.Length; j++)
{
SingleFunctionSettle(keys[j],resultValue,ref score);
SingleFunctionSettle(keys[j], resultValue, ref score);
Debug.Log("score是" + score);
}
}
@ -222,7 +224,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
}
for (int k = 0; k < matchList.Count; k++)
{
Debug.Log("matchList是" + matchList[k]+"位置" + position);
Debug.Log("matchList是" + matchList[k] + "位置" + position);
if (!matchList[k])
{
result = false;
@ -235,26 +237,26 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
return result;
}
public void SingleFunctionSettleForPlayerTurnEnd(string result,string resultValue)
public void SingleFunctionSettleForPlayerTurnEnd(string result, string resultValue)
{
switch (result)
{
case Name.NodeItem.Volcano:
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.Volcano, int.Parse(resultValue));
Debug.Log("加入了"+ result+ resultValue);
Debug.Log("加入了" + result + resultValue);
break;
case Name.NodeItem.AcidRain:
Usermanager.Instance.SufferPlayerAbnormalCondition(AbnormalCondition.AcidRain, int.Parse(resultValue));
Debug.Log("加入了" + result + resultValue);
break;
case Name.WeaponNodeFunction.threeColorRedistribution:
HashSet<MapUnity> targetNodes= new HashSet<MapUnity>();
HashSet<MapUnity> targetNodes = new HashSet<MapUnity>();
//targetNodes
MathTool.AddRange(targetNodes,getNodeTools.getNodesWithColor(Name.Color.Blue), getNodeTools.getNodesWithColor(Name.Color.Red),
getNodeTools.getNodesWithColor(Name.Color.Yellow));
int allCount=targetNodes.Count;
MathTool.AddRange(targetNodes, getNodeTools.getNodesWithColor(Name.Color.Blue), getNodeTools.getNodesWithColor(Name.Color.Red),
getNodeTools.getNodesWithColor(Name.Color.Yellow));
int allCount = targetNodes.Count;
List<List<MapUnity>> parts = MathTool.SplitHashSet(targetNodes, 3);
for (int i = 0;i< parts.Count; i++)
for (int i = 0; i < parts.Count; i++)
{
switch (i)
{
@ -277,28 +279,28 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
}
break;
}
}
break;
}
}
public void SingleFunctionSettle(string result, string resultValue,ref int score)
public void SingleFunctionSettle(string result, string resultValue, ref int score)
{
//score += turnScore;
/* if (condition.Equals(Name.WeaponNodeCondition.everyNumNodeConvert))
{
for (int i = 0; i < MapUnityManager.Instance.switchNodeNum / int.Parse(conditionValue); i++)
{
BasicSingleFunctionSettle(result, resultValue,ref score);
}
}*/
/* if (condition.Equals(Name.WeaponNodeCondition.everyNumNodeConvert))
{
for (int i = 0; i < MapUnityManager.Instance.switchNodeNum / int.Parse(conditionValue); i++)
{
BasicSingleFunctionSettle(result, resultValue,ref score);
}
}*/
//else
//{
BasicSingleFunctionSettle(result, resultValue, ref score);
BasicSingleFunctionSettle(result, resultValue, ref score);
//}
}
@ -403,6 +405,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
public void SingleFunctionSettleForAwake()
{
settleCount++;
switch (result)
{
case Name.WeaponNodeFunction.addScoreThisTurn:
@ -414,7 +417,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
public void addPlayerMostNodeCount()
{
string mostNode= getNodeTools.getMostPlayerNodeName();
string mostNode = getNodeTools.getMostPlayerNodeName();
switch (mostNode)
{
case Name.WeaponNodeFunction.redNodeCount:
@ -445,7 +448,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
break;
}
}
public bool SingleConditionCheck(string condition,int position)
public bool SingleConditionCheck(string condition, int position)
{
bool check = false;
//cardOriginalData.originFunctionVal.Clear();
@ -513,7 +516,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
check = false;
break;
}
if (weaponSlotA.childCount>0)
if (weaponSlotA.childCount > 0)
{
Transform weaponANode = weaponSlotA.GetChild(0);
WeaponNode nodeA = weaponANode.transform.GetComponent<WeaponNode>();
@ -537,13 +540,13 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
check = false;
break;
}
break;
case Name.WeaponNodeCondition.positionUsed:
Transform weaponSlotB = WeaponManager.Instance.playerWeaponNodeList.GetChild(int.Parse(conditionValue));
if (weaponSlotB == null)
{
check=false;
check = false;
break;
}
if (weaponSlotB.childCount > 0)
@ -570,15 +573,15 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
check = false;
break;
}
break;
case Name.WeaponNodeCondition.node:
check = checkConditionNode(nodesMark, nodesColor);
break;
case Name.WeaponNodeCondition.threeColorCountMoreThan:
if(getNodeTools.getNodesCount(Name.Color.Blue)> int.Parse(conditionValue) && getNodeTools.getNodesCount(Name.Color.Yellow) > int.Parse(conditionValue) && getNodeTools.getNodesCount(Name.Color.Red) > int.Parse(conditionValue))
if (getNodeTools.getNodesCount(Name.Color.Blue) > int.Parse(conditionValue) && getNodeTools.getNodesCount(Name.Color.Yellow) > int.Parse(conditionValue) && getNodeTools.getNodesCount(Name.Color.Red) > int.Parse(conditionValue))
{
check=true;
check = true;
}
else
{
@ -592,9 +595,9 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
check = MathTool.IsMaxDifferenceGreaterThan(getNodeTools.getNodesCount(Name.Color.Blue), getNodeTools.getNodesCount(Name.Color.Yellow), getNodeTools.getNodesCount(Name.Color.Red), 0);
break;
case Name.WeaponNodeCondition.everyNumNodeConvert:
if(MapUnityManager.Instance.switchNodeNum- settleCount* int.Parse(conditionValue) >= int.Parse(conditionValue))
if (MapUnityManager.Instance.switchNodeNum - settleCount * int.Parse(conditionValue) >= int.Parse(conditionValue))
{
check=true;
check = true;
settleCount++;
//MapUnityManager.Instance.switchNodeNum-= int.Parse(conditionValue);
}
@ -626,8 +629,8 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
}
}
return check;
}
@ -637,7 +640,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
if (basicCheck(nodesColor))
{
Debug.Log("通过basicCheck");
bool primeCheckRusult=false;
bool primeCheckRusult = false;
//StartCoroutine(primeCheck(nodesMark, nodesColor, output => { primeCheckRusult = output; }));
if (primeCheck(nodesMark, nodesColor))
{
@ -653,18 +656,18 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
return result;
}
public bool primeCheck(string[] nodesMark, string[] nodesColor)
public bool primeCheck(string[] nodesMark, string[] nodesColor)
{
bool result = false;
bool haveOrigin=false;
HashSet <MapUnity> targetNodes= new HashSet <MapUnity>();
bool haveOrigin = false;
HashSet<MapUnity> targetNodes = new HashSet<MapUnity>();
for (int i = 0; i < nodesMark.Length; i++)
{
if (nodesMark[i].Equals("0_0"))
{
Debug.Log("haveOrigin");
haveOrigin= true;
targetNodes =getNodeTools.getNodesWithColor(nodesColor[i]);
haveOrigin = true;
targetNodes = getNodeTools.getNodesWithColor(nodesColor[i]);
}
}
if (!haveOrigin)
@ -683,7 +686,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
int processed = 0;
if (mapUnity.isCaledDictionary.TryGetValue(onlyTapForWeaponNode, out BoolPair boolPair))
{
Debug.Log("isChecked是"+ boolPair.isChecked +"x是"+mapUnity.locationX+"y是"+mapUnity.locationY);
Debug.Log("isChecked是" + boolPair.isChecked + "x是" + mapUnity.locationX + "y是" + mapUnity.locationY);
if (!boolPair.isChecked)
{
Debug.Log("false进行check");
@ -699,7 +702,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
return result;
}
}
else if(boolPair.checkResult)
else if (boolPair.checkResult)
{
result = true;
return result;
@ -707,7 +710,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
}
else
{
Debug.Log("add了true");
Debug.Log("add了true");
mapUnity.isCaledDictionary.Add(onlyTapForWeaponNode, new BoolPair { isChecked = true });
if (getNodeTools.CheckWeaponConditionColorForSingleNode(nodesMark, nodesColor, mapUnity, onlyTapForWeaponNode))
{
@ -743,7 +746,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
int yellowNodeCount = 0;
for (int i = 0; i < nodesColor.Length; i++)
{
switch (nodesColor[i])
switch (nodesColor[i])
{
case Name.Color.White:
whiteNodeCount++;
@ -771,7 +774,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
Debug.Log("blueNodeCount数量是" + blueNodeCount + MapUnityManager.Instance.blueNodeCount);
if (whiteNodeCount > MapUnityManager.Instance.whiteNodeCount || redNodeCount > MapUnityManager.Instance.redNodeCount || yellowNodeCount > MapUnityManager.Instance.yellowNodeCount || blueNodeCount > MapUnityManager.Instance.blueNodeCount)
{
return result;
}
else
@ -814,16 +817,16 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
GetComponent<CanvasGroup>().blocksRaycasts = false;
inforPanel.SetActive(false);
GameObject beginDragVFX= Instantiate(onBeginDargVFX, PlayerStatusUIManager.Instance.playerUICanvas.transform);
GameObject beginDragVFX = Instantiate(onBeginDargVFX, PlayerStatusUIManager.Instance.playerUICanvas.transform);
beginDragVFX.transform.position = originParent.position;
}
}
public void OnDrag(PointerEventData eventData)
{
GameObject targetObj = eventData.pointerCurrentRaycast.gameObject;
if(targetObj != null && targetObj.CompareTag("WeaponDragPanel"))
if (targetObj != null && targetObj.CompareTag("WeaponDragPanel"))
{
//获取鼠标在相机中(世界中)的位置,转换为屏幕坐标;
screenPosition = Camera.main.WorldToScreenPoint(transform.position);
@ -840,7 +843,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
onDragVFX.SetActive(true);
}
}
public void OnEndDrag(PointerEventData eventData)
@ -853,18 +856,18 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
{
transform.SetParent(targetObj.transform);
transform.localPosition = Vector3.zero;
}
}
}
else if(targetObj != null && targetObj .name == "WeaponNode(Clone)")
else if (targetObj != null && targetObj.name == "WeaponNode(Clone)")
{
if(targetObj.transform .parent.parent.name != "BagPlayerWeaponPanel")//不在背包内才能调换
if (targetObj.transform.parent.parent.name != "BagPlayerWeaponPanel")//不在背包内才能调换
{
//子集有物体,这不是空位,需要置换
Transform targetFather = targetObj.transform.parent;
Transform targetChild = targetObj.transform;
WeaponNode targetNode = targetChild.transform.GetComponent<WeaponNode>();
targetChild.SetParent(originParent);
targetChild.localPosition = Vector3.zero;
targetChild.localPosition = Vector3.zero;
transform.SetParent(targetFather);
transform.localPosition = Vector3.zero;
//targetNode.ResetBool();
@ -873,17 +876,17 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
{
BackPosition();
}
}
}
else//其他位置归位
{
if(BagManager .Instance .labelButtonList[1].associatePage .activeInHierarchy ==false )
if (BagManager.Instance.labelButtonList[1].associatePage.activeInHierarchy == false)
{
BackPosition();
}
else
{
if(targetObj == null ||targetObj.name == "BagPlayerWeaponPanel")
if (targetObj == null || targetObj.name == "BagPlayerWeaponPanel")
{
BackPosition();
}
@ -912,11 +915,16 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
{
isIgnoreCondition = false;
isDoubleSettle = false;
WeaponManager.Instance.isWeaponNodeChange= true;
WeaponManager.Instance.isWeaponNodeChange = true;
}
public void OnPointerEnter(PointerEventData eventData)
{
resultDescription = Name.getGemResultDescription(result, resultValue);
conditionDescription = Name.getGemConditionDescription(condition, conditionValue, nodesMark, nodesColor);
resetConditionDes();
resetResultDes();
SetUpInforText();
isOn = true;
}
@ -935,7 +943,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
CardPictureManager.Instance.complete ||
(Time.time - waitStartTime > 15f)
);
if(resultDescription.Length != 0)
if (resultDescription.Length != 0)
{
inforTextGemImage.text = resultDescription;
}
@ -952,7 +960,7 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
Debug.Log("nodesColor是" + a);
}
gemImageIcon.sprite = CardManager.Instance.createGemImageByToolX(nodesMark, nodesColor);
}
public void SetUpInforText()
@ -1018,4 +1026,110 @@ public class WeaponNode : MonoBehaviour,IDragHandler, IBeginDragHandler, IEndDra
bagWeaponNode.isGemImage = condition.Equals(Name.WeaponNodeCondition.node);
}
}
public void resetConditionDes()
{
if (!Name.WeaponNodeCondition.PlayerConvertSet.Contains(condition))
{
return;
}
StringBuilder sb = new StringBuilder();
sb.Append(conditionDescription);
string num = "";
switch (condition)
{
case Name.WeaponNodeCondition.everyNumNodeConvert:
num = MapUnityManager.Instance.switchNodeNum.ToString();
break;
case Name.WeaponNodeCondition.everyRedNodeConvert:
num = MapUnityManager.Instance.switchRedNodeNum.ToString();
break;
case Name.WeaponNodeCondition.everyBlueNodeConvert:
num = MapUnityManager.Instance.switchBlueNodeNum.ToString();
break;
case Name.WeaponNodeCondition.everyYellowNodeConvert:
num = MapUnityManager.Instance.switchYellowNodeNum.ToString();
break;
case Name.WeaponNodeCondition.bombbomb:
num = settleCount.ToString();
break;
}
sb.Append("(");
sb.Append(num);
sb.Append(')');
conditionDescription=sb.ToString();
}
public void resetResultDes()
{
if (!(Name.WeaponNodeCondition.PlayerConvertSet.Contains(condition)||Name.WeaponNodeFunction.EveryResultSet.Contains(result)))
{
return;
}
StringBuilder sb = new StringBuilder();
sb.Append(resultDescription);
string num = "";
int settleCoefficient = 1;
if (settleCount != 0)
{
settleCoefficient=settleCount;
}
switch (result)
{
case Name.WeaponNodeFunction.everyRedNodeAddScore:
int redNodeCount = getNodeTools.getNodesCount(Name.Color.Red);
num = (settleCoefficient*redNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString();
break;
case Name.WeaponNodeFunction.everyYellowNodeAddScore:
int yellowNodeCount = getNodeTools.getNodesCount(Name.Color.Yellow);
num = (settleCoefficient * yellowNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString();
break;
case Name.WeaponNodeFunction.everyBlueNodeAddScore:
int blueNodeCount = getNodeTools.getNodesCount(Name.Color.Blue);
num = (settleCoefficient * blueNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString();
break;
case Name.WeaponNodeFunction.everyBlackNodeAddScore:
int blackNodeCount = getNodeTools.getNodesCount(Name.Color.Black);
num = (settleCoefficient * blackNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString();
break;
case Name.WeaponNodeFunction.everyHolyNodeAddScore:
int holyNodeCount = getNodeTools.getNodesCount(Name.Color.Holy);
num = (settleCoefficient * holyNodeCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString();
break;
case Name.WeaponNodeFunction.everyBombAddScore:
int bombCount = 0;
foreach (MapUnity nodeB in getNodeTools.getAllNodes())
{
if (nodeB.blockNode != null && nodeB.blockNode is Bomb)
{
bombCount++;
}
}
num = (bombCount * int.Parse(resultValue)).ToString();
break;
case Name.WeaponNodeFunction.everyBelieverAddScore:
int believerCount = 0;
foreach (MapUnity nodeC in getNodeTools.getAllNodes())
{
if (nodeC.blockNode != null && nodeC.blockNode is Believer)
{
believerCount++;
}
}
num = (believerCount / int.Parse(resultValue.Split("_")[0]) * int.Parse(resultValue.Split("_")[1])).ToString();
break;
case Name.WeaponNodeFunction.addScoreThisTurn:
num=turnScore.ToString();
break;
default:
num = (settleCount * int.Parse(resultValue)).ToString();
break;
}
sb.Append("(");
sb.Append(num);
sb.Append(')');
resultDescription = sb.ToString();
}
}

241
ColorlessWorld-2024-4-2/Assets/TextMesh Pro/Resources/Fonts & Materials/BackGroundLightSourceHanSansCN-Normal SDF.asset

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save