|
|
|
@ -47,20 +47,22 @@ public class GameManager : Singleton<GameManager> |
|
|
|
[Header("场地颜色分度盘")] |
|
|
|
public Image Red; |
|
|
|
public Image Green; |
|
|
|
public Image Yellow; |
|
|
|
public Image Bule; |
|
|
|
public Image Black; |
|
|
|
public Image White; |
|
|
|
public Image Metal; |
|
|
|
[Header("场地颜色分度盘文字")] |
|
|
|
public Text redText; |
|
|
|
public Text greenText; |
|
|
|
public Text blueText; |
|
|
|
public Text blackText; |
|
|
|
public Text whiteText; |
|
|
|
public Text metalText; |
|
|
|
public Text sumPlayerText; |
|
|
|
public Text sumMiddleText; |
|
|
|
public Text sumRightText; |
|
|
|
public TMP_Text redText; |
|
|
|
public TMP_Text greenText; |
|
|
|
public TMP_Text yellowText; |
|
|
|
public TMP_Text blueText; |
|
|
|
public TMP_Text blackText; |
|
|
|
public TMP_Text whiteText; |
|
|
|
public TMP_Text metalText; |
|
|
|
// public TMP_Text sumPlayerText;
|
|
|
|
// public TMP_Text sumMiddleText;
|
|
|
|
// public TMP_Text sumRightText;
|
|
|
|
[Header("场地颜色优势框")] |
|
|
|
public Image sunImage; |
|
|
|
public RectTransform barBox;//总框体大小
|
|
|
|
@ -76,19 +78,21 @@ public class GameManager : Singleton<GameManager> |
|
|
|
float redNodeCountLatest; |
|
|
|
float blueNodeCountLatest; |
|
|
|
float greenNodeCountLatest; |
|
|
|
float yellowNodeCountLatest; |
|
|
|
float whiteNodeCountLatest; |
|
|
|
float metalNodeCountLatest; |
|
|
|
float blackNodeCountLatest; |
|
|
|
[Header("场地颜色分度盘文字预览")] |
|
|
|
public Text redTextPre; |
|
|
|
public Text greenTextPre; |
|
|
|
public Text blueTextPre; |
|
|
|
public Text blackTextPre; |
|
|
|
public Text whiteTextPre; |
|
|
|
public Text metalTextPre; |
|
|
|
public Text sumPlayerTextPre; |
|
|
|
public Text sumMiddleTextPre; |
|
|
|
public Text sumRightTextPre; |
|
|
|
public TMP_Text redTextPre; |
|
|
|
public TMP_Text greenTextPre; |
|
|
|
public TMP_Text yellowTextPre; |
|
|
|
public TMP_Text blueTextPre; |
|
|
|
public TMP_Text blackTextPre; |
|
|
|
public TMP_Text whiteTextPre; |
|
|
|
public TMP_Text metalTextPre; |
|
|
|
//public TMP_Text sumPlayerTextPre;
|
|
|
|
// public TMP_Text sumMiddleTextPre;
|
|
|
|
// public TMP_Text sumRightTextPre;
|
|
|
|
[Header("太阳动画")] |
|
|
|
public Animator sunAnim; |
|
|
|
|
|
|
|
@ -258,6 +262,7 @@ public class GameManager : Singleton<GameManager> |
|
|
|
float redNodeCount = MapUnityManager.Instance.redNodeCount; |
|
|
|
float blueNodeCount = MapUnityManager.Instance.blueNodeCount; |
|
|
|
float greenNodeCount = MapUnityManager.Instance.greenNodeCount; |
|
|
|
float yellowNodeCount = MapUnityManager.Instance.yellowNodeCount; |
|
|
|
float whiteNodeCount = MapUnityManager.Instance.whiteNodeCount; |
|
|
|
float blackNodeCount = MapUnityManager.Instance.blackNodeCount; |
|
|
|
float metalNodeCount = MapUnityManager.Instance.metalNodeCount; |
|
|
|
@ -265,6 +270,7 @@ public class GameManager : Singleton<GameManager> |
|
|
|
redNodeCountLatest = Mathf.Lerp(redNodeCountLatest, redNodeCount, Time.deltaTime * sunSpeed); |
|
|
|
blueNodeCountLatest = Mathf.Lerp(blueNodeCountLatest, blueNodeCount, Time.deltaTime * sunSpeed); |
|
|
|
greenNodeCountLatest = Mathf.Lerp(greenNodeCountLatest, greenNodeCount, Time.deltaTime * sunSpeed); |
|
|
|
yellowNodeCountLatest = Mathf.Lerp(yellowNodeCountLatest, yellowNodeCount, Time.deltaTime * sunSpeed); |
|
|
|
// float currentWhiteNodeCount = Mathf.Lerp(whiteNodeCountLatest, whiteNodeCount, Time.deltaTime * sunSpeed);
|
|
|
|
whiteNodeCountLatest = Mathf.Lerp(whiteNodeCountLatest, whiteNodeCount, Time.deltaTime * sunSpeed); |
|
|
|
metalNodeCountLatest = Mathf.Lerp(metalNodeCountLatest, metalNodeCount, Time.deltaTime * sunSpeed); |
|
|
|
@ -276,6 +282,9 @@ public class GameManager : Singleton<GameManager> |
|
|
|
greenText.text = greenNodeCount.ToString(); |
|
|
|
if (greenNodeCount == 0) |
|
|
|
greenText.text = " "; |
|
|
|
yellowText .text = yellowNodeCount.ToString(); |
|
|
|
if(yellowNodeCount == 0) |
|
|
|
yellowText .text = " "; |
|
|
|
blueText.text = blueNodeCount.ToString(); |
|
|
|
if (blueNodeCount == 0) |
|
|
|
blueText.text = " "; |
|
|
|
@ -288,27 +297,29 @@ public class GameManager : Singleton<GameManager> |
|
|
|
metalText.text = metalNodeCount.ToString(); |
|
|
|
if (metalNodeCount == 0) |
|
|
|
metalText.text = " "; |
|
|
|
sumPlayerText.text = (redNodeCount + blueNodeCount + greenNodeCount).ToString(); |
|
|
|
sumMiddleText.text = (whiteNodeCount+metalNodeCount ).ToString(); |
|
|
|
sumRightText.text = blackNodeCount.ToString(); |
|
|
|
float totoalNode = redNodeCount + blueNodeCount + greenNodeCount + whiteNodeCount + blackNodeCount; |
|
|
|
// sumPlayerText.text = (redNodeCount + blueNodeCount + greenNodeCount).ToString();
|
|
|
|
// sumMiddleText.text = (whiteNodeCount+metalNodeCount ).ToString();
|
|
|
|
// sumRightText.text = blackNodeCount.ToString();
|
|
|
|
float totoalNode = redNodeCount + blueNodeCount + greenNodeCount + yellowNodeCount + 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); |
|
|
|
metalText.transform.localPosition = new Vector3(length * 0.5f * (Metal.fillAmount + Bule.fillAmount - 1), 0, 0); |
|
|
|
yellowText.transform.localPosition = new Vector3(length * 0.5f * (Yellow.fillAmount + Bule.fillAmount - 1), 0, 0); |
|
|
|
metalText.transform.localPosition = new Vector3(length * 0.5f * (Metal.fillAmount + Yellow.fillAmount - 1), 0, 0); |
|
|
|
whiteText.transform.localPosition = new Vector3(length * 0.5f * (White.fillAmount + Metal.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+ metalText.transform.localPosition.x)*0.5f, 150, 0); |
|
|
|
sumRightText.transform.localPosition = new Vector3(blackText.transform.localPosition.x, 150, 0); |
|
|
|
//sumPlayerText.transform.localPosition = new Vector3(length * (Bule.fillAmount - 1) * 0.5f, 150, 0);
|
|
|
|
// sumMiddleText.transform.localPosition = new Vector3((whiteText.transform.localPosition.x+ metalText.transform.localPosition.x)*0.5f, 150, 0);
|
|
|
|
// sumRightText.transform.localPosition = new Vector3(blackText.transform.localPosition.x, 150, 0);
|
|
|
|
//颜色
|
|
|
|
Red.fillAmount = redNodeCountLatest / totoalNode; |
|
|
|
Green.fillAmount = Red.fillAmount + greenNodeCountLatest / totoalNode; |
|
|
|
Bule.fillAmount = Green.fillAmount + blueNodeCountLatest / totoalNode; |
|
|
|
Metal.fillAmount= Bule.fillAmount+ metalNodeCountLatest / totoalNode; |
|
|
|
Yellow .fillAmount = Bule .fillAmount + yellowNodeCountLatest / totoalNode; |
|
|
|
Metal.fillAmount= Yellow.fillAmount+ metalNodeCountLatest / totoalNode; |
|
|
|
White.fillAmount = Metal.fillAmount + whiteNodeCountLatest / totoalNode; |
|
|
|
// Black.fillAmount = Bule.fillAmount + blackNodeCountLatest / totoalNode;
|
|
|
|
//预览涂色
|
|
|
|
@ -317,7 +328,7 @@ public class GameManager : Singleton<GameManager> |
|
|
|
{ |
|
|
|
if(currentCardEntity.cardOriginalData.CastingRange != 0) |
|
|
|
{ |
|
|
|
if( currentMapNode != null && currentMapNode.effectInfluenced == true) |
|
|
|
if( currentMapNode != null && currentMapNode.castRangeInf == true) |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
@ -420,10 +431,25 @@ public class GameManager : Singleton<GameManager> |
|
|
|
} |
|
|
|
metalTextPre.transform.localPosition = new Vector3(metalText.transform.localPosition.x,metalText.transform.localPosition.y - 75f, 0); |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
yellowNodeCountLatest = yellowNodeCount + ints[i]; |
|
|
|
yellowText .text = (yellowNodeCount + ints[i]).ToString(); |
|
|
|
yellowTextPre.gameObject.SetActive(true); |
|
|
|
if (ints[i] > 0) |
|
|
|
{ |
|
|
|
yellowTextPre.text = "(" + "+" + ints[i].ToString() + ")"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
yellowTextPre.text = "(" + ints[i].ToString() + ")"; |
|
|
|
} |
|
|
|
|
|
|
|
yellowTextPre.transform.localPosition = new Vector3(yellowText.transform.localPosition.x,yellowText.transform.localPosition.y - 75f, 0); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
sumPlayerText.text = (redNodeCount + blueNodeCount + greenNodeCount + ints[1] + ints[3] + ints[4]).ToString(); |
|
|
|
/* sumPlayerText.text = (redNodeCount + blueNodeCount + greenNodeCount + ints[1] + ints[3] + ints[4]).ToString(); |
|
|
|
sumPlayerTextPre .gameObject .SetActive(true); |
|
|
|
sumPlayerTextPre.transform.localPosition = new Vector3(sumPlayerText.transform.localPosition.x + 150f, sumPlayerText.transform.localPosition.y , 0); |
|
|
|
if (ints[1] + ints[3] + ints[4]>0) |
|
|
|
@ -455,7 +481,7 @@ public class GameManager : Singleton<GameManager> |
|
|
|
else |
|
|
|
{ |
|
|
|
sumRightTextPre.text = "(" + ints[5].ToString() + ")"; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
@ -463,15 +489,16 @@ public class GameManager : Singleton<GameManager> |
|
|
|
whiteTextPre.gameObject.SetActive(false); |
|
|
|
blueTextPre.gameObject.SetActive(false); |
|
|
|
greenTextPre.gameObject.SetActive(false); |
|
|
|
yellowTextPre .gameObject.SetActive(false); |
|
|
|
blackTextPre.gameObject.SetActive(false); |
|
|
|
metalTextPre.gameObject.SetActive(false); |
|
|
|
sumPlayerTextPre.gameObject .SetActive(false); |
|
|
|
sumMiddleTextPre.gameObject.SetActive(false); |
|
|
|
sumRightTextPre.gameObject.SetActive(false); |
|
|
|
// sumPlayerTextPre.gameObject .SetActive(false);
|
|
|
|
// sumMiddleTextPre.gameObject.SetActive(false);
|
|
|
|
// sumRightTextPre.gameObject.SetActive(false);
|
|
|
|
} |
|
|
|
|
|
|
|
//太阳
|
|
|
|
string advColor = MapUnityManager.Instance.getAdvNode(); |
|
|
|
/* string advColor = MapUnityManager.Instance.getAdvNode(); |
|
|
|
if(lastSunColor != advColor ) |
|
|
|
{ |
|
|
|
sunAnim.SetTrigger("Change"); |
|
|
|
@ -503,7 +530,7 @@ public class GameManager : Singleton<GameManager> |
|
|
|
sunImage.color = Color.gray; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} */ |
|
|
|
|
|
|
|
} |
|
|
|
//统计场地颜色
|
|
|
|
|