This commit is contained in:
DESKTOP-SAJ6RKV\Administrator 2025-06-26 11:57:10 +08:00
parent 153c170409
commit fd06468aa4
3 changed files with 83 additions and 93 deletions

View File

@ -564,7 +564,7 @@ namespace GameLogic
eGoBoom.transform.DOLocalMoveX(0, 3f).OnComplete(async () => eGoBoom.transform.DOLocalMoveX(0, 3f).OnComplete(async () =>
{ {
// 特效播放完毕后销毁 // 特效播放完毕后销毁
GameObject.Destroy(eGo); GameObject.Destroy(eGoBoom);
}); });

View File

@ -21,6 +21,7 @@ namespace GameLogic
public List<ActorHItem> m_TeamSortList = new List<ActorHItem>(); // 用于排序的阵营列表数据 public List<ActorHItem> m_TeamSortList = new List<ActorHItem>(); // 用于排序的阵营列表数据
public Dictionary<string, ActorHItem> m_DicTeamList = new Dictionary<string, ActorHItem>(); public Dictionary<string, ActorHItem> m_DicTeamList = new Dictionary<string, ActorHItem>();
public List<(ActorHItem actor, double score)> hItemActors = new List<(ActorHItem, double)>();
public float m_GameTimerLen = 0; public float m_GameTimerLen = 0;
public List<string> m_Strs = new List<string>() { "陈", "王", "李", "张", "刘", "杨", "黄", "赵", "吴", "周", public List<string> m_Strs = new List<string>() { "陈", "王", "李", "张", "刘", "杨", "黄", "赵", "吴", "周",
@ -852,20 +853,26 @@ namespace GameLogic
actor.AddBuff(m_Buff, unitPlayerData, giftConfig); actor.AddBuff(m_Buff, unitPlayerData, giftConfig);
await UniTask.Delay(2000); //await UniTask.Delay(2000);
// 排序 //// 排序
DataGameSceneManager.Instance.m_TeamSortList.Sort((a, b) => //DataGameSceneManager.Instance.m_TeamSortList.Sort((a, b) =>
//{
// if (a.GetAllPower() > b.GetAllPower())
// {
// return -1;
// }
// else
// {
// return 1;
// }
//});
GameModule.Timer.AddTimer(async (e) =>
{ {
if (a.GetAllPower() > b.GetAllPower())
{
return -1;
}
else
{
return 1;
}
});
for (int i = 0; i < DataGameSceneManager.Instance.m_TeamSortList.Count; i++) for (int i = 0; i < DataGameSceneManager.Instance.m_TeamSortList.Count; i++)
{ {
@ -886,12 +893,12 @@ namespace GameLogic
// 生成手指特效 // 生成手指特效
if (DataGameSceneManager.Instance.m_TeamSortList[0] == actor) if (hItemActors[0].actor == actor)
{ {
// 自己是第一名,则给第二名生成一个特效 // 自己是第一名,则给第二名生成一个特效
// 添加减速Buff给到 // 添加减速Buff给到
var eGo = GameModule.Resource.LoadGameObject("JSZ"); var eGo = GameModule.Resource.LoadGameObject("JSZ");
eGo.transform.SetParent(DataGameSceneManager.Instance.m_TeamSortList[1].GetRect().transform); eGo.transform.SetParent(hItemActors[1].actor.GetRect().transform);
eGo.transform.localPosition = new Vector3(0, 0, 0); eGo.transform.localPosition = new Vector3(0, 0, 0);
eGo.transform.localScale = Vector3.one * 0.5f; eGo.transform.localScale = Vector3.one * 0.5f;
@ -904,7 +911,7 @@ namespace GameLogic
var JszSignal = GameModule.Resource.LoadAsset<SignalAsset>("JszSignal"); var JszSignal = GameModule.Resource.LoadAsset<SignalAsset>("JszSignal");
eGo.GetComponent<SignalReceiver>().GetReaction(JszSignal).AddListener(() => eGo.GetComponent<SignalReceiver>().GetReaction(JszSignal).AddListener(() =>
{ {
DataGameSceneManager.Instance.m_TeamSortList[1].SetCurrenFill(); hItemActors[1].actor.SetCurrenFill();
}); });
} }
else else
@ -912,7 +919,7 @@ namespace GameLogic
// 给第一名生成一个特效 // 给第一名生成一个特效
// 添加减速Buff给到 // 添加减速Buff给到
var eGo = GameModule.Resource.LoadGameObject("JSZ"); var eGo = GameModule.Resource.LoadGameObject("JSZ");
eGo.transform.SetParent(DataGameSceneManager.Instance.m_TeamSortList[0].GetRect().transform); eGo.transform.SetParent(hItemActors[0].actor.GetRect().transform);
eGo.transform.localPosition = new Vector3(0, 0, 0); eGo.transform.localPosition = new Vector3(0, 0, 0);
eGo.transform.localScale = Vector3.one * 0.5f; eGo.transform.localScale = Vector3.one * 0.5f;
@ -926,14 +933,11 @@ namespace GameLogic
var JszSignal = GameModule.Resource.LoadAsset<SignalAsset>("JszSignal"); var JszSignal = GameModule.Resource.LoadAsset<SignalAsset>("JszSignal");
eGo.GetComponent<SignalReceiver>().GetReaction(JszSignal).AddListener(() => eGo.GetComponent<SignalReceiver>().GetReaction(JszSignal).AddListener(() =>
{ {
DataGameSceneManager.Instance.m_TeamSortList[1].SetCurrenFill(); hItemActors[0].actor.SetCurrenFill();
}); });
} }
}, 2);
// 告知UI,创建全屏特效 // 告知UI,创建全屏特效
GameEvent.Send(EventConts.TtqEffectCreate, giftConfig); GameEvent.Send(EventConts.TtqEffectCreate, giftConfig);

View File

@ -10,6 +10,8 @@ using Coffee.UIExtensions;
using UnityEngine.Video; using UnityEngine.Video;
using System.Xml.Linq; using System.Xml.Linq;
using System; using System;
using DG.Tweening;
using UnityEngine.Timeline;
namespace GameLogic namespace GameLogic
{ {
@ -604,25 +606,6 @@ namespace GameLogic
private async void TtqEffectCreateFunc(GiftConfig giftConfig) private async void TtqEffectCreateFunc(GiftConfig giftConfig)
{ {
//// 判断场景是否存在这个资源
//if (m_TestEgo != null)
//{
// return;
//}
//else
//{
// var m_Ego = GameModule.Resource.LoadGameObject("TTQ01");
// m_TestEgo = m_Ego;
// m_Ego.transform.SetParent(this.transform);
// m_Ego.transform.localPosition = Vector3.zero;
// m_Ego.transform.localScale = Vector3.one;
// // 设置时间消失
// await UniTask.Delay(giftConfig.TimerLen * 1000);
// GameObject.Destroy(m_Ego);
// m_TestEgo = null;
//}
} }
private async void AddGiftMessageFunc(UnitPlayerData unitPlayerData, GiftConfig giftConfig, int num) private async void AddGiftMessageFunc(UnitPlayerData unitPlayerData, GiftConfig giftConfig, int num)
@ -704,6 +687,7 @@ namespace GameLogic
{ {
// Create a list to hold the HItemActors and their scores // Create a list to hold the HItemActors and their scores
List<(ActorHItem actor, double score)> hItemActors = new List<(ActorHItem, double)>(); List<(ActorHItem actor, double score)> hItemActors = new List<(ActorHItem, double)>();
//hItemActors.Clear();
// Populate the list with HItemActors and their scores // Populate the list with HItemActors and their scores
for (int i = 0; i < m_rectHPanel.childCount; i++) for (int i = 0; i < m_rectHPanel.childCount; i++)
@ -732,6 +716,8 @@ namespace GameLogic
rectTransform.SetSiblingIndex(i); rectTransform.SetSiblingIndex(i);
} }
DataGameSceneManager.Instance.hItemActors = hItemActors; // 更新全局变量
} }
} }