很多更新,服务端连接,新UI和系统
This commit is contained in:
@@ -133,7 +133,10 @@ public class teamUIController : MonoBehaviour
|
||||
public void RecordDamage(int slotIndex, float amount)
|
||||
{
|
||||
if (slotIndex >= 0 && slotIndex < 5)
|
||||
{
|
||||
totalDamageDealt[slotIndex] += amount;
|
||||
SkillBuilder.Instance?.NotifyAllyAttackDealt(slotIndex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -860,6 +863,7 @@ public class teamUIController : MonoBehaviour
|
||||
public ComboJudgeType comboJudgeType = ComboJudgeType.Perfect;
|
||||
|
||||
private int combo = 0;
|
||||
public int CurrentCombo => combo;
|
||||
|
||||
public enum ComboJudgeType
|
||||
{
|
||||
@@ -1458,6 +1462,70 @@ public class teamUIController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAllyObjectBySlot(int slotIndex, GameObject value)
|
||||
{
|
||||
switch (slotIndex)
|
||||
{
|
||||
case 0: ally01_object = value; break;
|
||||
case 1: ally02_object = value; break;
|
||||
case 2: ally03_object = value; break;
|
||||
case 3: ally04_object = value; break;
|
||||
case 4: ally05_object = value; break;
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshTeammateCharacterImageBySlotId(int slotIndex)
|
||||
{
|
||||
if (slotIndex < 0 || slotIndex >= allySlotIds.Count) return;
|
||||
int id = allySlotIds[slotIndex];
|
||||
if (id <= 0) return;
|
||||
|
||||
AllyHero_SO[] all = Resources.LoadAll<AllyHero_SO>("");
|
||||
for (int i = 0; i < all.Length; i++)
|
||||
{
|
||||
AllyHero_SO so = all[i];
|
||||
if (so == null || so.ally_heroID != id) continue;
|
||||
Sprite sprite = so.ally_heroProfile != null ? so.ally_heroProfile : so.ally_heroImage;
|
||||
if (sprite != null)
|
||||
{
|
||||
SetTeammateCharacterImage(slotIndex, sprite);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void SwapAllyWithLowerAdjacent(int slotIndex)
|
||||
{
|
||||
int lowerSlot = slotIndex + 1;
|
||||
if (slotIndex < 0 || lowerSlot > 4) return;
|
||||
|
||||
GameObject first = GetAllyObjectBySlot(slotIndex);
|
||||
GameObject second = GetAllyObjectBySlot(lowerSlot);
|
||||
int firstId = slotIndex < allySlotIds.Count ? allySlotIds[slotIndex] : 0;
|
||||
int secondId = lowerSlot < allySlotIds.Count ? allySlotIds[lowerSlot] : 0;
|
||||
|
||||
SetAllyObjectBySlot(slotIndex, second);
|
||||
SetAllyObjectBySlot(lowerSlot, first);
|
||||
|
||||
if (slotIndex < allySlotIds.Count) allySlotIds[slotIndex] = secondId;
|
||||
if (lowerSlot < allySlotIds.Count) allySlotIds[lowerSlot] = firstId;
|
||||
|
||||
if (second != null)
|
||||
{
|
||||
AllyCombatant secondAlly = second.GetComponent<AllyCombatant>();
|
||||
if (secondAlly != null) secondAlly.slotIndex = slotIndex;
|
||||
}
|
||||
|
||||
if (first != null)
|
||||
{
|
||||
AllyCombatant firstAlly = first.GetComponent<AllyCombatant>();
|
||||
if (firstAlly != null) firstAlly.slotIndex = lowerSlot;
|
||||
}
|
||||
|
||||
RefreshTeammateCharacterImageBySlotId(slotIndex);
|
||||
RefreshTeammateCharacterImageBySlotId(lowerSlot);
|
||||
}
|
||||
|
||||
// ------------------- Enemy spawn & UI sync helpers -------------------
|
||||
private void InitializeEnemyInstance()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user