超大量的更新 修复很多问题,gameplay特效初步
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class loadSettlementTeamPrefab : MonoBehaviour
|
||||
{
|
||||
[Header("��Ҫ����")]
|
||||
[Header("Inspector")]
|
||||
public ScoreManager sm;
|
||||
public teamUIController tuic;
|
||||
public GameManager gm;
|
||||
[Header("����")]
|
||||
[Header("Inspector")]
|
||||
public GameObject settleTeamCardsPrefab;
|
||||
public GameObject objectToPutdown;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class loadSettlementTeamPrefab : MonoBehaviour
|
||||
if (tuic == null && teamUIController.Instance != null)
|
||||
tuic = teamUIController.Instance;
|
||||
|
||||
// 修复:确保 sm 被正确赋值
|
||||
// Documentation text normalized.
|
||||
if (sm == null && ScoreManager.Instance != null)
|
||||
sm = ScoreManager.Instance;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class loadSettlementTeamPrefab : MonoBehaviour
|
||||
bool parentSceneValid = objectToPutdown != null && objectToPutdown.scene.IsValid();
|
||||
Debug.Log($"[loadSettlementTeamPrefab] Target parent: {objectToPutdown.name}, activeInHierarchy: {objectToPutdown.activeInHierarchy}, sceneValid: {parentSceneValid}");
|
||||
|
||||
// 诊断:记录 ScoreManager 的状态
|
||||
// Documentation text normalized.
|
||||
if (sm != null)
|
||||
{
|
||||
Debug.Log($"[loadSettlementTeamPrefab] ScoreManager found. Idol sums: R{sm.red_idolScore_sum} G{sm.green_idolScore_sum} Y{sm.yellow_idolScore_sum} P{sm.purple_idolScore_sum} B{sm.blue_idolScore_sum}");
|
||||
@@ -177,7 +177,7 @@ public class loadSettlementTeamPrefab : MonoBehaviour
|
||||
float fill = ac.maxHP > 0 ? (float)ac.currentHP / ac.maxHP : 0f;
|
||||
card.ally_healthBar.fillAmount = Mathf.Clamp01(fill);
|
||||
|
||||
// 新增:如果角色血量为0(死了),给 ally_profile 赋予灰色材质
|
||||
// Documentation text normalized.
|
||||
if (ac.currentHP <= 0 && card.ally_profile != null && card.grayM != null)
|
||||
{
|
||||
card.ally_profile.material = card.grayM;
|
||||
@@ -187,12 +187,12 @@ public class loadSettlementTeamPrefab : MonoBehaviour
|
||||
}
|
||||
|
||||
// this_allyIdolScore: map index to ScoreManager fields if available
|
||||
// 修复:确保从正确的 ScoreManager 实例读取数据
|
||||
// Documentation text normalized.
|
||||
if (card.this_allyIdolScore != null)
|
||||
{
|
||||
int idol = 0;
|
||||
|
||||
// 优先使用已赋值的 sm,否则从 ScoreManager.Instance 获取
|
||||
// Documentation text normalized.
|
||||
var scoreManager = sm != null ? sm : ScoreManager.Instance;
|
||||
|
||||
if (scoreManager != null)
|
||||
@@ -236,11 +236,11 @@ public class loadSettlementTeamPrefab : MonoBehaviour
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 格式化角色名字为"称号 名字"的形式
|
||||
/// Documentation text normalized.
|
||||
/// </summary>
|
||||
/// <param name="designation">称号</param>
|
||||
/// <param name="name">名字</param>
|
||||
/// <returns>格式化后的名字</returns>
|
||||
/// Documentation text normalized.
|
||||
/// Documentation text normalized.
|
||||
/// Documentation text normalized.
|
||||
private string FormatAllyName(string designation, string name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(designation))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class settleTeamPrefab : MonoBehaviour
|
||||
@@ -11,24 +11,24 @@ public class settleTeamPrefab : MonoBehaviour
|
||||
[Header("this_Ally_settlement")]
|
||||
public Text thisAlly_earnExp;
|
||||
public Text this_allyIdolScore;
|
||||
[Header("本场贡献")]
|
||||
[Header("Inspector")]
|
||||
public Text this_allyDamageDealt;
|
||||
public Text this_allyDamageTook;
|
||||
public Text this_allyHealthRestored;
|
||||
public Text this_allyManaRestored;
|
||||
[Header("展示详细贡献按钮")]
|
||||
[Header("Inspector")]
|
||||
public Button displayDetailContributionButton;
|
||||
public GameObject detailContributionGO;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// 初始化:详细贡献面板默认不激活
|
||||
// Documentation text normalized.
|
||||
if (detailContributionGO != null)
|
||||
{
|
||||
detailContributionGO.SetActive(false);
|
||||
}
|
||||
|
||||
// 为按钮添加点击监听
|
||||
// Documentation text normalized.
|
||||
if (displayDetailContributionButton != null)
|
||||
{
|
||||
displayDetailContributionButton.onClick.AddListener(OnDisplayDetailContributionButtonClicked);
|
||||
@@ -37,7 +37,7 @@ public class settleTeamPrefab : MonoBehaviour
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
// 移除监听以避免内存泄漏
|
||||
// Documentation text normalized.
|
||||
if (displayDetailContributionButton != null)
|
||||
{
|
||||
displayDetailContributionButton.onClick.RemoveListener(OnDisplayDetailContributionButtonClicked);
|
||||
@@ -52,7 +52,7 @@ public class settleTeamPrefab : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
// 切换详细贡献面板的激活状态
|
||||
// Documentation text normalized.
|
||||
bool isCurrentlyActive = detailContributionGO.activeSelf;
|
||||
detailContributionGO.SetActive(!isCurrentlyActive);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user