改动与优化

This commit is contained in:
FloatGaming
2026-07-20 22:19:25 +08:00
parent 0a0872c4f4
commit b5d1cdcbc5
83 changed files with 2475 additions and 276 deletions
+24
View File
@@ -0,0 +1,24 @@
<linker>
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
</assembly>
<assembly fullname="Unity.Localization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Localization.Locale" preserve="all" />
<type fullname="UnityEngine.Localization.Tables.SharedTableData" preserve="all" />
<type fullname="UnityEngine.Localization.Tables.StringTable" preserve="all" />
<type fullname="UnityEngine.Localization.LocaleIdentifier" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Localization.Metadata.MetadataCollection" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Localization.Tables.TableEntryData" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Localization.Tables.DistributedUIDGenerator" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.Localization.Tables.SharedTableData/SharedTableEntry" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Object" preserve="all" />
</assembly>
</linker>
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 06c4284984209ae4184b0b412cfd93d1
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -17,6 +17,7 @@ MonoBehaviour:
ally_heroID: 30201
isUnlocked: 1
allyType: 0
allyRolePosition: 4
obsessionTag: "\u9898\u6D77\u6218\u672F"
sourceDlcId:
ally_heroImage: {fileID: 21300000, guid: dc3bf41a4deb1f9449f007ff7535e138, type: 3}
@@ -17,6 +17,7 @@ MonoBehaviour:
ally_heroID: 30202
isUnlocked: 1
allyType: 0
allyRolePosition: 4
obsessionTag: "\u9038\u4E50\u5171\u8C0B"
sourceDlcId:
ally_heroImage: {fileID: 21300000, guid: 2658d847700da0541942ef5fdcc378b5, type: 3}
@@ -17,6 +17,7 @@ MonoBehaviour:
ally_heroID: 30203
isUnlocked: 1
allyType: 0
allyRolePosition: 4
obsessionTag: "\u4F17\u5FD7\u6210\u57CE"
sourceDlcId:
ally_heroImage: {fileID: 21300000, guid: 440e0141c6eb0144c9e9162f0f278d6b, type: 3}
@@ -17,6 +17,7 @@ MonoBehaviour:
ally_heroID: 30204
isUnlocked: 1
allyType: 0
allyRolePosition: 4
obsessionTag: "\u8FC7\u6FC0\u884C\u4E3A"
sourceDlcId:
ally_heroImage: {fileID: 21300000, guid: 7df561841c29f7c4495809fa26c0fd87, type: 3}
@@ -250,6 +251,6 @@ MonoBehaviour:
skillDescriptionsText: "\u3010\u4F60\u4EEC\u5747\u662F\u201C\u5E2E\u51F6\u201D\u3011\u6D88\u8017\u5168\u90E8\u6CD5\u529B\u503C\u65F6\uFF0C\u81EA\u8EAB\u83B7\u5F97\u201C\u4F24\u5BB3\u6297\u6027\u63D0\u5347\u201D\uFF0C\u63D0\u9AD80.14\uFF0C\u6301\u7EED6\u79D2\uFF1B\u81EA\u8EAB\u83B7\u5F97\u201C\u90FD\u7ED9\u4F60\uFF01\u201D\u3002\n\n\u201C\u4F24\u5BB3\u6297\u6027\u63D0\u5347\u201D\uFF1A\u4F24\u5BB3\u6297\u6027\u63D0\u9AD8\uFF0C\u751F\u6548\u671F\u95F4\u53D7\u5230\u7684\u4F24\u5BB3\u964D\u4F4E\u3002\n\u201C\u90FD\u7ED9\u4F60\uFF01\u201D\uFF1A\u5C06\u81EA\u8EAB\u4E0B\u4E00\u6B21\u53D7\u5230\u7684\u4F24\u5BB3\u6216\u83B7\u5F97\u7684\u589E\u76CA\u8F6C\u79FB\u7ED9\u76F8\u90BB\u5076\u50CF\u3002"
thisSkill_levelLimit: 4
isSpecialSkill: 0
equippedSkillGroupIDs:
equippedSkillGroupIDs: 61e0cc01
equippedEquipment: {fileID: 0}
equippedEquipmentId:
@@ -17,6 +17,7 @@ MonoBehaviour:
ally_heroID: 30205
isUnlocked: 1
allyType: 0
allyRolePosition: 4
obsessionTag: "\u9898\u6D77\u6218\u672F"
sourceDlcId:
ally_heroImage: {fileID: 21300000, guid: 1482ec2642664674f9ec31a7cb9fec90, type: 3}
@@ -17,6 +17,7 @@ MonoBehaviour:
ally_heroID: 30206
isUnlocked: 1
allyType: 0
allyRolePosition: 4
obsessionTag: "\u9898\u6D77\u6218\u672F"
sourceDlcId:
ally_heroImage: {fileID: 21300000, guid: c8f373c5ea610a345a513f33ba768314, type: 3}
+2 -2
View File
@@ -15187,7 +15187,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1660950642606675524, guid: 2f8645fff0a5d034884405a8e5af53db, type: 3}
propertyPath: m_SizeDelta.y
value: 0
value: 75.49936
objectReference: {fileID: 0}
- target: {fileID: 1660950642606675524, guid: 2f8645fff0a5d034884405a8e5af53db, type: 3}
propertyPath: m_AnchoredPosition.x
@@ -15267,7 +15267,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3823789093604703733, guid: 2f8645fff0a5d034884405a8e5af53db, type: 3}
propertyPath: m_PreferredHeight
value: 0
value: 75.49936
objectReference: {fileID: 0}
- target: {fileID: 3851926642032356421, guid: 2f8645fff0a5d034884405a8e5af53db, type: 3}
propertyPath: m_AnchorMax.y
+8 -6
View File
@@ -3167,7 +3167,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2613971938742376913, guid: 83349f645e9e9764ab6c8c66e5b107a3, type: 3}
propertyPath: m_AnchoredPosition.y
value: -812.5
value: -462.5
objectReference: {fileID: 0}
- target: {fileID: 2613971938742376913, guid: 83349f645e9e9764ab6c8c66e5b107a3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@@ -11511,7 +11511,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2613971938742376913, guid: 83349f645e9e9764ab6c8c66e5b107a3, type: 3}
propertyPath: m_AnchoredPosition.y
value: -447.5
value: -272.5
objectReference: {fileID: 0}
- target: {fileID: 2613971938742376913, guid: 83349f645e9e9764ab6c8c66e5b107a3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@@ -25414,7 +25414,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2613971938742376913, guid: 83349f645e9e9764ab6c8c66e5b107a3, type: 3}
propertyPath: m_AnchoredPosition.y
value: -1542.5
value: -842.5
objectReference: {fileID: 0}
- target: {fileID: 2613971938742376913, guid: 83349f645e9e9764ab6c8c66e5b107a3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@@ -33189,7 +33189,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 920, y: 114.999725}
m_AnchoredPosition: {x: 970, y: 160}
m_SizeDelta: {x: 100, y: 0}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &754636335
@@ -33233,7 +33233,7 @@ MonoBehaviour:
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 2
m_Spacing: 200
m_Spacing: 25
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
@@ -38759,6 +38759,8 @@ MonoBehaviour:
introMoveDuration: 0.42
introNumberDuration: 0.48
introStepGap: 0.06
introStaticElementDuration: 0.22
introBarFillDuration: 0.36
introMvpEnterYOffset: 120
introMvpEnterDuration: 0.42
introMvpEnterEase: 9
@@ -54584,7 +54586,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2613971938742376913, guid: 83349f645e9e9764ab6c8c66e5b107a3, type: 3}
propertyPath: m_AnchoredPosition.y
value: -1177.5
value: -652.5
objectReference: {fileID: 0}
- target: {fileID: 2613971938742376913, guid: 83349f645e9e9764ab6c8c66e5b107a3, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@@ -204,6 +204,7 @@ public class notebookController : MonoBehaviour
comp.SetFatherImage(so.class_image);
if (comp.father_description != null) comp.father_description.text = so.class_description;
SetupFatherItem(comp, so, fatherGroup);
UI_OrderedEntryAnimator.PlaySingle(obj, i, 0.18f, 0.012f, -14f, 0.97f, true);
if (firstFatherToggle == null)
{
firstFatherToggle = ResolveFatherToggle(comp);
@@ -302,6 +303,7 @@ public class notebookController : MonoBehaviour
if (son == null) continue;
if (!son.son_isUnlocked) continue;
var obj = Instantiate(prefab, parent);
UI_OrderedEntryAnimator.PlaySingle(obj, i, 0.16f, 0.018f, -10f, 0.97f, true);
var sonComp = obj.GetComponent<sonItemPrefab>();
Toggle sonToggle = null;
if (sonComp != null && sonComp.sonToggle != null) sonToggle = sonComp.sonToggle;
@@ -396,6 +398,7 @@ public class notebookController : MonoBehaviour
}
if (passage_title != null) passage_title.text = son.son_title;
if (passage_text != null) passage_text.text = son.son_passage;
PlayDetailsRefresh();
}
private void InvokeToggleAction(Toggle toggle, System.Action onSelected)
@@ -823,4 +826,13 @@ public class notebookController : MonoBehaviour
ApplySonDetails(father, son);
}
private void PlayDetailsRefresh()
{
GameObject target = null;
if (detailsImage != null) target = detailsImage.gameObject;
if (target == null && passage_title != null) target = passage_title.gameObject;
if (target == null && passage_text != null) target = passage_text.gameObject;
UI_OrderedEntryAnimator.PlayRefresh(target, 0.16f, -8f, 0.99f, true);
}
}
@@ -97,7 +97,7 @@ public class RatioBar : MonoBehaviour
{
if (heroSO == null) return;
var levelInfo = heroSO.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(heroSO);
if (levelInfo == null) return;
// Documentation text normalized.
@@ -55,7 +55,7 @@ public class character_detailInformation : MonoBehaviour
designation_name_combination.text = $"{heroSO.ally_heroDesignation} {heroSO.ally_heroName}";
}
var levelInfo = heroSO.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(heroSO);
if (levelInfo != null)
{
int attack = levelInfo.attack;
@@ -43,7 +43,7 @@ public class levelBar_controller : MonoBehaviour
{
if (heroSO == null || heroSO.levelStats == null || heroSO.levelStats.Count == 0) return;
var levelInfo = heroSO.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(heroSO);
if (levelInfo == null) return;
string currentLevel = GetRatingFromSO(heroSO);
@@ -71,7 +71,7 @@ public class levelBar_controller : MonoBehaviour
}
}
int currentEXP = heroSO.ally_currentEXP;
int currentEXP = AllyHeroLevelRuntimeResolver.GetCurrentExp(heroSO);
// Documentation text normalized.
for (int i = 0; i < 4; i++)
@@ -198,15 +198,6 @@ public class levelBar_controller : MonoBehaviour
return "C";
}
if (so.ally_heroID <= 0)
{
return so.GetDisplayLevelRatingKey();
}
AllyHeroDeployLedger ledger = AllyHeroDeployLedger.EnsureInstance();
int currentExp = ledger.GetCurrentExp(so.ally_heroID);
int unlockedTier = ledger.GetUnlockedTierIndex(so.ally_heroID);
bool levelLocked = ledger.IsLevelLockEnabled(so.ally_heroID);
return so.GetDisplayLevelRatingKeyFromGrowth(currentExp, unlockedTier, levelLocked);
return AllyHeroLevelRuntimeResolver.GetDisplayRatingKey(so);
}
}
@@ -149,10 +149,13 @@ public class loadSkillsSelect : MonoBehaviour
: $"Column {columnId}";
Transform skillsContainer = BuildColumnContainer(columnId, columnName);
int cardAnimIndex = 0;
foreach (SkillGroup group in columnGroups)
{
GameObject card = Instantiate(skillCardPrefab, skillsContainer);
UI_OrderedEntryAnimator.PlayFadeOnly(card, cardAnimIndex, 0.16f, 0.012f, true);
cardAnimIndex++;
slots_skillSlots slot = card.GetComponent<slots_skillSlots>();
if (slot == null)
@@ -292,6 +295,7 @@ public class loadSkillsSelect : MonoBehaviour
if (columnHeaderPrefab != null)
{
GameObject header = Instantiate(columnHeaderPrefab, columnContainer.transform);
UI_OrderedEntryAnimator.PlayFadeOnly(header, 0, 0.14f, 0f, true);
ApplyColumnHeaderText(header, columnName);
}
@@ -457,7 +461,7 @@ public class loadSkillsSelect : MonoBehaviour
return false;
}
int currentLevelId = hero.GetEffectiveLevelForCurrentEXP()?.levelID ?? 0;
int currentLevelId = AllyHeroLevelRuntimeResolver.GetCurrentLevelId(hero);
int requiredLevelId = Mathf.Clamp(group.thisSkill_levelLimit, 1, 4);
return currentLevelId >= requiredLevelId;
}
@@ -124,6 +124,7 @@ public class loadTeam_select : MonoBehaviour
if (!so.isUnlocked) continue;
var go = Instantiate(roleCardPrefab, contentParent);
go.transform.SetParent(contentParent, false);
UI_OrderedEntryAnimator.PlayFadeOnly(go, i, 0.16f, 0.012f, true);
var ctrl = go.GetComponent<roleCard_prefabController>();
if (ctrl == null)
{
@@ -106,7 +106,7 @@ public class load_skill_detail_prefab_inHeroDetailPrefab : MonoBehaviour
}
var equippedIds = (found.equippedSkillGroupIDs ?? new int[0]).Where(id => id != 0).ToList();
var levelInfo = found.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(found);
int currentMaxSlots = levelInfo?.skill_slot_limited ?? 0;
int maxSlotsOverall = 0;
@@ -129,6 +129,7 @@ public class load_skill_detail_prefab_inHeroDetailPrefab : MonoBehaviour
}
var go = Instantiate(skillDetailPrefab, contentParent);
UI_OrderedEntryAnimator.PlayFadeOnly(go, created, 0.16f, 0.012f, true);
var detail = go.GetComponent<skill_detail_prefab_inHeroDetail>();
if (detail == null)
{
@@ -157,6 +158,7 @@ public class load_skill_detail_prefab_inHeroDetailPrefab : MonoBehaviour
}
var emptyGo = Instantiate(skillDetailPrefab, contentParent);
UI_OrderedEntryAnimator.PlayFadeOnly(emptyGo, created, 0.16f, 0.012f, true);
var detailEmpty = emptyGo.GetComponent<skill_detail_prefab_inHeroDetail>();
if (detailEmpty == null)
{
@@ -465,7 +465,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
}
// Documentation text normalized.
var levelInfo = found.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(found);
if (levelInfo != null && heroLevelImage != null)
{
string level = GetRatingFromSO(found);
@@ -677,7 +677,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
var hero = FindHeroById(id);
if (hero != null)
{
var levelInfo = hero.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(hero);
if (levelInfo != null && heroLevelImage != null)
{
string level = GetRatingFromSO(hero);
@@ -731,6 +731,7 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
}
// Instantiate skill cards for equipped groups
int skillAnimIndex = 0;
foreach (int groupId in hero.equippedSkillGroupIDs)
{
if (groupId == 0) continue; // Skip empty
@@ -739,6 +740,8 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
if (group == null) continue;
GameObject skillGo = Instantiate(skillCardPrefab, skillContainer.transform);
UI_OrderedEntryAnimator.PlayFadeOnly(skillGo, skillAnimIndex, 0.14f, 0.01f, true);
skillAnimIndex++;
slots_skillSlots skillSlot = skillGo.GetComponent<slots_skillSlots>();
if (skillSlot != null)
{
@@ -874,10 +877,17 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
rt.DOKill();
cg.DOKill();
Vector2 basePos = rt.anchoredPosition;
rt.anchoredPosition = basePos + new Vector2(0f, -changeMoveOffset);
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(rt);
if (canMove)
{
rt.anchoredPosition = basePos + new Vector2(0f, -changeMoveOffset);
}
cg.alpha = 0f;
Sequence seq = DOTween.Sequence();
seq.Join(rt.DOAnchorPos(basePos, changeMoveTime).SetEase(Ease.OutCubic));
if (canMove)
{
seq.Join(rt.DOAnchorPos(basePos, changeMoveTime).SetEase(Ease.OutCubic));
}
seq.Join(cg.DOFade(1f, changeMoveTime));
seq.Append(cg.DOFade(0f, changeBlinkTime));
seq.Append(cg.DOFade(1f, changeBlinkTime));
@@ -155,7 +155,7 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
}
SkillGroup skillGroup = so.GetSkillGroupByID(skillCard_skillID);
var levelInfo = so.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(so);
int currentLevel = levelInfo?.levelID ?? 0;
int requiredLevel = skillGroup?.thisSkill_levelLimit ?? 1;
if (currentLevel < requiredLevel)
@@ -191,7 +191,7 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
if (!isSelected)
{
// Documentation text normalized.
var levelInfo = so?.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(so);
int maxSlots = levelInfo?.skill_slot_limited ?? int.MaxValue; // Documentation text normalized.
int currentEquipped = so?.equippedSkillGroupIDs.Where(id => id != 0).Count() ?? 0;
@@ -307,7 +307,7 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
// Documentation text normalized.
string status;
var levelInfo = hero.GetEffectiveLevelForCurrentEXP();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(hero);
int maxSlots = levelInfo?.skill_slot_limited ?? int.MaxValue;
int currentEquipped = hero.equippedSkillGroupIDs.Where(id => id != 0).Count();
int requiredLevel = group.thisSkill_levelLimit;
+27 -31
View File
@@ -165,7 +165,13 @@ public class UI_Idols : MonoBehaviour
private void HandleQuitClicked()
{
gameObject.SetActive(false);
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
private void BeginStartupSkillValidation()
@@ -320,6 +326,7 @@ public class UI_Idols : MonoBehaviour
SetObjectState(skillsObj, idolSkillsToggle != null && idolSkillsToggle.isOn);
SetObjectState(skinsObj, idolSkinsToggle != null && idolSkinsToggle.isOn);
SetObjectState(weaponObj, idolWeaponToggle != null && idolWeaponToggle.isOn);
PlayActiveSectionRefresh();
}
private bool AnySectionToggleOn()
@@ -421,6 +428,7 @@ public class UI_Idols : MonoBehaviour
IdolLevelSnapshot snapshot = BuildLevelSnapshot(hero);
GameObject instance = GetOrCreateCard(visibleCardCount);
UI_OrderedEntryAnimator.PlaySingle(instance, visibleCardCount, 0.18f, 0.015f, -18f, 0.965f, true);
visibleCardCount++;
idolCardPrefab card = instance.GetComponent<idolCardPrefab>();
@@ -567,6 +575,7 @@ public class UI_Idols : MonoBehaviour
ApplyBehaviourRadar(hero);
PopulateSpecialSkills(hero);
UI_OrderedEntryAnimator.PlayRefresh(rightPanel, 0.16f, -8f, 0.99f, true);
}
private void SetIdolDocumentText(string value)
@@ -693,6 +702,7 @@ public class UI_Idols : MonoBehaviour
}
GameObject instance = GetOrCreateSpecialSkillEntry(shown);
UI_OrderedEntryAnimator.PlaySingle(instance, shown, 0.16f, 0.025f, -10f, 0.97f, true);
ssPrefab display = instance.GetComponent<ssPrefab>();
if (display != null)
@@ -839,6 +849,19 @@ public class UI_Idols : MonoBehaviour
return entry;
}
private void PlayActiveSectionRefresh()
{
GameObject active = null;
if (levelsObj != null && levelsObj.activeSelf) active = levelsObj;
else if (voicesObj != null && voicesObj.activeSelf) active = voicesObj;
else if (detailPassageObj != null && detailPassageObj.activeSelf) active = detailPassageObj;
else if (skillsObj != null && skillsObj.activeSelf) active = skillsObj;
else if (skinsObj != null && skinsObj.activeSelf) active = skinsObj;
else if (weaponObj != null && weaponObj.activeSelf) active = weaponObj;
UI_OrderedEntryAnimator.PlayRefresh(active, 0.16f, -8f, 0.99f, true);
}
private static void SetText(Text target, string value)
{
if (target != null)
@@ -939,7 +962,7 @@ public class UI_Idols : MonoBehaviour
SetText(il.damageResistant, FormatGrowthPercent(baseLevelInfo != null ? baseLevelInfo.damageResistance : levelInfo.damageResistance, levelInfo.damageResistance));
SetText(il.scoreEfficency, FormatGrowthPercent(baseLevelInfo != null ? baseLevelInfo.scoreEfficiency : levelInfo.scoreEfficiency, levelInfo.scoreEfficiency));
int baseSlotAmount = baseLevelInfo != null ? baseLevelInfo.skill_slot_limited : levelInfo.skill_slot_limited;
int effectiveSlotAmount = currentSelectedHero != null ? currentSelectedHero.GetEffectiveSkillSlotLimit() : levelInfo.skill_slot_limited;
int effectiveSlotAmount = currentSelectedHero != null ? AllyHeroLevelRuntimeResolver.GetEffectiveSkillSlotLimit(currentSelectedHero) : levelInfo.skill_slot_limited;
SetText(il.slotAmount, FormatGrowthInt(baseSlotAmount, effectiveSlotAmount));
SetText(il.miss_mr, levelInfo.manaGainOnMiss.ToString());
SetText(il.good_mr, levelInfo.manaGainGood.ToString());
@@ -953,39 +976,12 @@ public class UI_Idols : MonoBehaviour
private AllyHero_SO.AllyLevelInfo GetEffectiveLevelInfoFromLedger(AllyHero_SO hero)
{
AllyHero_SO.AllyLevelInfo baseLevelInfo = GetBaseLevelInfoFromLedger(hero);
return hero != null ? hero.GetEffectiveLevelInfoWithEquipment(baseLevelInfo) : null;
return AllyHeroLevelRuntimeResolver.GetEffectiveLevelInfo(hero);
}
private AllyHero_SO.AllyLevelInfo GetBaseLevelInfoFromLedger(AllyHero_SO hero)
{
if (hero == null || hero.levelStats == null || hero.levelStats.Count == 0)
{
return null;
}
List<AllyHero_SO.AllyLevelInfo> levels = new List<AllyHero_SO.AllyLevelInfo>();
for (int i = 0; i < hero.levelStats.Count; i++)
{
if (hero.levelStats[i] != null)
{
levels.Add(hero.levelStats[i]);
}
}
if (levels.Count == 0)
{
return null;
}
levels.Sort((left, right) => left.requiredEXP.CompareTo(right.requiredEXP));
int index = ResolveUnlockedLevelIndexFromLedger(hero, levels, AllyHeroDeployLedger.EnsureInstance());
if (index < 0 || index >= levels.Count)
{
return null;
}
return levels[index];
return AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(hero);
}
private int ResolveUnlockedLevelIndexFromLedger(AllyHero_SO hero, List<AllyHero_SO.AllyLevelInfo> levels, AllyHeroDeployLedger ledger)
+2
View File
@@ -440,6 +440,7 @@ public class idolEquipments : MonoBehaviour
{
equippedItemInstance = Instantiate(eqpmtItemPrefab, eqpmtToPut);
equippedItemInstance.name = string.IsNullOrWhiteSpace(equippedEquipment.GetDisplayTierName()) ? equippedEquipment.name : equippedEquipment.GetDisplayTierName();
UI_OrderedEntryAnimator.PlayFadeOnly(equippedItemInstance, 0, 0.14f, 0f, true);
equipItemPrefab item = equippedItemInstance.GetComponent<equipItemPrefab>();
if (item != null)
@@ -937,6 +938,7 @@ public class idolEquipments : MonoBehaviour
{
item.SetActive(true);
}
UI_OrderedEntryAnimator.PlaySingle(item, index, 0.16f, 0.012f, -10f, 0.97f, true);
}
return item;
+4 -3
View File
@@ -61,7 +61,7 @@ public class idolSkillsHub : MonoBehaviour
currentHero.LoadEquippedSkillsFromLocal();
int currentTierNumber = GetCurrentTierNumber(currentHero);
int maxSkillSlots = currentHero.GetEffectiveSkillSlotLimit();
int maxSkillSlots = AllyHeroLevelRuntimeResolver.GetEffectiveSkillSlotLimit(currentHero);
int equippedCount = GetEquippedCount();
int visibleIndex = 0;
@@ -172,7 +172,7 @@ public class idolSkillsHub : MonoBehaviour
return;
}
int maxSkillSlots = currentHero.GetEffectiveSkillSlotLimit();
int maxSkillSlots = AllyHeroLevelRuntimeResolver.GetEffectiveSkillSlotLimit(currentHero);
if (equipped.Count >= maxSkillSlots)
{
Rebuild();
@@ -273,7 +273,7 @@ public class idolSkillsHub : MonoBehaviour
return 1;
}
return Mathf.Clamp(hero.ally_growthUnlockedTierIndex + 1, 1, 4);
return AllyHeroLevelRuntimeResolver.GetCurrentTierNumber(hero);
}
private static string GetTierName(int tierNumber)
@@ -322,6 +322,7 @@ public class idolSkillsHub : MonoBehaviour
{
item.SetActive(true);
}
UI_OrderedEntryAnimator.PlaySingle(item, index, 0.16f, 0.018f, -10f, 0.97f, true);
}
return item;
@@ -1285,6 +1285,7 @@ public class idolUpgrade : MonoBehaviour
}
GameObject instance = Instantiate(materialPrefab, materialContainer);
UI_OrderedEntryAnimator.PlaySingle(instance, materialContainer.childCount - 1, 0.16f, 0.016f, -10f, 0.97f, true);
materialPrefab item = instance.GetComponent<materialPrefab>();
if (item != null)
{
+54 -1
View File
@@ -15,6 +15,7 @@ public class itemGetPrefab : MonoBehaviour
public Button close;
private readonly List<GameObject> spawnedItems = new List<GameObject>();
private Coroutine layoutRefreshRoutine;
private void Awake()
{
@@ -52,6 +53,8 @@ public class itemGetPrefab : MonoBehaviour
Destroy(displayParent.GetChild(i).gameObject);
}
}
RequestLayoutRebuild();
}
public get_item_prefab AddItem()
@@ -63,11 +66,61 @@ public class itemGetPrefab : MonoBehaviour
GameObject instance = Instantiate(itemPrefab, displayParent);
spawnedItems.Add(instance);
UI_OrderedEntryAnimator.PlayFadeOnly(instance, spawnedItems.Count - 1, 0.2f, 0.025f, true);
RequestLayoutRebuild();
return instance.GetComponent<get_item_prefab>();
}
private void RequestLayoutRebuild()
{
if (displayParent == null)
{
return;
}
if (layoutRefreshRoutine != null)
{
StopCoroutine(layoutRefreshRoutine);
layoutRefreshRoutine = null;
}
if (isActiveAndEnabled)
{
layoutRefreshRoutine = StartCoroutine(RebuildLayoutNextFrame());
return;
}
RebuildLayoutNow();
}
private System.Collections.IEnumerator RebuildLayoutNextFrame()
{
yield return null;
RebuildLayoutNow();
layoutRefreshRoutine = null;
}
private void RebuildLayoutNow()
{
RectTransform rect = displayParent as RectTransform;
if (rect == null)
{
return;
}
Canvas.ForceUpdateCanvases();
LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
Canvas.ForceUpdateCanvases();
}
public void CloseSelf()
{
Destroy(gameObject);
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
Destroy(gameObject);
}
});
}
}
+1
View File
@@ -69,6 +69,7 @@ public class mailSlotPrefab : MonoBehaviour
}
GameObject go = Instantiate(rewardPreviewPrefab, rewardPreviewRoot);
UI_OrderedEntryAnimator.PlayFadeOnly(go, i, 0.14f, 0.01f, true);
Image icon = go.GetComponent<Image>();
if (icon == null)
{
+32 -2
View File
@@ -1,6 +1,7 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using DG.Tweening;
public class rewardSlotPrefab : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
@@ -77,11 +78,40 @@ public class rewardSlotPrefab : MonoBehaviour, IPointerEnterHandler, IPointerExi
public void OnPointerEnter(PointerEventData eventData)
{
if (detailBtm != null) detailBtm.SetActive(true);
if (detailBtm == null)
{
return;
}
detailBtm.SetActive(true);
UI_OrderedEntryAnimator.PlayFadeOnly(detailBtm, 0, 0.12f, 0f, true);
}
public void OnPointerExit(PointerEventData eventData)
{
if (detailBtm != null) detailBtm.SetActive(false);
if (detailBtm == null)
{
return;
}
CanvasGroup group = detailBtm.GetComponent<CanvasGroup>();
if (group == null)
{
group = detailBtm.AddComponent<CanvasGroup>();
}
group.DOKill();
group.DOFade(0f, 0.1f)
.SetEase(Ease.OutQuad)
.SetUpdate(true)
.SetTarget(detailBtm)
.OnComplete(() =>
{
if (detailBtm != null)
{
detailBtm.SetActive(false);
group.alpha = 1f;
}
});
}
}
+18 -4
View File
@@ -32,6 +32,7 @@ public class UI_userBag : MonoBehaviour
[Header("button")]
public Button closeBagButton;
private bool isClosing;
private void Awake()
{
@@ -43,6 +44,7 @@ public class UI_userBag : MonoBehaviour
private void OnEnable()
{
isClosing = false;
InitializeToggleGroup();
BindToggles();
BindCloseButton();
@@ -189,14 +191,21 @@ public class UI_userBag : MonoBehaviour
private void HandleCloseBagClicked()
{
uBag bagRoot = GetComponentInParent<uBag>();
if (bagRoot != null)
if (isClosing)
{
Destroy(bagRoot.gameObject);
return;
}
Destroy(gameObject);
isClosing = true;
uBag bagRoot = GetComponentInParent<uBag>();
GameObject target = bagRoot != null ? bagRoot.gameObject : gameObject;
UI_PanelExitUtility.PlayExitThen(target, () =>
{
if (target != null)
{
Destroy(target);
}
});
}
private void ApplyPanelState(GameObject activeObject)
@@ -221,7 +230,12 @@ public class UI_userBag : MonoBehaviour
return;
}
bool wasActive = target.activeInHierarchy;
target.SetActive(active);
if (active && !wasActive)
{
UI_OrderedEntryAnimator.PlayRefresh(target, 0.14f, -6f, 0.99f, true);
}
}
private void SetToggleInteractable(Toggle toggle, bool interactable)
+15
View File
@@ -534,6 +534,7 @@ public class uBag : MonoBehaviour
}
PositionIntroduction(source, spawnedIntroduction);
UI_OrderedEntryAnimator.PlayFadeOnly(spawnedIntroduction, 0, 0.16f, 0f, true);
}
public void HidePreviewFor(uBagItemPrefab source)
@@ -862,6 +863,7 @@ public class uBag : MonoBehaviour
GameObject instance = Instantiate(itemPrefab, itemParent);
instance.name = $"uBagItem_{entry.stableId}";
spawnedItems.Add(instance);
UI_OrderedEntryAnimator.PlaySingle(instance, spawnedItems.Count - 1, 0.18f, 0.01f, -16f, 0.965f, true);
uBagItemPrefab prefabView = instance.GetComponent<uBagItemPrefab>();
if (prefabView != null)
@@ -973,6 +975,8 @@ public class uBag : MonoBehaviour
{
itemDescription.text = entry.description ?? string.Empty;
}
PlayRightPanelRefresh();
}
private void ClearRightPanel()
@@ -1024,6 +1028,17 @@ public class uBag : MonoBehaviour
{
itemDescription.text = string.Empty;
}
PlayRightPanelRefresh();
}
private void PlayRightPanelRefresh()
{
GameObject target = null;
if (btmImg != null) target = btmImg.gameObject;
if (target == null && itemDprofile != null) target = itemDprofile.gameObject;
if (target == null && itemName != null) target = itemName.gameObject;
UI_OrderedEntryAnimator.PlayRefresh(target, 0.14f, -6f, 0.99f, true);
}
private static int CompareEntries(BagEntry left, BagEntry right)
+8 -1
View File
@@ -123,7 +123,13 @@ public class UI_Player : MonoBehaviour
private void ClosePanel()
{
gameObject.SetActive(false);
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
private void RestartForceRefreshUiRoutine()
@@ -505,6 +511,7 @@ public class UI_Player : MonoBehaviour
GameObject entryObject = Instantiate(pInfoPrefab, pInfoParent);
spawnedInfoEntries.Add(entryObject);
UI_OrderedEntryAnimator.PlaySingle(entryObject, spawnedInfoEntries.Count - 1, 0.17f, 0.014f, -12f, 0.97f, true);
pInfoPrefab entry = entryObject.GetComponent<pInfoPrefab>();
if (entry == null)
+14 -2
View File
@@ -77,6 +77,7 @@ public class uRecentGameHistory : MonoBehaviour
GameObject instance = Instantiate(gameHistoryPrefab, gameHistoryParent);
instance.transform.localScale *= prefabScaleRatio;
previewEntries.Add(instance);
UI_OrderedEntryAnimator.PlaySingle(instance, i, 0.18f, 0.015f, -14f, 0.97f, true);
ghPrefab controller = instance.GetComponent<ghPrefab>();
if (controller == null)
{
@@ -92,6 +93,7 @@ public class uRecentGameHistory : MonoBehaviour
if (more_gameHistory != null)
{
more_gameHistory.SetActive(true);
UI_OrderedEntryAnimator.PlayRefresh(more_gameHistory, 0.18f, -10f, 0.985f, true);
}
if (dGameHistoryParent == null || gameHistoryPrefab == null)
@@ -118,6 +120,7 @@ public class uRecentGameHistory : MonoBehaviour
GameObject instance = Instantiate(gameHistoryPrefab, dGameHistoryParent);
detailEntries.Add(instance);
UI_OrderedEntryAnimator.PlaySingle(instance, i, 0.16f, 0.012f, -12f, 0.97f, true);
ghPrefab controller = instance.GetComponent<ghPrefab>();
if (controller == null)
@@ -131,11 +134,20 @@ public class uRecentGameHistory : MonoBehaviour
private void CloseDetailedHistory()
{
ClearEntries(detailEntries, dGameHistoryParent);
if (more_gameHistory != null)
{
more_gameHistory.SetActive(false);
UI_PanelExitUtility.PlayExitThen(more_gameHistory, () =>
{
ClearEntries(detailEntries, dGameHistoryParent);
if (more_gameHistory != null)
{
more_gameHistory.SetActive(false);
}
});
return;
}
ClearEntries(detailEntries, dGameHistoryParent);
}
private SongData FindSongById(int songId)
@@ -192,7 +192,10 @@ public class BgmPlaybackManager : MonoBehaviour
}
if (audioSource.clip != null && !audioSource.isPlaying)
{
audioSource.Play();
StopLegacyMusicManagerSources();
}
}
private IEnumerator LoadClipRoutine()
@@ -248,7 +251,10 @@ public class BgmPlaybackManager : MonoBehaviour
}
if (audioSource.clip != null && !audioSource.isPlaying)
{
audioSource.Play();
StopLegacyMusicManagerSources();
}
if (loadClipRoutine != null)
{
@@ -342,6 +348,45 @@ public class BgmPlaybackManager : MonoBehaviour
audioSource.loop = loop;
audioSource.time = 0f;
audioSource.Play();
StopLegacyMusicManagerSources();
}
public void PlayExternalClip(AudioClip externalClip, bool restart)
{
if (externalClip == null)
{
return;
}
if (!ShouldPlayInScene(SceneManager.GetActiveScene().name))
{
StopLobbyAudioAndParticles();
return;
}
if (audioSource == null)
{
audioSource = gameObject.AddComponent<AudioSource>();
}
ApplyOutputMixerGroup();
bool clipChanged = audioSource.clip != externalClip;
clip = externalClip;
audioSource.clip = externalClip;
audioSource.loop = loop;
if (restart || clipChanged)
{
audioSource.time = 0f;
}
if (!audioSource.isPlaying || restart || clipChanged)
{
audioSource.Play();
}
StopLegacyMusicManagerSources();
}
public void Next()
@@ -400,6 +445,24 @@ public class BgmPlaybackManager : MonoBehaviour
}
}
private void StopLegacyMusicManagerSources()
{
var managers = FindObjectsByType<Music_Mgr>(FindObjectsInactive.Include, FindObjectsSortMode.None);
for (int i = 0; i < managers.Length; i++)
{
Music_Mgr manager = managers[i];
if (manager == null || manager.AudioSource == null || manager.AudioSource == audioSource)
{
continue;
}
if (manager.AudioSource.isPlaying)
{
manager.AudioSource.Stop();
}
}
}
public float CurrentTime => audioSource != null ? audioSource.time : 0f;
public float TotalTime => (audioSource != null && audioSource.clip != null) ? audioSource.clip.length : 0f;
public bool IsReady => audioSource != null && audioSource.clip != null;
@@ -205,8 +205,9 @@ public class InGamePerformanceManager : MonoBehaviour
.OrderByDescending(info => (int)info.level.rarity)
.ToList();
foreach (var info in sortedAchievements)
for (int i = 0; i < sortedAchievements.Count; i++)
{
var info = sortedAchievements[i];
var cat = info.sourceSO != null ? info.sourceSO.category : AchievementCategory.Combo;
GameObject targetParent = place_to_putdown;
@@ -219,6 +220,7 @@ public class InGamePerformanceManager : MonoBehaviour
GameObject prefabToSpawn = (info.sourceSO != null && info.sourceSO.customPrefab != null) ? info.sourceSO.customPrefab : archievePrefab;
GameObject go = Instantiate(prefabToSpawn, targetParent.transform);
UI_OrderedEntryAnimator.PlayFadeOnly(go, i, 0.16f, 0.012f, true);
var script = go.GetComponent<archievePrefab>();
if (script != null)
+39 -2
View File
@@ -57,6 +57,7 @@ public class pressStart : MonoBehaviour
// polling
private Coroutine pollCoroutine;
private float pollInterval = 3f;
private UI_PanelPopupTween helpPopupTween;
// Start is called before the first frame update
void Start()
@@ -90,6 +91,11 @@ public class pressStart : MonoBehaviour
}
if (helpContentObject != null)
{
helpPopupTween = helpContentObject.GetComponent<UI_PanelPopupTween>();
if (helpPopupTween == null)
{
helpPopupTween = helpContentObject.AddComponent<UI_PanelPopupTween>();
}
helpContentObject.SetActive(false);
}
@@ -198,7 +204,22 @@ public class pressStart : MonoBehaviour
if (helpContentObject != null)
{
bool isActive = helpContentObject.activeSelf;
helpContentObject.SetActive(!isActive);
if (isActive)
{
HideHelpContentWithExitAnim();
}
else
{
if (helpPopupTween == null)
{
helpPopupTween = helpContentObject.GetComponent<UI_PanelPopupTween>();
if (helpPopupTween == null)
{
helpPopupTween = helpContentObject.AddComponent<UI_PanelPopupTween>();
}
}
helpContentObject.SetActive(true);
}
Debug.Log("[pressStart] Help button clicked. Help content active: " + !isActive);
}
}
@@ -207,11 +228,27 @@ public class pressStart : MonoBehaviour
{
if (helpContentObject != null)
{
helpContentObject.SetActive(false);
HideHelpContentWithExitAnim();
Debug.Log("[pressStart] Close button clicked. Help content hidden.");
}
}
private void HideHelpContentWithExitAnim()
{
if (helpContentObject == null || !helpContentObject.activeInHierarchy)
{
return;
}
UI_PanelExitUtility.PlayExitThen(helpContentObject, () =>
{
if (helpContentObject != null)
{
helpContentObject.SetActive(false);
}
});
}
private void OnExitButtonClick()
{
Debug.Log("[pressStart] Exit button clicked. Application quitting.");
@@ -37,6 +37,7 @@ public class UI_SongsSelect_EnterAnim : MonoBehaviour
public CanvasGroup canvasGroup;
public float baseAlpha;
public bool createdCanvasGroup;
public bool restoreTransform;
}
private class SelectableState
@@ -114,6 +115,7 @@ public class UI_SongsSelect_EnterAnim : MonoBehaviour
Vector2 basePos = rt.anchoredPosition;
float baseAlpha = group.alpha <= 0f ? 1f : group.alpha;
bool layoutSensitive = UI_OrderedEntryAnimator.IsLayoutSensitive(rt);
nodeStates.Add(new NodeState
{
@@ -121,20 +123,27 @@ public class UI_SongsSelect_EnterAnim : MonoBehaviour
basePos = basePos,
canvasGroup = group,
baseAlpha = baseAlpha,
createdCanvasGroup = created
createdCanvasGroup = created,
restoreTransform = !layoutSensitive
});
rt.DOKill();
group.DOKill();
rt.anchoredPosition = basePos - new Vector2(0f, Mathf.Abs(fromOffsetY));
if (!layoutSensitive)
{
rt.anchoredPosition = basePos - new Vector2(0f, Mathf.Abs(fromOffsetY));
}
group.alpha = 0f;
float start = i * Mathf.Max(0f, itemStagger);
enterSequence.Insert(start,
rt.DOAnchorPos(basePos, Mathf.Max(0.01f, itemDuration))
.SetEase(moveEase)
.SetUpdate(useUnscaledTime));
if (!layoutSensitive)
{
enterSequence.Insert(start,
rt.DOAnchorPos(basePos, Mathf.Max(0.01f, itemDuration))
.SetEase(moveEase)
.SetUpdate(useUnscaledTime));
}
enterSequence.Insert(start,
group.DOFade(baseAlpha, Mathf.Max(0.01f, itemDuration))
.SetEase(fadeEase)
@@ -292,7 +301,10 @@ public class UI_SongsSelect_EnterAnim : MonoBehaviour
if (st.canvasGroup != null)
st.canvasGroup.DOKill();
st.rect.anchoredPosition = st.basePos;
if (st.restoreTransform)
{
st.rect.anchoredPosition = st.basePos;
}
if (st.canvasGroup != null)
st.canvasGroup.alpha = st.baseAlpha;
}
@@ -183,31 +183,46 @@ public class TeamSelectorAnimController : MonoBehaviour
}
if (slotRects == null || slotRects.Count == 0) yield break;
LayoutGroup layout = leftSlotsContainer != null ? leftSlotsContainer.GetComponent<LayoutGroup>() : null;
bool layoutEnabled = layout != null && layout.enabled;
if (leftSlotsContainer != null)
LayoutRebuilder.ForceRebuildLayoutImmediate(leftSlotsContainer);
slotRects.Sort((a, b) => a.GetSiblingIndex().CompareTo(b.GetSiblingIndex()));
if (layoutEnabled) layout.enabled = false;
var basePosBySlot = new Dictionary<RectTransform, Vector2>(slotRects.Count);
var canMoveBySlot = new Dictionary<RectTransform, bool>(slotRects.Count);
for (int i = 0; i < slotRects.Count; i++)
{
RectTransform rt = slotRects[i];
if (rt == null) continue;
Vector2 basePos = rt.anchoredPosition;
basePosBySlot[rt] = basePos;
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(rt);
canMoveBySlot[rt] = canMove;
rt.DOKill();
rt.anchoredPosition = basePos + new Vector2(0f, -slotEnterOffset);
rt.DOAnchorPos(basePos, slotEnterTime)
.SetEase(Ease.OutCubic)
.SetDelay(i * slotStagger)
.SetUpdate(useUnscaled)
// If a slot gets disabled/enabled during layout/UI updates, don't kill the tween
// (killing it can leave the slot stuck at the start offset).
.SetLink(rt.gameObject, LinkBehaviour.PauseOnDisablePlayOnEnable);
CanvasGroup cg = EnsureCanvasGroup(rt);
if (cg != null)
{
cg.DOKill();
cg.alpha = 0f;
cg.DOFade(1f, slotEnterTime)
.SetEase(Ease.OutCubic)
.SetDelay(i * slotStagger)
.SetUpdate(useUnscaled)
.SetLink(rt.gameObject, LinkBehaviour.PauseOnDisablePlayOnEnable);
}
if (canMove)
{
rt.anchoredPosition = basePos + new Vector2(0f, -slotEnterOffset);
rt.DOAnchorPos(basePos, slotEnterTime)
.SetEase(Ease.OutCubic)
.SetDelay(i * slotStagger)
.SetUpdate(useUnscaled)
// If a slot gets disabled/enabled during layout/UI updates, don't kill the tween
// (killing it can leave the slot stuck at the start offset).
.SetLink(rt.gameObject, LinkBehaviour.PauseOnDisablePlayOnEnable);
}
}
float total = slotEnterTime + slotStagger * Mathf.Max(0, slotRects.Count - 1);
@@ -223,6 +238,7 @@ public class TeamSelectorAnimController : MonoBehaviour
{
RectTransform rt = kvp.Key;
if (rt == null) continue;
if (!canMoveBySlot.TryGetValue(rt, out bool canMove) || !canMove) continue;
Vector2 basePos = kvp.Value;
if (Vector2.Distance(rt.anchoredPosition, basePos) > 0.5f)
{
@@ -234,7 +250,6 @@ public class TeamSelectorAnimController : MonoBehaviour
}
}
if (layoutEnabled) layout.enabled = true;
if (leftSlotsContainer != null)
LayoutRebuilder.ForceRebuildLayoutImmediate(leftSlotsContainer);
}
@@ -281,6 +296,20 @@ public class TeamSelectorAnimController : MonoBehaviour
void AnimatePanel(RectTransform panel, float offsetX, float delay)
{
if (panel == null) return;
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(panel);
CanvasGroup cg = EnsureCanvasGroup(panel);
if (cg != null)
{
cg.DOKill();
cg.alpha = 0f;
cg.DOFade(1f, panelEnterTime)
.SetEase(Ease.OutCubic)
.SetDelay(delay)
.SetUpdate(useUnscaled)
.SetLink(cg.gameObject, LinkBehaviour.KillOnDisable);
}
if (!canMove) return;
Vector2 basePos = panel.anchoredPosition;
panel.DOKill();
panel.anchoredPosition = basePos + new Vector2(offsetX, 0f);
@@ -294,6 +323,19 @@ public class TeamSelectorAnimController : MonoBehaviour
void AnimateConfirm(RectTransform button)
{
if (button == null) return;
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(button);
CanvasGroup cg = EnsureCanvasGroup(button);
if (cg != null)
{
cg.DOKill();
cg.alpha = 0f;
cg.DOFade(1f, confirmEnterTime)
.SetEase(Ease.OutCubic)
.SetUpdate(useUnscaled)
.SetLink(cg.gameObject, LinkBehaviour.KillOnDisable);
}
if (!canMove) return;
Vector2 basePos = button.anchoredPosition;
button.DOKill();
button.anchoredPosition = basePos + new Vector2(0f, -confirmEnterOffset);
+1
View File
@@ -115,6 +115,7 @@ public class newTeamSelector : MonoBehaviour
var go = Instantiate(slotPrefab, container);
go.transform.SetParent(container, false);
go.name = $"heroSlot_{i}";
UI_OrderedEntryAnimator.PlayFadeOnly(go, i, 0.16f, 0.012f, true);
var slotComp = go.GetComponent<slots_heroSlots>();
if (slotComp == null)
@@ -103,8 +103,11 @@ public class loadSettlementTeamPrefab : MonoBehaviour
var rectTransform = go.GetComponent<RectTransform>();
if (rectTransform != null)
{
rectTransform.anchoredPosition = Vector2.zero;
rectTransform.sizeDelta = Vector2.zero;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rectTransform))
{
rectTransform.anchoredPosition = Vector2.zero;
rectTransform.sizeDelta = Vector2.zero;
}
spawnedCardRoots.Add(rectTransform);
}
@@ -296,10 +299,15 @@ public class loadSettlementTeamPrefab : MonoBehaviour
CanvasGroup group = GetOrAddCanvasGroup(rt.transform);
if (group != null) group.alpha = 0f;
rt.anchoredPosition = new Vector2(basePos.x + offsetX, basePos.y);
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(rt);
if (canMove)
{
rt.anchoredPosition = new Vector2(basePos.x + offsetX, basePos.y);
}
float startAt = i * stagger; // top -> bottom (sibling order)
allySlotEntrySequence.Insert(startAt, rt.DOAnchorPos(basePos, duration).SetEase(allySlotEntryEase).SetUpdate(allySlotEntryUseUnscaledTime));
if (canMove)
allySlotEntrySequence.Insert(startAt, rt.DOAnchorPos(basePos, duration).SetEase(allySlotEntryEase).SetUpdate(allySlotEntryUseUnscaledTime));
if (group != null)
allySlotEntrySequence.Insert(startAt, group.DOFade(1f, duration).SetEase(allySlotEntryEase).SetUpdate(allySlotEntryUseUnscaledTime));
}
@@ -336,7 +344,10 @@ public class loadSettlementTeamPrefab : MonoBehaviour
if (rt == null) continue;
if (i < spawnedCardBasePositions.Count)
rt.anchoredPosition = spawnedCardBasePositions[i];
{
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rt))
rt.anchoredPosition = spawnedCardBasePositions[i];
}
SetCanvasAlpha(rt.transform, 1f);
}
}
+28 -3
View File
@@ -196,7 +196,9 @@ public class teamSettingPanel : MonoBehaviour
if (tcdi != null)
{
if (t.charcterImg != null) { t.charcterImg.sprite = tcdi.CharacterTeamSprite; t.charcterImg.color=new Color(t.charcterImg.color.r,t.charcterImg.color.g,t.charcterImg.color.b,1f); }
if (t.levelIcon != null) { t.levelIcon.sprite = getLevelSprite(currentTeam[i].currentBoundaryLevel); t.levelIcon.color=new Color(t.levelIcon.color.r,t.levelIcon.color.g,t.levelIcon.color.b,1f); }
string boundaryLevel = ResolveBoundaryLevel(t.characterID, currentTeam[i].currentBoundaryLevel);
currentTeam[i].currentBoundaryLevel = boundaryLevel;
if (t.levelIcon != null) { t.levelIcon.sprite = getLevelSprite(boundaryLevel); t.levelIcon.color=new Color(t.levelIcon.color.r,t.levelIcon.color.g,t.levelIcon.color.b,1f); }
if (t.skillName != null) t.skillName.text = tcdi.CharacterSkillName ?? string.Empty;
}
else
@@ -230,6 +232,7 @@ public class teamSettingPanel : MonoBehaviour
teamManager.currentSelectedCharacterCard = null;
List<CharacterView> currentTeam = teamManager.getCurrentSelectedTeam().teamIdList;
List<CharacterView> selectAbleCharacters = teamManager.SelectableCharacterList;
int visibleIndex = 0;
foreach (CharacterView c in selectAbleCharacters) //id and level
{
if (!IsCharacterUnlocked(c != null ? c.characterId : 0))
@@ -238,14 +241,16 @@ public class teamSettingPanel : MonoBehaviour
}
GameObject characterObj = Instantiate(teamCharacterPrefab, teamCharacterViewContent.transform);
UI_OrderedEntryAnimator.PlayFadeOnly(characterObj, visibleIndex, 0.16f, 0.012f, true);
visibleIndex++;
CharacterCardView ccv = characterObj.GetComponent<CharacterCardView>();
TeamCharacterDataInfo tcdi = getCharacterViewInfo(c.characterId);
if (ccv != null&& tcdi!=null)
{
ccv.characterID = tcdi.CharacterID;
ccv.currentBoundaryLevel= c.currentBoundaryLevel;
ccv.currentBoundaryLevel= ResolveBoundaryLevel(c.characterId, c.currentBoundaryLevel);
ccv.characterImage.sprite =tcdi.CharacterCardSprite;
ccv.levelIcon.sprite = getLevelSprite(c.currentBoundaryLevel);
ccv.levelIcon.sprite = getLevelSprite(ccv.currentBoundaryLevel);
ccv.occupationIcon.sprite = tcdi.CharacterRoleSprite;
}
@@ -277,6 +282,26 @@ public class teamSettingPanel : MonoBehaviour
return false;
}
private string ResolveBoundaryLevel(int characterID, string fallbackLevel)
{
if (characterID <= 0)
{
return fallbackLevel;
}
AllyHero_SO[] heroes = RuntimeResourcesCache.LoadAllAllyHeroes();
for (int i = 0; i < heroes.Length; i++)
{
AllyHero_SO hero = heroes[i];
if (hero != null && hero.ally_heroID == characterID)
{
return AllyHeroLevelRuntimeResolver.GetDisplayRatingKey(hero);
}
}
return fallbackLevel;
}
private bool checkExistenceStatus(List<CharacterView> currentTeam,int characterID)
{
foreach (CharacterView c in currentTeam)
+15 -3
View File
@@ -59,7 +59,7 @@ class UI_Panel_Character : MonoBehaviour
{
if (Input.GetKeyDown(KeyCode.Escape))
{
gameObject.SetActive(false);
ClosePanel();
}
}
@@ -77,7 +77,7 @@ class UI_Panel_Character : MonoBehaviour
confirm_thisHero.onClick.AddListener(OnConfirmHeroClicked);
if (quitButton != null)
quitButton.onClick.AddListener(() => gameObject.SetActive(false));
quitButton.onClick.AddListener(ClosePanel);
if (Image_Character_Illustration != null)
{
@@ -126,6 +126,7 @@ class UI_Panel_Character : MonoBehaviour
for (int i = 0; i < allyHeroList.Count; i++)
{
var slotObject = Instantiate(button_Character_Slot_Prefab, content_Character_Slot);
UI_OrderedEntryAnimator.PlayFadeOnly(slotObject, i, 0.16f, 0.012f, true);
var displayPrefab = slotObject.GetComponent<uiui_character_displayPrefab>();
var slotButton = displayPrefab != null ? displayPrefab.characterProfileButton : slotObject.GetComponent<Button>();
if (slotButton == null && slotObject.transform.parent != null)
@@ -178,7 +179,7 @@ class UI_Panel_Character : MonoBehaviour
{
if (SaveCurrentCharacter(true))
{
gameObject.SetActive(false);
ClosePanel();
}
}
@@ -315,4 +316,15 @@ class UI_Panel_Character : MonoBehaviour
.SetLink(text_char_name.gameObject);
}
}
private void ClosePanel()
{
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
}
+13 -2
View File
@@ -38,7 +38,7 @@ class UI_Panel_Level : MonoBehaviour
{
if (Input.GetKeyDown(KeyCode.Escape))
{
gameObject.SetActive(false);
ClosePanel();
}
}
void Start()
@@ -60,4 +60,15 @@ class UI_Panel_Level : MonoBehaviour
//obj++;
//Text_Level.text = obj.ToString();
}
}
private void ClosePanel()
{
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
}
+100 -4
View File
@@ -53,6 +53,8 @@ public class UI_Panel_Mail : MonoBehaviour
mailSlotPrefab selectedSlot;
mail_so selectedMailData;
bool _mailServiceSubscribed;
Coroutine noticeSlotsLayoutRefreshRoutine;
Coroutine rewardSlotsLayoutRefreshRoutine;
public bool UsesServerMail => fetchMailsFromServer;
@@ -187,6 +189,7 @@ public class UI_Panel_Mail : MonoBehaviour
ShowMailDetails(null);
ShowMailRewards(null);
RefreshReceiveButton();
RequestNoticeSlotsLayoutRebuild();
return;
}
ApplySavedState(cachedMails);
@@ -209,6 +212,7 @@ public class UI_Panel_Mail : MonoBehaviour
var mail = mails[i];
if (mail == null) continue;
var go = Instantiate(noticeSlotPrefab, content_Notice_Slot);
UI_OrderedEntryAnimator.PlayFadeOnly(go, i, 0.18f, 0.012f, true);
var slot = go.GetComponent<mailSlotPrefab>();
if (selectedSlot == null) selectedSlot = slot;
if (slot != null)
@@ -239,7 +243,7 @@ public class UI_Panel_Mail : MonoBehaviour
}
}
LayoutRebuilder.ForceRebuildLayoutImmediate(content_Notice_Slot as RectTransform);
RequestNoticeSlotsLayoutRebuild();
if (selectedSlot != null && cachedMails != null)
{
for (int i = 0; i < cachedMails.Count; i++)
@@ -411,6 +415,7 @@ public class UI_Panel_Mail : MonoBehaviour
ShowMailRewards(mail);
OnMailRead(slot, mail);
RefreshReceiveButton();
PlayMailDetailsRefresh();
}
async void OnMailReceived(mailSlotPrefab slot, mail_so mail)
@@ -471,20 +476,105 @@ public class UI_Panel_Mail : MonoBehaviour
Destroy(content_Reward_Slot.GetChild(i).gameObject);
}
if (mail == null || mail.rewardList == null || mail.rewardList.Count == 0) return;
if (mail == null || mail.rewardList == null || mail.rewardList.Count == 0)
{
RequestRewardSlotsLayoutRebuild();
return;
}
for (int i = 0; i < mail.rewardList.Count; i++)
{
var reward = mail.rewardList[i];
if (reward == null) continue;
var go = Instantiate(rewardSlotPrefab, content_Reward_Slot);
UI_OrderedEntryAnimator.PlayFadeOnly(go, i, 0.16f, 0.02f, true);
var slot = go.GetComponent<rewardSlotPrefab>();
if (slot == null) continue;
slot.BindReward(reward);
if (slot.detailBtm != null) slot.detailBtm.SetActive(false);
}
LayoutRebuilder.ForceRebuildLayoutImmediate(content_Reward_Slot as RectTransform);
RequestRewardSlotsLayoutRebuild();
}
void RequestNoticeSlotsLayoutRebuild()
{
if (content_Notice_Slot == null)
{
return;
}
if (noticeSlotsLayoutRefreshRoutine != null)
{
StopCoroutine(noticeSlotsLayoutRefreshRoutine);
noticeSlotsLayoutRefreshRoutine = null;
}
if (isActiveAndEnabled)
{
noticeSlotsLayoutRefreshRoutine = StartCoroutine(RebuildNoticeSlotsLayoutNextFrame());
return;
}
RebuildLayoutNow(content_Notice_Slot);
}
void RequestRewardSlotsLayoutRebuild()
{
if (content_Reward_Slot == null)
{
return;
}
if (rewardSlotsLayoutRefreshRoutine != null)
{
StopCoroutine(rewardSlotsLayoutRefreshRoutine);
rewardSlotsLayoutRefreshRoutine = null;
}
if (isActiveAndEnabled)
{
rewardSlotsLayoutRefreshRoutine = StartCoroutine(RebuildRewardSlotsLayoutNextFrame());
return;
}
RebuildLayoutNow(content_Reward_Slot);
}
IEnumerator RebuildNoticeSlotsLayoutNextFrame()
{
yield return null;
RebuildLayoutNow(content_Notice_Slot);
noticeSlotsLayoutRefreshRoutine = null;
}
IEnumerator RebuildRewardSlotsLayoutNextFrame()
{
yield return null;
RebuildLayoutNow(content_Reward_Slot);
rewardSlotsLayoutRefreshRoutine = null;
}
void RebuildLayoutNow(Transform target)
{
RectTransform rect = target as RectTransform;
if (rect == null)
{
return;
}
Canvas.ForceUpdateCanvases();
LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
Canvas.ForceUpdateCanvases();
}
void PlayMailDetailsRefresh()
{
GameObject target = null;
if (thisMail_title != null) target = thisMail_title.gameObject;
if (target == null && thisMail_body != null) target = thisMail_body.gameObject;
if (target == null && content_Reward_Slot != null) target = content_Reward_Slot.gameObject;
UI_OrderedEntryAnimator.PlayRefresh(target, 0.14f, -6f, 0.99f, true);
}
void SetSelectedSlot(mailSlotPrefab slot)
@@ -532,7 +622,13 @@ public class UI_Panel_Mail : MonoBehaviour
void CloseMailPanel()
{
gameObject.SetActive(false);
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
void RefreshReceiveButton()
+106 -30
View File
@@ -362,6 +362,7 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
enterAnim.enabled = true;
}
panel.SetActive(true);
Ensure_Panel_Popup_If_Needed(panel);
RegisterManagedPanel(panel);
return true;
}
@@ -375,7 +376,7 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
if (panel.activeSelf)
{
panel.SetActive(false);
ClosePanelWithExitAnim(panel);
return;
}
@@ -388,8 +389,9 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
}
panel.SetActive(true);
Ensure_Panel_Popup_If_Needed(panel);
RegisterManagedPanel(panel);
}
}
GameObject Try_Open_Prefab(GameObject prefab, ref GameObject instance)
{
@@ -414,6 +416,7 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
}
panel.SetActive(true);
Ensure_Panel_Popup_If_Needed(panel);
RegisterManagedPanel(panel);
}
@@ -431,7 +434,7 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
{
if (panel != null)
{
panel.SetActive(false);
ClosePanelWithExitAnim(panel);
}
return true;
@@ -473,6 +476,40 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
rect.DOScale(Vector3.one, prefab_Enter_Time).SetEase(prefab_Enter_Ease);
cg.DOFade(1f, prefab_Enter_Time).SetEase(prefab_Enter_Ease);
}
void Ensure_Panel_Popup_If_Needed(GameObject panel)
{
if (panel == null || panel == ui_Panel_Setting)
{
return;
}
if (panel.GetComponent<UI_SettingsPanelEnterAnim>() != null)
{
return;
}
UI_PanelPopupTween tween = panel.GetComponent<UI_PanelPopupTween>();
if (tween == null)
{
panel.AddComponent<UI_PanelPopupTween>();
}
}
void ClosePanelWithExitAnim(GameObject panel)
{
if (panel == null)
{
return;
}
UI_PanelExitUtility.PlayExitThen(panel, () =>
{
if (panel != null)
{
panel.SetActive(false);
}
});
}
void Try_Load_Select_Scene()
{
if (selectScene_Loading)
@@ -1499,14 +1536,20 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
{
continue;
}
if (cached_Pos.TryGetValue(rect, out Vector2 pos))
{
rect.anchoredPosition = pos;
}
if (cached_Scale.TryGetValue(rect, out Vector3 scale))
{
rect.localScale = scale;
}
if (cached_Pos.TryGetValue(rect, out Vector2 pos))
{
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
{
rect.anchoredPosition = pos;
}
}
if (cached_Scale.TryGetValue(rect, out Vector3 scale))
{
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
{
rect.localScale = scale;
}
}
if (cached_RotationZ.TryGetValue(rect, out float rotZ))
{
Vector3 euler = rect.localEulerAngles;
@@ -1516,19 +1559,23 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
}
if (group_Top != null)
{
group_Top.anchoredPosition = pos_Top + Vector2.up * enter_Offset_Y;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_Top))
group_Top.anchoredPosition = pos_Top + Vector2.up * enter_Offset_Y;
}
if (group_Bottom != null)
{
group_Bottom.anchoredPosition = pos_Bottom - Vector2.up * enter_Offset_Y;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_Bottom))
group_Bottom.anchoredPosition = pos_Bottom - Vector2.up * enter_Offset_Y;
}
if (group_DailyTasks != null)
{
group_DailyTasks.anchoredPosition = pos_Daily + Vector2.left * enter_Offset_X;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_DailyTasks))
group_DailyTasks.anchoredPosition = pos_Daily + Vector2.left * enter_Offset_X;
}
if (group_StartButton != null)
{
group_StartButton.anchoredPosition = pos_Start;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_StartButton))
group_StartButton.anchoredPosition = pos_Start;
}
for (int i = 0; i < top_Items.Count; i++)
@@ -1644,15 +1691,18 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
if (group_Top != null)
{
enter_Sequence.Insert(uiStart, group_Top.DOAnchorPos(pos_Top, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_Top))
enter_Sequence.Insert(uiStart, group_Top.DOAnchorPos(pos_Top, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
}
if (group_Bottom != null)
{
enter_Sequence.Insert(uiStart, group_Bottom.DOAnchorPos(pos_Bottom, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_Bottom))
enter_Sequence.Insert(uiStart, group_Bottom.DOAnchorPos(pos_Bottom, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
}
if (group_DailyTasks != null)
{
enter_Sequence.Insert(uiStart, group_DailyTasks.DOAnchorPos(pos_Daily, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_DailyTasks))
enter_Sequence.Insert(uiStart, group_DailyTasks.DOAnchorPos(pos_Daily, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
}
float topItemsStart = uiStart + enter_Bar_Time_Runtime * 0.6f;
@@ -1837,11 +1887,13 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
if (group_Top != null)
{
group_Top.anchoredPosition = pos_Top + Vector2.up * enter_Offset_Y;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_Top))
group_Top.anchoredPosition = pos_Top + Vector2.up * enter_Offset_Y;
}
if (group_Bottom != null)
{
group_Bottom.anchoredPosition = pos_Bottom - Vector2.up * enter_Offset_Y;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_Bottom))
group_Bottom.anchoredPosition = pos_Bottom - Vector2.up * enter_Offset_Y;
}
for (int i = 0; i < top_Items.Count; i++)
@@ -1865,7 +1917,8 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
bars_Sequence.SetUpdate(true);
bars_Sequence.SetAutoKill(false);
bars_Sequence.OnKill(() => bars_Sequence = null);
bars_Sequence.Append(group_Top.DOAnchorPos(pos_Top, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_Top))
bars_Sequence.Append(group_Top.DOAnchorPos(pos_Top, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
float topItemsStart = bars_Sequence.Duration();
for (int i = 0; i < top_Items.Count; i++)
@@ -1886,7 +1939,8 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
}
float bottomStart = topItemsStart + enter_Bar_Time_Runtime * 0.5f;
bars_Sequence.Insert(bottomStart, group_Bottom.DOAnchorPos(pos_Bottom, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(group_Bottom))
bars_Sequence.Insert(bottomStart, group_Bottom.DOAnchorPos(pos_Bottom, enter_Bar_Time_Runtime).SetEase(enter_Move_Ease));
float bottomItemsStart = bottomStart + enter_Bar_Time_Runtime;
for (int i = 0; i < bottomItems.Count; i++)
@@ -1911,6 +1965,10 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
{
continue;
}
if (UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
{
continue;
}
if (!cached_Pos.TryGetValue(rect, out Vector2 origin))
{
origin = rect.anchoredPosition;
@@ -1946,11 +2004,13 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
}
if (cached_Pos.TryGetValue(rect, out Vector2 pos))
{
rect.anchoredPosition = pos;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
rect.anchoredPosition = pos;
}
if (cached_Scale.TryGetValue(rect, out Vector3 scale))
{
rect.localScale = scale;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
rect.localScale = scale;
}
if (cached_RotationZ.TryGetValue(rect, out float rotZ))
{
@@ -2053,8 +2113,11 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
float rotate = Mathf.Lerp(-bg_Deco_Rotate, bg_Deco_Rotate, Hash01(seed, 3));
float scaleMul = Mathf.Lerp(bg_Deco_Scale_From, bg_Deco_Scale_From + 0.15f, Hash01(seed, 4));
rect.anchoredPosition = cached_Pos[rect] + new Vector2(offsetX, offsetY);
rect.localScale = cached_Scale[rect] * Mathf.Max(0.01f, scaleMul);
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
{
rect.anchoredPosition = cached_Pos[rect] + new Vector2(offsetX, offsetY);
rect.localScale = cached_Scale[rect] * Mathf.Max(0.01f, scaleMul);
}
Vector3 euler = rect.localEulerAngles;
euler.z = cached_RotationZ[rect] + rotate;
rect.localEulerAngles = euler;
@@ -2079,11 +2142,13 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
}
if (cached_Pos.TryGetValue(rect, out Vector2 targetPos))
{
sequence.Insert(at, rect.DOAnchorPos(targetPos, bg_Deco_Time_Runtime).SetEase(bg_Deco_Ease));
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
sequence.Insert(at, rect.DOAnchorPos(targetPos, bg_Deco_Time_Runtime).SetEase(bg_Deco_Ease));
}
if (cached_Scale.TryGetValue(rect, out Vector3 targetScale))
{
sequence.Insert(at, rect.DOScale(targetScale, bg_Deco_Time_Runtime).SetEase(bg_Deco_Ease));
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
sequence.Insert(at, rect.DOScale(targetScale, bg_Deco_Time_Runtime).SetEase(bg_Deco_Ease));
}
if (cached_RotationZ.TryGetValue(rect, out float targetRotZ))
{
@@ -2101,7 +2166,10 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
return;
}
Cache_Pos(rect);
rect.anchoredPosition = cached_Pos[rect] + offset;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
{
rect.anchoredPosition = cached_Pos[rect] + offset;
}
if (fade)
{
CanvasGroup group = Ensure_CanvasGroup(rect.gameObject);
@@ -2127,12 +2195,16 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
{
return;
}
bool layoutSensitive = UI_OrderedEntryAnimator.IsLayoutSensitive(rect);
if (!cached_Pos.TryGetValue(rect, out Vector2 target))
{
target = rect.anchoredPosition;
}
float duration = enter_Item_Time_Runtime > 0f ? enter_Item_Time_Runtime : enter_Item_Time;
sequence.Insert(at, rect.DOAnchorPos(target, duration).SetEase(enter_Move_Ease));
if (!layoutSensitive)
{
sequence.Insert(at, rect.DOAnchorPos(target, duration).SetEase(enter_Move_Ease));
}
if (rect.TryGetComponent(out CanvasGroup group))
{
sequence.Insert(at, group.DOFade(1f, duration).SetEase(enter_Move_Ease));
@@ -2957,6 +3029,10 @@ public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
{
continue;
}
if (UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
{
continue;
}
Vector2 pos = rect.anchoredPosition;
pos.y += delta;
rect.anchoredPosition = pos;
+11 -2
View File
@@ -41,7 +41,7 @@ public class UI_Panel_Note : MonoBehaviour
{
if (Input.GetKeyDown(KeyCode.Escape))
{
gameObject.SetActive(false);
Close();
}
}
private void Awake()
@@ -51,7 +51,13 @@ public class UI_Panel_Note : MonoBehaviour
}
void Close()
{
gameObject.SetActive(false);
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
private void Start()
{
@@ -170,6 +176,7 @@ public class UI_Panel_Note : MonoBehaviour
Character_Data_SO item = data_List[i];
UI_Button_Character btn = null;
btn = Add_Select_Button(item, type_Index >= 2);
UI_OrderedEntryAnimator.PlayFadeOnly(btn.gameObject, i, 0.16f, 0.014f, true);
if (i == 0)
{
btn.Init();
@@ -217,6 +224,7 @@ public class UI_Panel_Note : MonoBehaviour
text_Only.gameObject.SetActive(true);
transform_Description_Content.gameObject.SetActive(false);
text_Only.text = item.data.personalityDescription;
UI_OrderedEntryAnimator.PlayRefresh(text_Only.gameObject, 0.14f, -6f, 0.99f, true);
}
public void Set_Character_Description(Character_Data_SO item)
{
@@ -235,5 +243,6 @@ public class UI_Panel_Note : MonoBehaviour
text_Character_Data.text = data.data.registrationDate;
text_Character_Description.text = data.data.personalityDescription;
scrollbar_Character_Description.value = 1;
UI_OrderedEntryAnimator.PlayRefresh(transform_Description_Content.gameObject, 0.14f, -6f, 0.99f, true);
}
}
+13 -2
View File
@@ -23,7 +23,7 @@ class UI_Panel_Notice : MonoBehaviour
{
if (Input.GetKeyDown(KeyCode.Escape))
{
gameObject.SetActive(false);
ClosePanel();
}
}
void Start()
@@ -48,4 +48,15 @@ class UI_Panel_Notice : MonoBehaviour
}
}
}
private void ClosePanel()
{
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
}
+50 -6
View File
@@ -23,6 +23,7 @@ public class ui_Panel_Setting : MonoBehaviour
private readonly List<RectTransform> enterItems = new List<RectTransform>();
private readonly List<CanvasGroup> enterGroups = new List<CanvasGroup>();
private readonly List<Vector2> enterBasePos = new List<Vector2>();
private readonly List<bool> enterRestoreTransform = new List<bool>();
private Sequence enterSequence;
private void Awake()
@@ -86,6 +87,7 @@ public class ui_Panel_Setting : MonoBehaviour
RectTransform rt = enterItems[i];
CanvasGroup cg = enterGroups[i];
Vector2 basePos = enterBasePos[i];
bool restoreTransform = i < enterRestoreTransform.Count && enterRestoreTransform[i];
if (rt == null || cg == null)
continue;
@@ -93,19 +95,28 @@ public class ui_Panel_Setting : MonoBehaviour
rt.DOKill();
cg.DOKill();
rt.anchoredPosition = basePos - new Vector2(0f, Mathf.Abs(enterOffsetY));
if (restoreTransform)
{
rt.anchoredPosition = basePos - new Vector2(0f, Mathf.Abs(enterOffsetY));
}
cg.alpha = 0f;
float start = i * Mathf.Max(0f, enterItemStagger);
enterSequence.Insert(start,
rt.DOAnchorPos(basePos, Mathf.Max(0.01f, enterItemDuration))
.SetEase(enterEase)
.SetUpdate(true));
if (restoreTransform)
{
enterSequence.Insert(start,
rt.DOAnchorPos(basePos, Mathf.Max(0.01f, enterItemDuration))
.SetEase(enterEase)
.SetUpdate(true));
}
enterSequence.Insert(start,
cg.DOFade(1f, Mathf.Max(0.01f, enterItemDuration))
.SetEase(Ease.OutCubic)
.SetUpdate(true));
}
enterSequence.OnKill(RestoreEnterAnimationState);
enterSequence.OnComplete(RestoreEnterAnimationState);
}
private void CacheEnterItems()
@@ -113,6 +124,7 @@ public class ui_Panel_Setting : MonoBehaviour
enterItems.Clear();
enterGroups.Clear();
enterBasePos.Clear();
enterRestoreTransform.Clear();
for (int i = 0; i < transform.childCount; i++)
{
@@ -131,6 +143,7 @@ public class ui_Panel_Setting : MonoBehaviour
enterItems.Add(rt);
enterGroups.Add(cg);
enterBasePos.Add(rt.anchoredPosition);
enterRestoreTransform.Add(!UI_OrderedEntryAnimator.IsLayoutSensitive(rt));
}
}
@@ -143,8 +156,39 @@ public class ui_Panel_Setting : MonoBehaviour
}
}
private void RestoreEnterAnimationState()
{
for (int i = 0; i < enterItems.Count; i++)
{
RectTransform rt = enterItems[i];
CanvasGroup cg = i < enterGroups.Count ? enterGroups[i] : null;
bool restoreTransform = i < enterRestoreTransform.Count && enterRestoreTransform[i];
if (rt != null)
{
rt.DOKill();
if (restoreTransform && i < enterBasePos.Count)
{
rt.anchoredPosition = enterBasePos[i];
}
}
if (cg != null)
{
cg.DOKill();
cg.alpha = 1f;
}
}
}
void Close()
{
gameObject.SetActive(false);
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
}
+8 -2
View File
@@ -17,6 +17,12 @@ public class UI_Panel_Story : MonoBehaviour
}
void Close()
{
gameObject.SetActive(false);
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
}
}
@@ -0,0 +1,125 @@
using System;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
public static class UI_PanelExitUtility
{
private const float FallbackExitDuration = 0.16f;
private const float FallbackExitScale = 0.96f;
private static readonly HashSet<GameObject> ExitingPanels = new HashSet<GameObject>();
public static bool PlayExitThen(GameObject panel, Action onComplete)
{
if (panel == null || !panel.activeInHierarchy)
{
onComplete?.Invoke();
return false;
}
if (ExitingPanels.Contains(panel))
{
return true;
}
ExitingPanels.Add(panel);
bool completed = false;
Action safeComplete = () =>
{
if (completed)
{
return;
}
completed = true;
ExitingPanels.Remove(panel);
onComplete?.Invoke();
};
DOVirtual.DelayedCall(2.5f, () => safeComplete(), true);
UI_SettingsPanelEnterAnim settingsAnim = panel.GetComponent<UI_SettingsPanelEnterAnim>();
if (settingsAnim != null && settingsAnim.enabled)
{
settingsAnim.PlayExitThen(safeComplete);
return true;
}
UI_PanelPopupTween popupTween = panel.GetComponent<UI_PanelPopupTween>();
if (popupTween != null && popupTween.enabled)
{
popupTween.PlayExitThen(safeComplete);
return true;
}
return PlayFallbackExitThen(panel, safeComplete);
}
private static bool PlayFallbackExitThen(GameObject panel, Action onComplete)
{
RectTransform rect = panel != null ? panel.transform as RectTransform : null;
CanvasGroup group = panel != null ? panel.GetComponent<CanvasGroup>() : null;
if (rect == null && group == null)
{
onComplete?.Invoke();
return false;
}
if (group == null)
{
group = panel.AddComponent<CanvasGroup>();
}
Vector3 baseScale = rect != null ? rect.localScale : Vector3.one;
float baseAlpha = group.alpha;
float duration = Mathf.Max(0.01f, FallbackExitDuration);
bool canScale = rect == null || !UI_OrderedEntryAnimator.IsLayoutSensitive(rect);
if (rect != null)
{
rect.DOKill();
}
group.DOKill();
group.interactable = false;
group.blocksRaycasts = false;
Sequence seq = DOTween.Sequence().SetUpdate(true);
if (rect != null && canScale)
{
seq.Join(rect.DOScale(baseScale * FallbackExitScale, duration).SetEase(Ease.InCubic));
}
seq.Join(group.DOFade(0f, duration).SetEase(Ease.InCubic));
bool restored = false;
Action restore = () =>
{
if (restored)
{
return;
}
restored = true;
if (rect != null && canScale)
{
rect.localScale = baseScale;
}
if (group != null)
{
group.alpha = baseAlpha;
group.interactable = true;
group.blocksRaycasts = true;
}
};
seq.OnComplete(() =>
{
restore();
onComplete?.Invoke();
});
seq.OnKill(() => restore());
return true;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0f3638fba040b34429d7d54c473508b5
@@ -0,0 +1,199 @@
using DG.Tweening;
using UnityEngine;
[DisallowMultipleComponent]
public class UI_PanelPopupTween : MonoBehaviour
{
[SerializeField] private RectTransform moveTarget;
[SerializeField] private CanvasGroup fadeTarget;
[SerializeField] private bool playOnEnable = true;
[SerializeField] private float enterDuration = 0.2f;
[SerializeField] private float exitDuration = 0.16f;
[SerializeField] private float fromOffsetY = 24f;
[SerializeField] private float scaleFrom = 0.96f;
[SerializeField] private Ease enterEase = Ease.OutCubic;
[SerializeField] private Ease exitEase = Ease.InCubic;
[SerializeField] private bool useUnscaledTime = true;
private Sequence enterSequence;
private bool baseCached;
private Vector2 basePos;
private Vector3 baseScale;
private void Awake()
{
AutoWire();
CacheBaseState();
}
private void OnEnable()
{
if (playOnEnable)
{
Play();
}
}
private void OnDisable()
{
KillTween();
ResetToBase();
}
public void Play()
{
AutoWire();
CacheBaseState();
if (moveTarget == null || fadeTarget == null)
{
return;
}
KillTween();
Vector2 fromPos = basePos + new Vector2(0f, -Mathf.Abs(fromOffsetY));
bool canAnimateTransform = !UI_OrderedEntryAnimator.IsLayoutSensitive(moveTarget);
if (canAnimateTransform)
{
moveTarget.anchoredPosition = fromPos;
moveTarget.localScale = baseScale * Mathf.Max(0.01f, scaleFrom);
}
fadeTarget.alpha = 0f;
fadeTarget.interactable = false;
fadeTarget.blocksRaycasts = false;
float duration = Mathf.Max(0.01f, enterDuration);
enterSequence = DOTween.Sequence().SetUpdate(useUnscaledTime);
if (canAnimateTransform)
{
enterSequence.Join(moveTarget.DOAnchorPos(basePos, duration).SetEase(enterEase));
enterSequence.Join(moveTarget.DOScale(baseScale, duration).SetEase(enterEase));
}
enterSequence.Join(fadeTarget.DOFade(1f, duration).SetEase(Ease.OutCubic));
enterSequence.OnComplete(() =>
{
fadeTarget.interactable = true;
fadeTarget.blocksRaycasts = true;
enterSequence = null;
});
enterSequence.OnKill(() =>
{
ResetToBase();
enterSequence = null;
});
}
public void PlayExitThen(System.Action onComplete)
{
AutoWire();
CacheBaseState();
if (moveTarget == null || fadeTarget == null)
{
onComplete?.Invoke();
return;
}
KillTween();
fadeTarget.interactable = false;
fadeTarget.blocksRaycasts = false;
Vector2 targetPos = basePos + new Vector2(0f, -Mathf.Abs(fromOffsetY));
Vector3 targetScale = baseScale * Mathf.Max(0.01f, scaleFrom);
float duration = Mathf.Max(0.01f, exitDuration);
bool canAnimateTransform = !UI_OrderedEntryAnimator.IsLayoutSensitive(moveTarget);
enterSequence = DOTween.Sequence().SetUpdate(useUnscaledTime);
if (canAnimateTransform)
{
enterSequence.Join(moveTarget.DOAnchorPos(targetPos, duration).SetEase(exitEase));
enterSequence.Join(moveTarget.DOScale(targetScale, duration).SetEase(exitEase));
}
enterSequence.Join(fadeTarget.DOFade(0f, duration).SetEase(Ease.InCubic));
enterSequence.OnComplete(() =>
{
enterSequence = null;
ResetToBase();
onComplete?.Invoke();
});
enterSequence.OnKill(() =>
{
ResetToBase();
enterSequence = null;
});
}
private void AutoWire()
{
if (moveTarget == null)
{
moveTarget = transform as RectTransform;
if (moveTarget == null)
{
moveTarget = GetComponentInChildren<RectTransform>(true);
}
}
if (fadeTarget == null)
{
fadeTarget = GetComponent<CanvasGroup>();
}
if (fadeTarget == null)
{
fadeTarget = gameObject.AddComponent<CanvasGroup>();
}
}
private void CacheBaseState()
{
if (moveTarget == null || baseCached)
{
return;
}
basePos = moveTarget.anchoredPosition;
baseScale = moveTarget.localScale;
baseCached = true;
}
private void ResetToBase()
{
if (moveTarget != null && baseCached)
{
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(moveTarget))
{
moveTarget.anchoredPosition = basePos;
moveTarget.localScale = baseScale;
}
}
if (fadeTarget != null)
{
fadeTarget.alpha = 1f;
fadeTarget.interactable = true;
fadeTarget.blocksRaycasts = true;
}
}
private void KillTween()
{
if (enterSequence != null)
{
enterSequence.Kill();
enterSequence = null;
}
if (moveTarget != null)
{
moveTarget.DOKill();
}
if (fadeTarget != null)
{
fadeTarget.DOKill();
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 684368a613daac84599aaf0ef6b4c77a
@@ -8,8 +8,10 @@ public class UI_SettingsPanelEnterAnim : MonoBehaviour
[SerializeField] private CanvasGroup fadeTarget;
[SerializeField] private bool playOnEnable = true;
[SerializeField] private float enterDuration = 0.3f;
[SerializeField] private float exitDuration = 0.18f;
[SerializeField] private float fromOffsetY = 32f;
[SerializeField] private Ease enterEase = Ease.OutCubic;
[SerializeField] private Ease exitEase = Ease.InCubic;
[SerializeField] private bool useUnscaledTime = true;
private Sequence enterSequence;
@@ -44,13 +46,20 @@ public class UI_SettingsPanelEnterAnim : MonoBehaviour
KillTween();
moveTarget.anchoredPosition = basePos - new Vector2(0f, Mathf.Abs(fromOffsetY));
bool canAnimateTransform = !UI_OrderedEntryAnimator.IsLayoutSensitive(moveTarget);
if (canAnimateTransform)
{
moveTarget.anchoredPosition = basePos - new Vector2(0f, Mathf.Abs(fromOffsetY));
}
fadeTarget.alpha = 0f;
fadeTarget.interactable = false;
fadeTarget.blocksRaycasts = false;
enterSequence = DOTween.Sequence().SetUpdate(useUnscaledTime);
enterSequence.Join(moveTarget.DOAnchorPos(basePos, Mathf.Max(0.01f, enterDuration)).SetEase(enterEase));
if (canAnimateTransform)
{
enterSequence.Join(moveTarget.DOAnchorPos(basePos, Mathf.Max(0.01f, enterDuration)).SetEase(enterEase));
}
enterSequence.Join(fadeTarget.DOFade(1f, Mathf.Max(0.01f, enterDuration)).SetEase(Ease.OutCubic));
enterSequence.OnComplete(() =>
{
@@ -58,6 +67,50 @@ public class UI_SettingsPanelEnterAnim : MonoBehaviour
fadeTarget.blocksRaycasts = true;
enterSequence = null;
});
enterSequence.OnKill(() =>
{
ResetToBase();
enterSequence = null;
});
}
public void PlayExitThen(System.Action onComplete)
{
AutoWire();
CacheBasePos();
if (moveTarget == null || fadeTarget == null)
{
onComplete?.Invoke();
return;
}
KillTween();
fadeTarget.interactable = false;
fadeTarget.blocksRaycasts = false;
Vector2 targetPos = basePos - new Vector2(0f, Mathf.Abs(fromOffsetY));
float duration = Mathf.Max(0.01f, exitDuration);
bool canAnimateTransform = !UI_OrderedEntryAnimator.IsLayoutSensitive(moveTarget);
enterSequence = DOTween.Sequence().SetUpdate(useUnscaledTime);
if (canAnimateTransform)
{
enterSequence.Join(moveTarget.DOAnchorPos(targetPos, duration).SetEase(exitEase));
}
enterSequence.Join(fadeTarget.DOFade(0f, duration).SetEase(Ease.InCubic));
enterSequence.OnComplete(() =>
{
enterSequence = null;
ResetToBase();
onComplete?.Invoke();
});
enterSequence.OnKill(() =>
{
ResetToBase();
enterSequence = null;
});
}
private void AutoWire()
@@ -90,7 +143,10 @@ public class UI_SettingsPanelEnterAnim : MonoBehaviour
private void ResetToBase()
{
if (moveTarget != null && basePosCached)
moveTarget.anchoredPosition = basePos;
{
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(moveTarget))
moveTarget.anchoredPosition = basePos;
}
if (fadeTarget != null)
{
@@ -1027,13 +1027,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
settingsInstance.SetActive(true);
EnsureSettingsLastSibling();
RegisterManagedPanel(settingsInstance, () =>
{
if (settingsInstance != null)
{
settingsInstance.SetActive(false);
}
});
RegisterManagedPanel(settingsInstance, CloseSettingsWithExitAnim);
NotifyManagedPanelVisibilityChanged(true);
return;
}
@@ -1043,23 +1037,41 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
settingsInstance.transform.SetParent(GetSettingsParentTransform(), false);
EnsureSettingsLastSibling();
// Toggle active state
bool active = settingsInstance.activeSelf;
settingsInstance.SetActive(!active);
if (active)
{
CloseSettingsWithExitAnim();
return;
}
settingsInstance.SetActive(true);
if (settingsInstance.activeSelf)
{
EnsureSettingsLastSibling();
RegisterManagedPanel(settingsInstance, () =>
{
if (settingsInstance != null)
{
settingsInstance.SetActive(false);
}
});
RegisterManagedPanel(settingsInstance, CloseSettingsWithExitAnim);
}
NotifyManagedPanelVisibilityChanged(true);
}
private void CloseSettingsWithExitAnim()
{
if (settingsInstance == null)
{
NotifyManagedPanelVisibilityChanged(true);
return;
}
UI_PanelExitUtility.PlayExitThen(settingsInstance, () =>
{
if (settingsInstance != null)
{
settingsInstance.SetActive(false);
}
NotifyManagedPanelVisibilityChanged(true);
});
}
public bool IsSettingsPanelVisible
{
get { return settingsInstance != null && settingsInstance.activeInHierarchy; }
@@ -1201,8 +1213,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
return;
}
instance.SetActive(false);
BroadcastOverlayPanelsVisibility();
CloseManagedOverlayWithExitAnim(instance);
}
private bool ToggleIfAlreadyOpen(ref GameObject instance)
@@ -1217,8 +1228,7 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
return false;
}
instance.SetActive(false);
BroadcastOverlayPanelsVisibility();
CloseManagedOverlayWithExitAnim(instance);
return true;
}
@@ -1250,12 +1260,34 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
}
AttachManagedPanelVisibilityRelay(instance, false);
EnsurePanelPopupTween(instance);
TryAssignCanvasCamera(instance);
BroadcastOverlayPanelsVisibility();
EnsureTopNavigationFront();
return true;
}
private UI_PanelPopupTween EnsurePanelPopupTween(GameObject instance)
{
if (instance == null)
{
return null;
}
if (instance.GetComponent<UI_SettingsPanelEnterAnim>() != null)
{
return null;
}
UI_PanelPopupTween popupTween = instance.GetComponent<UI_PanelPopupTween>();
if (popupTween == null)
{
popupTween = instance.AddComponent<UI_PanelPopupTween>();
}
return popupTween;
}
private void EnsureSettingsLastSibling()
{
if (settingsInstance == null || GetSettingsParentTransform() == null)
@@ -1296,8 +1328,25 @@ public class btmandtopController : MonoBehaviour, ICancelHandler
private void CloseInstance(ref GameObject instance, GameObject keep)
{
if (instance == null || instance == keep) return;
instance.SetActive(false);
BroadcastOverlayPanelsVisibility();
CloseManagedOverlayWithExitAnim(instance);
}
private void CloseManagedOverlayWithExitAnim(GameObject instance)
{
if (instance == null)
{
return;
}
UI_PanelExitUtility.PlayExitThen(instance, () =>
{
if (instance != null)
{
instance.SetActive(false);
}
BroadcastOverlayPanelsVisibility();
});
}
private GameObject FindExistingInstance(GameObject prefab)
+17 -3
View File
@@ -15,7 +15,20 @@ public class MusicPlayer : MonoBehaviour
public Button Button_List;
public Slider Slider_Progress;
public Music_Data Music_Data => Music_Mgr.Singleton.Music_Cur;
public static AudioSource Music_Source => Music_Mgr.Singleton.AudioSource;
public static AudioSource Music_Source
{
get
{
BgmPlaybackManager bgm = BgmPlaybackManager.Instance;
if (bgm != null && bgm.audioSource != null)
{
return bgm.audioSource;
}
Music_Mgr manager = Music_Mgr.Singleton;
return manager != null ? manager.AudioSource : null;
}
}
private void Start()
{
if (Music_Data != null)
@@ -32,10 +45,11 @@ public class MusicPlayer : MonoBehaviour
private void Update()
{
if (Music_Source.clip != null)
AudioSource source = Music_Source;
if (source != null && source.clip != null)
{
_sb.Clear();
_sb.Append(Music_Mgr.Get_Time_Cur(Music_Source)).Append("/").Append(Music_Mgr.Get_Time_Max(Music_Source.clip));
_sb.Append(Music_Mgr.Get_Time_Cur(source)).Append("/").Append(Music_Mgr.Get_Time_Max(source.clip));
Text_Time.text = _sb.ToString();
}
}
+44 -1
View File
@@ -113,16 +113,30 @@ public class Music_Mgr : Singleton_Mono<Music_Mgr>
public void Play(Music_Data data)
{
if (data == null) return;
Music_Cur = data;
if (!ShouldPlayInScene(SceneManager.GetActiveScene().name))
{
StopMusicPlayback();
return;
}
Music_Cur = data;
if (TryPlayThroughBgmManager(data, true))
{
StopMusicPlayback();
RefreshPlayers(data);
return;
}
AudioSource.clip = data.Clip;
AudioSource.Play();
RefreshPlayers(data);
}
private void RefreshPlayers(Music_Data data)
{
var players = Object.FindObjectsByType<MusicPlayer>(FindObjectsInactive.Include, FindObjectsSortMode.None);
foreach (var player in players)
{
@@ -176,6 +190,18 @@ public class Music_Mgr : Singleton_Mono<Music_Mgr>
return;
}
if (Music_Cur == null && Music_Data_List != null && Music_Data_List.Count > 0)
{
Music_Cur = Music_Data_List[0];
}
if (Music_Cur != null && TryPlayThroughBgmManager(Music_Cur, false))
{
StopMusicPlayback();
RefreshPlayers(Music_Cur);
return;
}
if (AudioSource != null && !AudioSource.isPlaying)
{
if (Music_Cur != null)
@@ -196,4 +222,21 @@ public class Music_Mgr : Singleton_Mono<Music_Mgr>
AudioSource.Stop();
}
}
private bool TryPlayThroughBgmManager(Music_Data data, bool restart)
{
if (data == null || data.Clip == null)
{
return false;
}
BgmPlaybackManager bgm = BgmPlaybackManager.Instance;
if (bgm == null)
{
return false;
}
bgm.PlayExternalClip(data.Clip, restart);
return true;
}
}
@@ -26,7 +26,7 @@ public class UI_Panel_Music : MonoBehaviour
{
if (Input.GetKeyDown(KeyCode.Escape))
{
gameObject.SetActive(false);
ClosePanel();
}
}
private void Start()
@@ -57,12 +57,21 @@ public class UI_Panel_Music : MonoBehaviour
music_Data_List = Get_Music_Page(index);
foreach (var item in music_Data_List)
for (int i = 0; i < music_Data_List.Count; i++)
{
var item = music_Data_List[i];
var slot = Instantiate(prefab_Music_Slot, group_Music.transform);
UISystemBootstrap.RegisterHierarchy(slot.gameObject);
slot.Refresh(item);
music_Slot_List.Add(slot);
UI_OrderedEntryAnimator.PlayFadeOnly(slot.gameObject, i, 0.16f, 0.018f, true);
}
if (group_Music != null)
{
Canvas.ForceUpdateCanvases();
LayoutRebuilder.ForceRebuildLayoutImmediate(group_Music.transform as RectTransform);
Canvas.ForceUpdateCanvases();
}
}
public List<Music_Data> Get_Music_Page(int index)
@@ -79,4 +88,15 @@ public class UI_Panel_Music : MonoBehaviour
return list;
}
private void ClosePanel()
{
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
gameObject.SetActive(false);
}
});
}
}
+185 -8
View File
@@ -6,6 +6,82 @@ using UnityEngine.UI;
public static class UI_OrderedEntryAnimator
{
public static Sequence PlaySingle(
GameObject target,
int orderIndex = 0,
float duration = 0.22f,
float stagger = 0.018f,
float fromYOffset = -18f,
float fromScale = 0.96f,
bool useUnscaledTime = true,
bool forceFadeOnly = false)
{
if (target == null || !target.activeInHierarchy) return null;
RectTransform rect = target.transform as RectTransform;
if (rect == null) rect = target.GetComponent<RectTransform>();
if (rect == null) return null;
DOTween.Kill(target);
CanvasGroup group = target.GetComponent<CanvasGroup>();
if (group == null) group = target.AddComponent<CanvasGroup>();
rect.DOKill();
group.DOKill();
float safeDuration = Mathf.Max(0.01f, duration);
float delay = Mathf.Max(0f, stagger) * Mathf.Max(0, orderIndex);
Vector2 basePos = rect.anchoredPosition;
Vector3 baseScale = rect.localScale;
float targetAlpha = group.alpha <= 0f ? 1f : group.alpha;
bool layoutControlled = forceFadeOnly || IsLayoutSensitive(rect);
if (!layoutControlled)
{
rect.anchoredPosition = basePos + new Vector2(0f, fromYOffset);
rect.localScale = baseScale * Mathf.Max(0.01f, fromScale);
}
group.alpha = 0f;
Sequence sequence = DOTween.Sequence().SetUpdate(useUnscaledTime).SetTarget(target);
sequence.SetDelay(delay);
if (!layoutControlled)
{
sequence.Join(rect.DOAnchorPos(basePos, safeDuration).SetEase(Ease.OutCubic).SetUpdate(useUnscaledTime));
sequence.Join(rect.DOScale(baseScale, safeDuration).SetEase(Ease.OutBack).SetUpdate(useUnscaledTime));
}
sequence.Join(group.DOFade(targetAlpha, safeDuration).SetEase(Ease.OutCubic).SetUpdate(useUnscaledTime));
sequence.OnKill(() => Restore(rect, group, basePos, baseScale, targetAlpha, !layoutControlled));
sequence.OnComplete(() => Restore(rect, group, basePos, baseScale, targetAlpha, !layoutControlled));
return sequence;
}
public static Sequence PlayRefresh(
GameObject target,
float duration = 0.18f,
float fromYOffset = -10f,
float fromScale = 0.985f,
bool useUnscaledTime = true)
{
return PlaySingle(target, 0, duration, 0f, fromYOffset, fromScale, useUnscaledTime);
}
public static Sequence PlayFadeOnly(
GameObject target,
int orderIndex = 0,
float duration = 0.18f,
float stagger = 0.012f,
bool useUnscaledTime = true)
{
return PlaySingle(target, orderIndex, duration, stagger, 0f, 1f, useUnscaledTime, true);
}
public static Sequence PlayRefresh(Component target, float duration = 0.18f, float fromYOffset = -10f, float fromScale = 0.985f, bool useUnscaledTime = true)
{
return target != null ? PlayRefresh(target.gameObject, duration, fromYOffset, fromScale, useUnscaledTime) : null;
}
public static Sequence Play(
Transform root,
float itemDuration,
@@ -24,6 +100,7 @@ public static class UI_OrderedEntryAnimator
float duration = Mathf.Max(0.01f, itemDuration);
float stagger = Mathf.Max(0f, itemStagger);
Sequence sequence = DOTween.Sequence().SetUpdate(useUnscaledTime);
List<AnimState> states = new List<AnimState>(targets.Count);
for (int i = 0; i < targets.Count; i++)
{
@@ -37,19 +114,111 @@ public static class UI_OrderedEntryAnimator
group.DOKill();
Vector2 basePos = rt.anchoredPosition;
Vector3 baseScale = rt.localScale;
float baseAlpha = group.alpha <= 0f ? 1f : group.alpha;
bool layoutControlled = IsLayoutSensitive(rt);
states.Add(new AnimState(rt, group, basePos, baseScale, baseAlpha, !layoutControlled));
rt.anchoredPosition = basePos + fromOffset;
if (!layoutControlled)
{
rt.anchoredPosition = basePos + fromOffset;
}
group.alpha = 0f;
float startAt = i * stagger;
sequence.Insert(startAt, rt.DOAnchorPos(basePos, duration).SetEase(Ease.OutCubic).SetUpdate(useUnscaledTime));
if (!layoutControlled)
{
sequence.Insert(startAt, rt.DOAnchorPos(basePos, duration).SetEase(Ease.OutCubic).SetUpdate(useUnscaledTime));
}
sequence.Insert(startAt, group.DOFade(baseAlpha, duration).SetEase(Ease.OutCubic).SetUpdate(useUnscaledTime));
}
sequence.OnKill(() => RestoreAll(states));
sequence.OnComplete(() => RestoreAll(states));
return sequence;
}
private struct AnimState
{
public RectTransform Rect;
public CanvasGroup Group;
public Vector2 AnchoredPosition;
public Vector3 Scale;
public float Alpha;
public bool RestoreTransform;
public AnimState(RectTransform rect, CanvasGroup group, Vector2 anchoredPosition, Vector3 scale, float alpha, bool restoreTransform)
{
Rect = rect;
Group = group;
AnchoredPosition = anchoredPosition;
Scale = scale;
Alpha = alpha;
RestoreTransform = restoreTransform;
}
}
private static void RestoreAll(List<AnimState> states)
{
if (states == null)
{
return;
}
for (int i = 0; i < states.Count; i++)
{
AnimState state = states[i];
Restore(state.Rect, state.Group, state.AnchoredPosition, state.Scale, state.Alpha, state.RestoreTransform);
}
}
private static void Restore(RectTransform rect, CanvasGroup group, Vector2 anchoredPosition, Vector3 scale, float alpha, bool restoreTransform)
{
if (restoreTransform && rect != null)
{
rect.anchoredPosition = anchoredPosition;
rect.localScale = scale;
}
if (group != null)
{
group.alpha = alpha;
}
}
public static bool IsLayoutSensitive(RectTransform rect)
{
if (rect == null)
{
return false;
}
if (rect.GetComponent<LayoutGroup>() != null || rect.GetComponent<ContentSizeFitter>() != null)
{
return true;
}
Transform current = rect;
while (current != null && current.parent != null)
{
Transform parent = current.parent;
if (parent.GetComponent<LayoutGroup>() != null)
{
return true;
}
RectTransform currentRect = current as RectTransform;
if (currentRect != null && currentRect.GetComponent<LayoutElement>() != null && parent.GetComponent<ContentSizeFitter>() != null)
{
return true;
}
current = parent;
}
return false;
}
public static Sequence PlayKeyDownFlash(
Transform keyDownRoot,
bool useUnscaledTime,
@@ -122,15 +291,23 @@ public static class UI_OrderedEntryAnimator
{
Transform child = parent.GetChild(i);
if (child == null) continue;
stack.Push(child);
RectTransform rt = child as RectTransform;
if (rt == null || !child.gameObject.activeInHierarchy) continue;
if (includePredicate != null && !includePredicate(rt)) continue;
if (!IsPanelLike(child)) continue;
if (!seen.Add(rt)) continue;
bool canConsider = rt != null && child.gameObject.activeInHierarchy;
bool included = false;
if (canConsider
&& (includePredicate == null || includePredicate(rt))
&& IsPanelLike(child)
&& seen.Add(rt))
{
list.Add(rt);
included = true;
}
list.Add(rt);
if (!included || !IsLayoutSensitive(rt))
{
stack.Push(child);
}
}
}
+13 -3
View File
@@ -8,8 +8,13 @@ public class UI_Show_Anim : MonoBehaviour
private void OnEnable()
{
Clear();
transform.localScale = Vector3.zero;
transform.DOScale(1, animTime_Scale).SetUpdate(true);
RectTransform rect = transform as RectTransform;
bool canScale = rect == null || !UI_OrderedEntryAnimator.IsLayoutSensitive(rect);
if (canScale)
{
transform.localScale = Vector3.zero;
transform.DOScale(1, animTime_Scale).SetUpdate(true);
}
if (gameObject.Try_Get_Component(out CanvasGroup canvasGroup))
{
@@ -23,7 +28,12 @@ public class UI_Show_Anim : MonoBehaviour
public void Close()
{
Clear();
transform.DOScale(0, animTime_Scale).SetUpdate(true);
RectTransform rect = transform as RectTransform;
bool canScale = rect == null || !UI_OrderedEntryAnimator.IsLayoutSensitive(rect);
if (canScale)
{
transform.DOScale(0, animTime_Scale).SetUpdate(true);
}
if (gameObject.Try_Get_Component(out CanvasGroup canvasGroup))
{
float a = 1;
@@ -144,7 +144,13 @@ public class UnimplementedFeaturePrompt : MonoBehaviour
flashRoutine = null;
}
if (root != null)
root.SetActive(false);
{
UI_PanelExitUtility.PlayExitThen(root, () =>
{
if (root != null)
root.SetActive(false);
});
}
}
private void BindOkayButton()
@@ -107,6 +107,7 @@ public class loadLittleGamesPrefab : MonoBehaviour
}
GameObject item = Instantiate(littleGames_card_Prefab, target.transform);
UI_OrderedEntryAnimator.PlayFadeOnly(item, target.transform.childCount - 1, 0.16f, 0.014f, true);
var card = item.GetComponent<game_card_Prefab>();
if (card == null)
continue;
@@ -0,0 +1,157 @@
using System.Collections.Generic;
using UnityEngine;
public static class AllyHeroLevelRuntimeResolver
{
public static int GetCurrentExp(AllyHero_SO hero)
{
if (hero == null)
{
return 0;
}
if (hero.ally_heroID <= 0)
{
return Mathf.Max(0, hero.ally_currentEXP);
}
return AllyHeroDeployLedger.EnsureInstance().GetCurrentExp(hero.ally_heroID);
}
public static int GetUnlockedTierIndex(AllyHero_SO hero)
{
if (hero == null)
{
return 0;
}
if (hero.ally_heroID <= 0)
{
return Mathf.Clamp(hero.ally_growthUnlockedTierIndex, 0, 3);
}
return AllyHeroDeployLedger.EnsureInstance().GetUnlockedTierIndex(hero.ally_heroID);
}
public static string GetDisplayRatingKey(AllyHero_SO hero)
{
if (hero == null)
{
return "C";
}
if (hero.ally_heroID <= 0)
{
return hero.GetDisplayLevelRatingKey();
}
AllyHeroDeployLedger ledger = AllyHeroDeployLedger.EnsureInstance();
int currentExp = ledger.GetCurrentExp(hero.ally_heroID);
int unlockedTier = ledger.GetUnlockedTierIndex(hero.ally_heroID);
bool levelLocked = ledger.IsLevelLockEnabled(hero.ally_heroID);
return hero.GetDisplayLevelRatingKeyFromGrowth(currentExp, unlockedTier, levelLocked);
}
public static AllyHero_SO.AllyLevelInfo GetBaseLevelInfo(AllyHero_SO hero)
{
if (hero == null)
{
return null;
}
List<AllyHero_SO.AllyLevelInfo> levels = GetSortedLevels(hero);
if (levels == null || levels.Count == 0)
{
return null;
}
int currentExp = GetCurrentExp(hero);
int expQualifiedIndex = 0;
for (int i = 0; i < levels.Count; i++)
{
AllyHero_SO.AllyLevelInfo level = levels[i];
if (level != null && currentExp >= level.requiredEXP)
{
expQualifiedIndex = i;
}
else
{
break;
}
}
int unlockedIndex = Mathf.Clamp(GetUnlockedTierIndex(hero), 0, levels.Count - 1);
int effectiveIndex = Mathf.Clamp(Mathf.Min(expQualifiedIndex, unlockedIndex), 0, levels.Count - 1);
return levels[effectiveIndex];
}
public static AllyHero_SO.AllyLevelInfo GetEffectiveLevelInfo(AllyHero_SO hero)
{
AllyHero_SO.AllyLevelInfo baseInfo = GetBaseLevelInfo(hero);
if (hero == null || baseInfo == null)
{
return null;
}
AllyHero_SO.AllyLevelInfo resolved = hero.GetEffectiveLevelInfoWithEquipment(baseInfo);
if (resolved != null)
{
resolved.skill_slot_limited = GetEffectiveSkillSlotLimit(hero);
}
return resolved;
}
public static int GetCurrentLevelId(AllyHero_SO hero)
{
AllyHero_SO.AllyLevelInfo levelInfo = GetBaseLevelInfo(hero);
return levelInfo != null ? levelInfo.levelID : 0;
}
public static int GetCurrentTierNumber(AllyHero_SO hero)
{
return Mathf.Clamp(GetUnlockedTierIndex(hero) + 1, 1, 4);
}
public static int GetEffectiveSkillSlotLimit(AllyHero_SO hero)
{
if (hero == null)
{
return 0;
}
AllyHero_SO.AllyLevelInfo baseInfo = GetBaseLevelInfo(hero);
int baseSlotLimit = baseInfo != null ? Mathf.Max(0, baseInfo.skill_slot_limited) : 0;
// Preserve equipment-only slot bonuses from the existing SO method, while replacing its base level source with the ledger.
AllyHero_SO.AllyLevelInfo soLevelInfo = hero.GetEffectiveLevelForCurrentEXP();
int soBaseSlotLimit = soLevelInfo != null ? Mathf.Max(0, soLevelInfo.skill_slot_limited) : 0;
int equipmentExtraSlots = Mathf.Max(0, hero.GetEffectiveSkillSlotLimit() - soBaseSlotLimit);
return baseSlotLimit + equipmentExtraSlots;
}
private static List<AllyHero_SO.AllyLevelInfo> GetSortedLevels(AllyHero_SO hero)
{
if (hero == null || hero.levelStats == null || hero.levelStats.Count == 0)
{
return null;
}
List<AllyHero_SO.AllyLevelInfo> levels = new List<AllyHero_SO.AllyLevelInfo>();
for (int i = 0; i < hero.levelStats.Count; i++)
{
if (hero.levelStats[i] != null)
{
levels.Add(hero.levelStats[i]);
}
}
if (levels.Count == 0)
{
return null;
}
levels.Sort((left, right) => left.requiredEXP.CompareTo(right.requiredEXP));
return levels;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 43c18dd44fb2b8d42b10b601d61de53e
@@ -42,6 +42,7 @@ public class dailyTaskManager : MonoBehaviour
private readonly List<GameObject> spawnedTaskItems = new List<GameObject>();
private readonly Dictionary<int, Sprite> rewardSpriteByItemId = new Dictionary<int, Sprite>();
private readonly Dictionary<int, storeItemSO> rewardStoreItemByItemId = new Dictionary<int, storeItemSO>();
private Coroutine layoutRefreshRoutine;
private void Start()
{
@@ -105,6 +106,7 @@ public class dailyTaskManager : MonoBehaviour
UpdateTodayProgress(tasks.Count, completedCount);
RefreshOneKeyRewardButtonState(tasks);
RefreshTaskButtonState();
RequestTaskListLayoutRebuild();
}
private void SpawnTaskItem(int index, DailyTaskViewData taskView)
@@ -116,6 +118,7 @@ public class dailyTaskManager : MonoBehaviour
var instance = Instantiate(dailyTaskItemPrefab, dailyTaskItemParent);
spawnedTaskItems.Add(instance);
UI_OrderedEntryAnimator.PlayFadeOnly(instance, index, 0.16f, 0.012f, true);
var controller = instance.GetComponent<taskPrefabController>();
if (controller == null)
@@ -309,6 +312,48 @@ public class dailyTaskManager : MonoBehaviour
refreshTaskBtn.interactable = taskPool != null && DailyTaskService.EnsureInstance().GetRemainingRefreshCount() > 0;
}
private void RequestTaskListLayoutRebuild()
{
if (dailyTaskItemParent == null)
{
return;
}
if (layoutRefreshRoutine != null)
{
StopCoroutine(layoutRefreshRoutine);
layoutRefreshRoutine = null;
}
if (isActiveAndEnabled)
{
layoutRefreshRoutine = StartCoroutine(RebuildTaskListLayoutNextFrame());
return;
}
RebuildTaskListLayoutNow();
}
private System.Collections.IEnumerator RebuildTaskListLayoutNextFrame()
{
yield return null;
RebuildTaskListLayoutNow();
layoutRefreshRoutine = null;
}
private void RebuildTaskListLayoutNow()
{
RectTransform target = dailyTaskItemParent as RectTransform;
if (target == null)
{
return;
}
Canvas.ForceUpdateCanvases();
LayoutRebuilder.ForceRebuildLayoutImmediate(target);
Canvas.ForceUpdateCanvases();
}
private Sprite ResolveRewardSprite(userTasksPool.TaskDefinition definition)
{
if (definition == null)
@@ -41,6 +41,7 @@ public class friendCardPrefab : MonoBehaviour
private bool _bindingToggle;
private Sprite _defaultProfileBorderSprite;
private bool _subscribedToChatState;
private FriendCardViewData _boundData;
private void Awake()
{
@@ -53,6 +54,7 @@ public class friendCardPrefab : MonoBehaviour
{
SubscribeChatState();
RefreshChattingVisual();
EnsureAvatarLoadStarted();
}
private void OnDestroy()
@@ -69,11 +71,18 @@ public class friendCardPrefab : MonoBehaviour
private void OnDisable()
{
if (_avatarLoadRoutine != null)
{
StopCoroutine(_avatarLoadRoutine);
_avatarLoadRoutine = null;
}
UnsubscribeChatState();
}
public void Bind(FriendCardViewData data, Action<string, bool> onStarChanged, Action<string> onOpenDetails, Action<string> onOpenPrivateConversation)
{
_boundData = data;
_steamId = data != null ? data.SteamId : string.Empty;
_starChanged = onStarChanged;
_openDetails = onOpenDetails;
@@ -115,12 +124,36 @@ public class friendCardPrefab : MonoBehaviour
if (_avatarLoadRoutine != null)
{
StopCoroutine(_avatarLoadRoutine);
_avatarLoadRoutine = null;
}
_avatarLoadRoutine = StartCoroutine(LoadAvatarRoutine(data));
EnsureAvatarLoadStarted();
RefreshChattingVisual();
}
private void EnsureAvatarLoadStarted()
{
if (friendProfile == null || _boundData == null)
{
return;
}
if (_avatarLoadRoutine != null)
{
return;
}
if (isActiveAndEnabled)
{
_avatarLoadRoutine = StartCoroutine(LoadAvatarRoutine(_boundData));
}
else
{
ApplyCachedAvatarIfAvailable(_boundData);
}
}
private void HandleStarToggleChanged(bool isOn)
{
if (_bindingToggle)
@@ -256,6 +289,20 @@ public class friendCardPrefab : MonoBehaviour
_avatarLoadRoutine = null;
}
private void ApplyCachedAvatarIfAvailable(FriendCardViewData data)
{
if (friendProfile == null || data == null)
{
return;
}
string resolvedAvatarUrl = NetworkManager.ResolveAvatarUrl(data.AvatarUrl, data.SteamId);
if (playerMessagePrefab.TryGetCachedAvatarSprite(data.SteamId, resolvedAvatarUrl, out Sprite cachedSprite) && cachedSprite != null)
{
friendProfile.sprite = cachedSprite;
}
}
private IEnumerator LoadSteamAvatarRoutine(string steamId)
{
#if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX)
@@ -458,10 +458,12 @@ public class friendSystem : MonoBehaviour
for (int index = 0; index < target.Count; index++)
{
FriendCardViewData friend = target[index];
bool created = false;
if (!_spawnedCards.TryGetValue(friend.SteamId, out GameObject cardObject) || cardObject == null)
{
cardObject = Instantiate(friendCardPrefab, friendsDisplayContent);
_spawnedCards[friend.SteamId] = cardObject;
created = true;
}
cardObject.transform.SetSiblingIndex(index);
@@ -470,6 +472,11 @@ public class friendSystem : MonoBehaviour
{
card.Bind(friend, HandleStarChanged, HandleOpenDetails, HandleOpenPrivateConversation);
}
if (created)
{
UI_OrderedEntryAnimator.PlayFadeOnly(cardObject, index, 0.16f, 0.012f, true);
}
}
UpdateDefaultTextState(target.Count);
@@ -203,6 +203,7 @@ public class friendsManager : MonoBehaviour
}
_spawnedSearchCard = Instantiate(friendSearchPrefab, friendSearchParent, false);
UI_OrderedEntryAnimator.PlayFadeOnly(_spawnedSearchCard, 0, 0.16f, 0f, true);
friendSearchPrefab prefab = _spawnedSearchCard.GetComponent<friendSearchPrefab>();
if (prefab != null)
{
@@ -370,6 +371,7 @@ public class friendsManager : MonoBehaviour
GameObject cardObject = Instantiate(friendRequestPrefab, parent, false);
_spawnedRequestCards[request.id] = cardObject;
cardObject.transform.SetSiblingIndex(index);
UI_OrderedEntryAnimator.PlayFadeOnly(cardObject, index, 0.16f, 0.012f, true);
friendRequestPrefab prefab = cardObject.GetComponent<friendRequestPrefab>();
if (prefab != null)
{
+39 -24
View File
@@ -642,18 +642,7 @@ public class GameManager : MonoBehaviour
// btm fade out at last
yield return StartCoroutine(FadeCanvasGroupAlpha(startup_btmCg, 1f, 0f, startCanvasBtmFadeOut, false));
cg_startCanvas.alpha = 0f;
cg_startCanvas.interactable = false;
cg_startCanvas.blocksRaycasts = false;
startCanvas.SetActive(false);
if (extraStartCG != null)
{
extraStartCG.alpha = 0f;
extraStartCG.interactable = false;
extraStartCG.blocksRaycasts = false;
if (extraStartObject != null) extraStartObject.SetActive(false);
}
ApplyStartCanvasExitFinalState();
fade_canvasGroup = null;
yield break;
@@ -680,18 +669,7 @@ public class GameManager : MonoBehaviour
yield return null;
}
cg_startCanvas.alpha = 0f;
cg_startCanvas.interactable = false;
cg_startCanvas.blocksRaycasts = false;
startCanvas.SetActive(false);
if (extraStartCG != null)
{
extraStartCG.alpha = 0f;
extraStartCG.interactable = false;
extraStartCG.blocksRaycasts = false;
if (extraStartObject != null) extraStartObject.SetActive(false);
}
ApplyStartCanvasExitFinalState();
fade_canvasGroup = null;
}
@@ -745,6 +723,7 @@ public class GameManager : MonoBehaviour
yield return WaitRealtime(startCanvasMoveStagger);
yield return StartCoroutine(AnimateMoveAndFade(startup_escape, startup_escapeCg, escapeFrom, startup_escapeBasePos, 0f, 1f, startCanvasMoveInDuration, true));
ApplyStartCanvasEntryFinalState();
startCanvasIntroCompleted = true;
SetStartButtonsInteractable(true);
startCanvasIntroRoutine = null;
@@ -863,6 +842,42 @@ public class GameManager : MonoBehaviour
SetCanvasGroupAlpha(startup_uiBackCg, 1f, false);
}
private void ApplyStartCanvasExitFinalState()
{
if (startup_text != null) startup_text.anchoredPosition = startup_textBasePos + new Vector2(0f, -startCanvasMoveOffsetY);
if (startup_start != null) startup_start.anchoredPosition = startup_startBasePos + new Vector2(0f, -startCanvasMoveOffsetY);
if (startup_escape != null) startup_escape.anchoredPosition = startup_escapeBasePos + new Vector2(0f, -startCanvasMoveOffsetY);
if (startup_boarder != null) startup_boarder.anchoredPosition = startup_boarderBasePos + new Vector2(0f, -startCanvasPanelExitOffsetY);
if (startup_image != null) startup_image.anchoredPosition = startup_imageBasePos + new Vector2(0f, -startCanvasPanelExitOffsetY);
SetCanvasGroupAlpha(startup_btmCg, 0f, false);
SetCanvasGroupAlpha(startup_boarderCg, 0f, false);
SetCanvasGroupAlpha(startup_imageCg, 0f, false);
SetCanvasGroupAlpha(startup_textCg, 0f, false);
SetCanvasGroupAlpha(startup_startCg, 0f, false);
SetCanvasGroupAlpha(startup_escapeCg, 0f, false);
SetCanvasGroupAlpha(startup_tipsCg, 0f, false);
SetCanvasGroupAlpha(startup_uiBackCg, 0f, false);
if (cg_startCanvas != null)
{
cg_startCanvas.alpha = 0f;
cg_startCanvas.interactable = false;
cg_startCanvas.blocksRaycasts = false;
}
if (startCanvas != null) startCanvas.SetActive(false);
if (extraStartCG != null)
{
extraStartCG.alpha = 0f;
extraStartCG.interactable = false;
extraStartCG.blocksRaycasts = false;
}
if (extraStartObject != null) extraStartObject.SetActive(false);
}
private void SetStartButtonsInteractable(bool interactable)
{
if (startGame != null) startGame.interactable = interactable;
@@ -41,6 +41,20 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
[SerializeField] private bool allyUsePseudoYTurnForUI = true;
[SerializeField] private float allyPseudoStartScaleX = 0.68f;
[Header("Additional HUD")]
[SerializeField] private bool animateAdditionalHudRoots = true;
[SerializeField] private float additionalHudStartYOffset = -35f;
[SerializeField] private float additionalHudMoveDuration = 0.24f;
[SerializeField] private float additionalHudStagger = 0.035f;
[SerializeField]
private string[] additionalHudRootNames =
{
"healthSys",
"manaSys",
"progressLineBottom",
"progressLineColor"
};
private bool playedOnce;
private bool refsCached;
private bool preStartPrepared;
@@ -64,12 +78,15 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
private readonly List<Transform> gameObjectRects = new List<Transform>();
private readonly List<Transform> colorRects = new List<Transform>();
private readonly List<Transform> allies = new List<Transform>();
private readonly List<Transform> additionalHudRoots = new List<Transform>();
private readonly List<Transform> explicitKeyDownRects = new List<Transform>(5);
private readonly Dictionary<Graphic, float> baseGraphicAlpha = new Dictionary<Graphic, float>();
private readonly Dictionary<SpriteRenderer, float> baseSpriteAlpha = new Dictionary<SpriteRenderer, float>();
private readonly Dictionary<CanvasGroup, float> baseCanvasGroupAlpha = new Dictionary<CanvasGroup, float>();
private readonly Dictionary<Transform, Vector3> baseLocalScale = new Dictionary<Transform, Vector3>();
private readonly Dictionary<Transform, Vector3> baseLocalPosition = new Dictionary<Transform, Vector3>();
private readonly Dictionary<Transform, float> rootCanvasBaseAlpha = new Dictionary<Transform, float>();
private readonly Dictionary<Transform, CanvasGroup> rootCanvasGroups = new Dictionary<Transform, CanvasGroup>();
private void Awake()
@@ -85,6 +102,17 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
StartCoroutine(PreparePreStartStateNextFrame());
}
private void OnDisable()
{
if (playRoutine == null) return;
// If the object is disabled during the intro, keep HUD from being stranded mid-animation.
StopCoroutine(playRoutine);
ApplyIntroFinalState();
playedOnce = true;
playRoutine = null;
}
private void LateUpdate()
{
if (!keepHiddenBeforeStart) return;
@@ -206,6 +234,12 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
}
allies.Sort((a, b) => a.name.CompareTo(b.name));
additionalHudRoots.Clear();
if (animateAdditionalHudRoots)
{
additionalHudRoots.AddRange(CollectAdditionalHudRoots());
}
refsCached = true;
}
@@ -265,6 +299,14 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
if (totalEnemyTop != null) SetScaleY(totalEnemyTop, 0f);
if (totalEnemyFade != null) SetScaleY(totalEnemyFade, 0f);
for (int i = 0; i < additionalHudRoots.Count; i++)
{
Transform hud = additionalHudRoots[i];
if (hud == null) continue;
SetRootCanvasAlphaNormalized(hud, 0f);
SetLocalPosition(hud, GetBaseLocalPosition(hud) + new Vector3(0f, additionalHudStartYOffset, 0f));
}
preStartPrepared = true;
}
@@ -306,16 +348,74 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
Coroutine enemyStep = StartCoroutine(PlayEnemyStep(enemyRoot, enemyListBall, enemyStatics, enemySpineSystem, totalEnemyTop, totalEnemyFade));
Coroutine progressStep = StartCoroutine(FlashIn(progressLine, flashTimes, flashDuration, true));
Coroutine alliesStep = StartCoroutine(PlayAlliesAndHudStep(allies, score, pause));
Coroutine additionalHudStep = StartCoroutine(PlayAdditionalHudStep(additionalHudRoots));
if (colorStep != null) yield return colorStep;
if (enemyStep != null) yield return enemyStep;
if (progressStep != null) yield return progressStep;
if (alliesStep != null) yield return alliesStep;
if (additionalHudStep != null) yield return additionalHudStep;
ApplyIntroFinalState();
playedOnce = true;
playRoutine = null;
}
private void ApplyIntroFinalState()
{
if (bgReplace != null) SetAlphaNormalized(bgReplace, 1f, true);
if (colorLineStatic != null) SetAlphaNormalized(colorLineStatic, 1f, true);
if (enemyRoot != null) SetAlphaNormalized(enemyRoot, 1f, true);
if (enemyListBall != null) SetAlphaNormalized(enemyListBall, 1f, true);
if (enemyStatics != null) SetAlphaNormalized(enemyStatics, 1f, true);
if (enemySpineSystem != null) enemySpineSystem.gameObject.SetActive(true);
if (progressLine != null) SetAlphaNormalized(progressLine, 1f, true);
if (score != null) SetAlphaNormalized(score, 1f, true);
if (pause != null) SetAlphaNormalized(pause, 1f, true);
for (int i = 0; i < colorRects.Count; i++)
{
if (colorRects[i] != null) SetAlphaNormalized(colorRects[i], 1f, true);
}
for (int i = 0; i < keyDownRects.Count; i++)
{
Transform t = keyDownRects[i];
if (t == null) continue;
SetAlphaNormalized(t, 1f, true);
SetLocalY(t, keyDownTargetY);
SetLocalRotY(t, keyDownTargetRotY);
}
for (int i = 0; i < gameObjectRects.Count; i++)
{
Transform t = gameObjectRects[i];
if (t == null) continue;
SetAlphaNormalized(t, 1f, true);
SetLocalY(t, gameObjectTargetY);
}
for (int i = 0; i < allies.Count; i++)
{
Transform ally = allies[i];
if (ally == null) continue;
SetRootCanvasAlpha(ally, 1f);
SetPseudoTurnScaleX(ally, 1f);
SetLocalRotY(ally, allyTargetRotY);
}
if (totalEnemyTop != null) SetScaleY(totalEnemyTop, 1f);
if (totalEnemyFade != null) SetScaleY(totalEnemyFade, 1f);
for (int i = 0; i < additionalHudRoots.Count; i++)
{
Transform hud = additionalHudRoots[i];
if (hud == null) continue;
SetRootCanvasAlphaNormalized(hud, 1f);
SetLocalPosition(hud, GetBaseLocalPosition(hud));
}
}
private IEnumerator PlayEnemyStep(
Transform enemyRootTr,
Transform enemyListBallTr,
@@ -379,6 +479,48 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
yield return StartCoroutine(FlashIn(pauseTr, flashTimes, hudFlashDuration, true));
}
private IEnumerator PlayAdditionalHudStep(List<Transform> hudList)
{
if (hudList == null || hudList.Count == 0) yield break;
for (int i = 0; i < hudList.Count; i++)
{
Transform hud = hudList[i];
if (hud == null) continue;
StartCoroutine(AnimateAdditionalHudRoot(hud));
if (i < hudList.Count - 1 && additionalHudStagger > 0f)
yield return WaitRealtime(additionalHudStagger);
}
yield return WaitRealtime(additionalHudMoveDuration);
}
private IEnumerator AnimateAdditionalHudRoot(Transform hud)
{
if (hud == null) yield break;
Vector3 basePos = GetBaseLocalPosition(hud);
Vector3 from = basePos + new Vector3(0f, additionalHudStartYOffset, 0f);
float elapsed = 0f;
float dur = Mathf.Max(0.01f, additionalHudMoveDuration);
SetLocalPosition(hud, from);
SetRootCanvasAlphaNormalized(hud, 0f);
while (elapsed < dur)
{
elapsed += Time.unscaledDeltaTime;
float k = EaseOutCubic(Mathf.Clamp01(elapsed / dur));
SetLocalPosition(hud, Vector3.LerpUnclamped(from, basePos, k));
SetRootCanvasAlphaNormalized(hud, k);
yield return null;
}
SetLocalPosition(hud, basePos);
SetRootCanvasAlphaNormalized(hud, 1f);
}
private IEnumerator FlashInSequence(List<Transform> list, int flashes, float duration, float stagger)
{
if (list == null || list.Count == 0) yield break;
@@ -624,6 +766,23 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
return s;
}
private Vector3 GetBaseLocalPosition(Transform t)
{
if (t == null) return Vector3.zero;
if (!baseLocalPosition.TryGetValue(t, out Vector3 p))
{
p = t.localPosition;
baseLocalPosition[t] = p;
}
return p;
}
private static void SetLocalPosition(Transform t, Vector3 localPosition)
{
if (t == null) return;
t.localPosition = localPosition;
}
private static void SetScaleY(Transform t, float y)
{
if (t == null) return;
@@ -748,6 +907,21 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
cg.alpha = n;
}
private void SetRootCanvasAlphaNormalized(Transform root, float normalized)
{
if (root == null) return;
CanvasGroup cg = GetOrAddRootCanvasGroup(root);
if (cg == null) return;
if (!rootCanvasBaseAlpha.TryGetValue(root, out float baseAlpha))
{
baseAlpha = cg.alpha;
rootCanvasBaseAlpha[root] = baseAlpha;
}
cg.alpha = baseAlpha * Mathf.Clamp01(normalized);
}
private IEnumerator FlashInCanvasGroup(Transform root, int flashes, float duration)
{
if (root == null) yield break;
@@ -812,6 +986,78 @@ public class GameplayTrackStartIntroAnimator : MonoBehaviour
return list;
}
private List<Transform> CollectAdditionalHudRoots()
{
List<Transform> list = new List<Transform>();
if (additionalHudRootNames == null || additionalHudRootNames.Length == 0) return list;
HashSet<int> seen = new HashSet<int>();
Transform[] all = GetAllSceneTransforms();
for (int i = 0; i < all.Length; i++)
{
Transform t = all[i];
if (t == null || string.IsNullOrEmpty(t.name)) continue;
if (!IsAdditionalHudName(t.name)) continue;
if (IsAlreadyHandledByMainIntro(t)) continue;
if (!seen.Add(t.GetInstanceID())) continue;
list.Add(t);
}
list.Sort((a, b) =>
{
int ay = a != null ? Mathf.RoundToInt(-a.position.y * 1000f) : 0;
int by = b != null ? Mathf.RoundToInt(-b.position.y * 1000f) : 0;
int yCmp = ay.CompareTo(by);
if (yCmp != 0) return yCmp;
return (a != null ? a.GetSiblingIndex() : 0).CompareTo(b != null ? b.GetSiblingIndex() : 0);
});
return list;
}
private bool IsAdditionalHudName(string candidateName)
{
for (int i = 0; i < additionalHudRootNames.Length; i++)
{
string targetName = additionalHudRootNames[i];
if (string.IsNullOrEmpty(targetName)) continue;
if (string.Equals(candidateName, targetName, System.StringComparison.OrdinalIgnoreCase))
return true;
}
return false;
}
private bool IsAlreadyHandledByMainIntro(Transform t)
{
if (t == null) return true;
if (IsSelfOrChildOf(t, keyDown) ||
IsSelfOrChildOf(t, colorLineStatic) ||
IsSelfOrChildOf(t, enemyRoot) ||
IsSelfOrChildOf(t, progressLine) ||
IsSelfOrChildOf(t, score) ||
IsSelfOrChildOf(t, pause) ||
IsSelfOrChildOf(t, bgReplace))
return true;
for (int i = 0; i < keyDownRects.Count; i++)
if (IsSelfOrChildOf(t, keyDownRects[i])) return true;
for (int i = 0; i < gameObjectRects.Count; i++)
if (IsSelfOrChildOf(t, gameObjectRects[i])) return true;
for (int i = 0; i < colorRects.Count; i++)
if (IsSelfOrChildOf(t, colorRects[i])) return true;
for (int i = 0; i < allies.Count; i++)
if (IsSelfOrChildOf(t, allies[i])) return true;
return false;
}
private static bool IsSelfOrChildOf(Transform candidate, Transform root)
{
if (candidate == null || root == null) return false;
return candidate == root || candidate.IsChildOf(root);
}
private List<Transform> CollectGameObjectSdw3Excluding(Transform keyDownRoot)
{
List<Transform> list = new List<Transform>();
@@ -19,6 +19,10 @@ public class rankingList : MonoBehaviour
if (currentInstance == null)
{
currentInstance = Instantiate(rkl_prefab, rkl_parent);
if (currentInstance.GetComponent<UI_PanelPopupTween>() == null)
{
currentInstance.AddComponent<UI_PanelPopupTween>();
}
}
var listPrefab = currentInstance.GetComponent<rankingListPrefab>();
@@ -163,6 +163,8 @@ public class rankingListPrefab : MonoBehaviour
{
row.Bind(entry, ResolveRankSprite(entry.rank), formattedSubmitTime);
}
UI_OrderedEntryAnimator.PlayFadeOnly(rowObj, i, 0.16f, 0.01f, true);
}
}
@@ -134,6 +134,8 @@ public class settlementController : MonoBehaviour
[SerializeField] private float introMoveDuration = 0.42f;
[SerializeField] private float introNumberDuration = 0.48f;
[SerializeField] private float introStepGap = 0.06f;
[SerializeField] private float introStaticElementDuration = 0.22f;
[SerializeField] private float introBarFillDuration = 0.36f;
[SerializeField] private float introMvpEnterYOffset = 120f;
[SerializeField] private float introMvpEnterDuration = 0.42f;
[SerializeField] private Ease introMvpEnterEase = Ease.OutCubic;
@@ -142,6 +144,7 @@ public class settlementController : MonoBehaviour
[Header("Settle Rewards")]
public GameObject rewardPrefab;
public Transform rewardParent;
private Coroutine settlementRewardLayoutRefreshRoutine;
private int targetPmScore;
private int targetIdolScore;
@@ -157,6 +160,11 @@ public class settlementController : MonoBehaviour
private float targetGreatPercent;
private float targetGoodPercent;
private float targetMissPercent;
private int targetEarlyCount;
private int targetLateCount;
private float targetAvgOffsetMs;
private string targetGameNoteRateText = string.Empty;
private string targetPersonalRecordText = string.Empty;
private Tween mvpEntryTween;
private bool skipIntroRequested;
private Transform cachedIntroMvpTransform;
@@ -647,20 +655,25 @@ public class settlementController : MonoBehaviour
accuracy_Text.text = targetAccuracyPercent.ToString("F1") + "%";
// Timing Statistics
if (earlyHitCount_Text != null) earlyHitCount_Text.text = sm.countEarly.ToString();
if (lateHitCount_Text != null) lateHitCount_Text.text = sm.countLate.ToString();
targetEarlyCount = sm.countEarly;
targetLateCount = sm.countLate;
if (earlyHitCount_Text != null) earlyHitCount_Text.text = targetEarlyCount.ToString();
if (lateHitCount_Text != null) lateHitCount_Text.text = targetLateCount.ToString();
if (avgOffset_Text != null)
{
float avg = sm.offsetCount > 0 ? sm.totalOffsetMs / sm.offsetCount : 0f;
avgOffset_Text.text = avg.ToString("F2") + " ms";
targetAvgOffsetMs = avg;
avgOffset_Text.text = targetAvgOffsetMs.ToString("F2") + " ms";
}
targetGameNoteRateText = gameNote_rate != null ? gameNote_rate.text : string.Empty;
TrySubmitArenaRoomScore();
}
else Debug.LogError("score manager is null");
// --- Achievement System: Load and display achievements ---
if (InGamePerformanceManager.Instance != null && !GameConfig.autoPlayEnabled)
if (InGamePerformanceManager.Instance != null)
{
// Calculate total cure, damage and mana from teamUIController
float totalCure = 0;
@@ -723,7 +736,8 @@ public class settlementController : MonoBehaviour
if (personalRecord_Text != null)
{
int currentRecord = thisSong_so.personalRecord;
personalRecord_Text.text = currentRecord.ToString();
targetPersonalRecordText = currentRecord.ToString();
personalRecord_Text.text = targetPersonalRecordText;
// If current total score broke the overall personal record (all difficulties)
// and we are NOT in autoplay (since we didn't save the result in autoplay)
@@ -846,6 +860,7 @@ public class settlementController : MonoBehaviour
SpawnSettlementReward(global::rewardPrefab.RewardVisualType.Coins, coinReward);
SpawnSettlementReward(global::rewardPrefab.RewardVisualType.Material, materialReward);
SpawnSettlementReward(global::rewardPrefab.RewardVisualType.PlayerExp, playerExpReward);
RequestSettlementRewardLayoutRebuild();
}
private void SpawnSettlementReward(global::rewardPrefab.RewardVisualType rewardType, int amount)
@@ -861,6 +876,50 @@ public class settlementController : MonoBehaviour
{
prefab.Bind(rewardType, amount);
}
UI_OrderedEntryAnimator.PlayFadeOnly(go, rewardParent != null ? rewardParent.childCount - 1 : 0, 0.2f, 0.035f, false);
}
private void RequestSettlementRewardLayoutRebuild()
{
if (rewardParent == null)
{
return;
}
if (settlementRewardLayoutRefreshRoutine != null)
{
StopCoroutine(settlementRewardLayoutRefreshRoutine);
settlementRewardLayoutRefreshRoutine = null;
}
if (isActiveAndEnabled)
{
settlementRewardLayoutRefreshRoutine = StartCoroutine(RebuildSettlementRewardLayoutNextFrame());
return;
}
RebuildSettlementRewardLayoutNow();
}
private IEnumerator RebuildSettlementRewardLayoutNextFrame()
{
yield return null;
RebuildSettlementRewardLayoutNow();
settlementRewardLayoutRefreshRoutine = null;
}
private void RebuildSettlementRewardLayoutNow()
{
RectTransform rect = rewardParent as RectTransform;
if (rect == null)
{
return;
}
Canvas.ForceUpdateCanvases();
LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
Canvas.ForceUpdateCanvases();
}
private static Player_SO LoadDefaultPlayerSo()
@@ -1164,6 +1223,20 @@ public class settlementController : MonoBehaviour
if (orderedGroups[i] != null) SetCanvasAlpha(orderedGroups[i], 0f);
}
PrepareStaticSettlementElement(thisSong_backPic != null ? thisSong_backPic.transform : null);
PrepareStaticSettlementElement(songName_Text != null ? songName_Text.transform : null);
PrepareStaticSettlementElement(finalLevel_img != null ? finalLevel_img.transform : null);
PrepareStaticSettlementElement(personalRecord_Text != null ? personalRecord_Text.transform : null);
PrepareStaticSettlementElement(gameNote_rate != null ? gameNote_rate.transform : null);
PrepareStaticSettlementElement(earlyHitCount_Text != null ? earlyHitCount_Text.transform : null);
PrepareStaticSettlementElement(lateHitCount_Text != null ? lateHitCount_Text.transform : null);
PrepareStaticSettlementElement(avgOffset_Text != null ? avgOffset_Text.transform : null);
PrepareImageFill(thisLevel_progressBar_Image);
PrepareImageFill(perfect_barFill_Image);
PrepareImageFill(great_barFill_Image);
PrepareImageFill(good_barFill_Image);
PrepareImageFill(miss_barFill_Image);
PrepareTextForCountUp(pmScoreSum_Text, false, 0);
PrepareTextForCountUp(idolScoreSum_Text, false, 0);
PrepareTextForCountUp(accuracy_Text, true, 0f, "F1");
@@ -1188,6 +1261,8 @@ public class settlementController : MonoBehaviour
// left/pics/quhuiImage flash
if (quhuiImageTr != null)
yield return StartCoroutine(FlashInTransform(quhuiImageTr, introFlashCount, introFlashDuration));
yield return StartCoroutine(FlashInTransform(thisSong_backPic != null ? thisSong_backPic.transform : null, 1, introStaticElementDuration));
yield return StartCoroutine(FlashInTransform(songName_Text != null ? songName_Text.transform : null, 1, introStaticElementDuration));
// score_bottom + shenstars move in together
Coroutine scoreBottomIn = null;
@@ -1215,12 +1290,21 @@ public class settlementController : MonoBehaviour
yield return WaitRealtime(introNumberDuration + 0.02f);
yield return StartCoroutine(FlashInTransform(finalScore_Text != null ? finalScore_Text.transform : null, introFlashCount, introFlashDuration * 0.9f));
yield return StartCoroutine(FlashInTransform(thisLevel_currentPercentage_Text != null ? thisLevel_currentPercentage_Text.transform : null, introFlashCount, introFlashDuration * 0.9f));
yield return StartCoroutine(AnimateImageFill(thisLevel_progressBar_Image, (float)targetTotalScore / Mathf.Max(1, _1000000), introBarFillDuration));
yield return StartCoroutine(FlashInTransform(finalLevel_img != null ? finalLevel_img.transform : null, 1, introStaticElementDuration));
yield return StartCoroutine(FlashInTransform(personalRecord_Text != null ? personalRecord_Text.transform : null, 1, introStaticElementDuration));
yield return StartCoroutine(FlashInTransform(gameNote_rate != null ? gameNote_rate.transform : null, 1, introStaticElementDuration));
// hitStatus/status groups: flash in and count up numbers
yield return StartCoroutine(PlayStatusGroupIn(perfectGroup, perfectHitCount_Text, targetPerfectCount, perfectHitPercent_Text, targetPerfectPercent));
yield return StartCoroutine(PlayStatusGroupIn(greatGroup, greatHitCount_Text, targetGreatCount, greatHitPercent_Text, targetGreatPercent));
yield return StartCoroutine(PlayStatusGroupIn(goodGroup, goodHitCount_Text, targetGoodCount, goodHitPercent_Text, targetGoodPercent));
yield return StartCoroutine(PlayStatusGroupIn(missGroup, missHitCount_Text, targetMissCount, missHitPercent_Text, targetMissPercent));
int noteCountForBars = Mathf.Max(1, targetPerfectCount + targetGreatCount + targetGoodCount + targetMissCount);
yield return StartCoroutine(PlayStatusGroupIn(perfectGroup, perfectHitCount_Text, targetPerfectCount, perfectHitPercent_Text, targetPerfectPercent, perfect_barFill_Image, (float)targetPerfectCount / noteCountForBars));
yield return StartCoroutine(PlayStatusGroupIn(greatGroup, greatHitCount_Text, targetGreatCount, greatHitPercent_Text, targetGreatPercent, great_barFill_Image, (float)targetGreatCount / noteCountForBars));
yield return StartCoroutine(PlayStatusGroupIn(goodGroup, goodHitCount_Text, targetGoodCount, goodHitPercent_Text, targetGoodPercent, good_barFill_Image, (float)targetGoodCount / noteCountForBars));
yield return StartCoroutine(PlayStatusGroupIn(missGroup, missHitCount_Text, targetMissCount, missHitPercent_Text, targetMissPercent, miss_barFill_Image, (float)targetMissCount / noteCountForBars));
yield return StartCoroutine(AnimateIntText(earlyHitCount_Text, targetEarlyCount, introNumberDuration * 0.7f));
yield return StartCoroutine(AnimateIntText(lateHitCount_Text, targetLateCount, introNumberDuration * 0.7f));
yield return StartCoroutine(AnimateOffsetText(avgOffset_Text, targetAvgOffsetMs, introNumberDuration * 0.7f));
// ally cards enter before MASK.
if (hasAllyCardEntry)
@@ -1247,6 +1331,7 @@ public class settlementController : MonoBehaviour
yield return WaitRealtime(introStepGap);
}
ApplySettlementIntroFinalState();
settlementCanvasGroup.alpha = 1f;
settlementCanvasGroup.interactable = true;
settlementCanvasGroup.blocksRaycasts = true;
@@ -1356,6 +1441,23 @@ public class settlementController : MonoBehaviour
if (good_barFill_Image != null) good_barFill_Image.fillAmount = (float)targetGoodCount / noteCountSum;
if (miss_barFill_Image != null) miss_barFill_Image.fillAmount = (float)targetMissCount / noteCountSum;
if (thisSong_backPic != null) SetCanvasAlpha(thisSong_backPic.transform, 1f);
if (songName_Text != null) SetCanvasAlpha(songName_Text.transform, 1f);
if (finalLevel_img != null) SetCanvasAlpha(finalLevel_img.transform, 1f);
if (personalRecord_Text != null)
{
if (!string.IsNullOrEmpty(targetPersonalRecordText)) personalRecord_Text.text = targetPersonalRecordText;
SetCanvasAlpha(personalRecord_Text.transform, 1f);
}
if (gameNote_rate != null)
{
if (!string.IsNullOrEmpty(targetGameNoteRateText)) gameNote_rate.text = targetGameNoteRateText;
SetCanvasAlpha(gameNote_rate.transform, 1f);
}
if (earlyHitCount_Text != null) { earlyHitCount_Text.text = targetEarlyCount.ToString(); SetCanvasAlpha(earlyHitCount_Text.transform, 1f); }
if (lateHitCount_Text != null) { lateHitCount_Text.text = targetLateCount.ToString(); SetCanvasAlpha(lateHitCount_Text.transform, 1f); }
if (avgOffset_Text != null) { avgOffset_Text.text = targetAvgOffsetMs.ToString("F2") + " ms"; SetCanvasAlpha(avgOffset_Text.transform, 1f); }
if (mvpTr != null && mvpTr.gameObject.activeInHierarchy)
{
Vector3 targetPos;
@@ -1585,16 +1687,23 @@ public class settlementController : MonoBehaviour
}
private IEnumerator PlayStatusGroupIn(Transform groupRoot, Text countText, int countTarget, Text percentText, float percentTarget)
{
yield return StartCoroutine(PlayStatusGroupIn(groupRoot, countText, countTarget, percentText, percentTarget, null, 0f));
}
private IEnumerator PlayStatusGroupIn(Transform groupRoot, Text countText, int countTarget, Text percentText, float percentTarget, Image fillImage, float fillTarget)
{
if (groupRoot != null)
yield return StartCoroutine(FlashInTransform(groupRoot, introFlashCount, introFlashDuration));
Coroutine c1 = null;
Coroutine c2 = null;
Coroutine c3 = null;
if (countText != null) c1 = StartCoroutine(AnimateIntText(countText, countTarget, introNumberDuration));
if (percentText != null) c2 = StartCoroutine(AnimateFloatPercentText(percentText, percentTarget, introNumberDuration, "F1"));
if (fillImage != null) c3 = StartCoroutine(AnimateImageFill(fillImage, fillTarget, introBarFillDuration));
if (c1 != null || c2 != null)
if (c1 != null || c2 != null || c3 != null)
yield return WaitRealtime(introNumberDuration + 0.02f);
}
@@ -1666,6 +1775,48 @@ public class settlementController : MonoBehaviour
target.text = toValue.ToString(format) + "%";
}
private IEnumerator AnimateOffsetText(Text target, float toValue, float duration)
{
if (target == null) yield break;
SetCanvasAlpha(target.transform, 1f);
float elapsed = 0f;
float dur = Mathf.Max(0.01f, duration);
while (elapsed < dur)
{
if (skipIntroRequested) break;
elapsed += Time.unscaledDeltaTime;
float t = EaseOutCubic(Mathf.Clamp01(elapsed / dur));
float value = Mathf.Lerp(0f, toValue, t);
target.text = value.ToString("F2") + " ms";
yield return null;
}
target.text = toValue.ToString("F2") + " ms";
}
private IEnumerator AnimateImageFill(Image target, float toValue, float duration)
{
if (target == null) yield break;
target.fillAmount = 0f;
float elapsed = 0f;
float dur = Mathf.Max(0.01f, duration);
float targetValue = Mathf.Clamp01(toValue);
while (elapsed < dur)
{
if (skipIntroRequested) break;
elapsed += Time.unscaledDeltaTime;
float t = EaseOutCubic(Mathf.Clamp01(elapsed / dur));
target.fillAmount = Mathf.Lerp(0f, targetValue, t);
yield return null;
}
target.fillAmount = targetValue;
}
private IEnumerator AnimateAnchoredXAndFade(RectTransform rt, float fromX, float toX, float duration, bool fadeIn)
{
if (rt == null) yield break;
@@ -1776,6 +1927,18 @@ public class settlementController : MonoBehaviour
SetCanvasAlpha(target, 1f);
}
private void PrepareStaticSettlementElement(Transform target)
{
if (target == null) return;
SetCanvasAlpha(target, 0f);
}
private void PrepareImageFill(Image target)
{
if (target == null) return;
target.fillAmount = 0f;
}
private void PrepareTextForCountUp(Text t, bool isPercent, float initialValue, string format = "F1")
{
if (t == null) return;
+1 -1
View File
@@ -1476,7 +1476,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -413.0012, y: -70.99978}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1225836703710798441
@@ -878,6 +878,7 @@ public class globalChatSystem : MonoBehaviour
for (int i = prefix; i < desiredKeys.Count - suffix; i++)
{
GameObject instance = CreateFeedObject(visibleEntries[i]);
UI_OrderedEntryAnimator.PlaySingle(instance, i - prefix, 0.18f, 0.012f, -14f, 0.98f, true);
_renderedObjects.Insert(i, instance);
_renderedKeys.Insert(i, desiredKeys[i]);
RegisterLayoutDirtyRoot(instance);
@@ -363,7 +363,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 125.23433}
m_AnchoredPosition: {x: 0, y: 62.501953}
m_SizeDelta: {x: 40, y: 40}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &225269693782171328
@@ -533,7 +533,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 3840, y: -125.234314}
m_AnchoredPosition: {x: 3840, y: -62.501953}
m_SizeDelta: {x: 256, y: 0}
m_Pivot: {x: 1, y: 0.5}
--- !u!114 &5490276556566493605
@@ -616,7 +616,7 @@ RectTransform:
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -143.99913}
m_SizeDelta: {x: 0, y: 125.23433}
m_SizeDelta: {x: 0, y: 62.501953}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &6728628998878729785
MonoBehaviour:
@@ -691,7 +691,7 @@ MonoBehaviour:
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: 125.23433
m_PreferredHeight: 62.501953
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 2
+27 -1
View File
@@ -16,8 +16,15 @@ public class roomAsk : MonoBehaviour
private Func<Task> _onCreate;
private Func<string, Task> _onJoin;
private void Awake()
{
EnsurePopupTween();
}
public void Bind(Func<Task> onCreate, Func<string, Task> onJoin)
{
EnsurePopupTween();
_onCreate = onCreate;
_onJoin = onJoin;
@@ -132,6 +139,25 @@ public class roomAsk : MonoBehaviour
private void HandleQuitChoiceClicked()
{
Destroy(gameObject);
CloseSelfWithExitAnim();
}
private void CloseSelfWithExitAnim()
{
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
Destroy(gameObject);
}
});
}
private void EnsurePopupTween()
{
if (GetComponent<UI_PanelPopupTween>() == null)
{
gameObject.AddComponent<UI_PanelPopupTween>();
}
}
}
+63 -11
View File
@@ -91,12 +91,18 @@ public class roomDetails : MonoBehaviour
private Coroutine _songLibraryWaitRoutine;
private bool _suppressSongDropdownEvents;
private bool _isChangingRoomSong;
private bool _isClosingSelf;
private const float ChatSendCooldownSeconds = 3f;
private const int InitialHistoryLoadLimit = 20;
private const int MaxDisplayWindowLimit = 20;
private const string CooldownPlaceholderFormat = "\u53d1\u9001\u51b7\u5374\u4e2d {0}s";
private void Awake()
{
EnsurePopupTween();
}
public void ConfigureRoomRanking(GameObject roomRankingPrefab, Transform roomRankingSpawnParent)
{
_roomRankingPrefabTemplate = roomRankingPrefab;
@@ -105,6 +111,8 @@ public class roomDetails : MonoBehaviour
public void Bind(ArenaRoomService service)
{
EnsurePopupTween();
_service = service;
UIBackStack.RegisterOrBump(
@@ -114,13 +122,11 @@ public class roomDetails : MonoBehaviour
{
if (_spawnedRoomRankingInstance != null)
{
UIBackStack.Unregister(_spawnedRoomRankingInstance);
Destroy(_spawnedRoomRankingInstance);
_spawnedRoomRankingInstance = null;
CloseRoomRankingWithExitAnim();
return true;
}
Destroy(gameObject);
CloseSelfWithExitAnim();
return true;
});
@@ -311,7 +317,7 @@ public class roomDetails : MonoBehaviour
{
if (snapshot == null)
{
Destroy(gameObject);
CloseSelfWithExitAnim();
return;
}
@@ -320,12 +326,12 @@ public class roomDetails : MonoBehaviour
private void HandleKicked(string kickedSteamId, string bySteamId)
{
Destroy(gameObject);
CloseSelfWithExitAnim();
}
private void HandleRoomDismissed(string roomCode, string bySteamId)
{
Destroy(gameObject);
CloseSelfWithExitAnim();
}
private void HandleRoomChatMessagesChanged(IReadOnlyList<ArenaRoomChatMessage> messages)
@@ -374,7 +380,7 @@ public class roomDetails : MonoBehaviour
{
if (_service == null)
{
Destroy(gameObject);
CloseSelfWithExitAnim();
return;
}
@@ -397,7 +403,7 @@ public class roomDetails : MonoBehaviour
}
finally
{
Destroy(gameObject);
CloseSelfWithExitAnim();
}
}
@@ -476,6 +482,7 @@ public class roomDetails : MonoBehaviour
{
ArenaRoomParticipant participant = snapshot.participants[i];
GameObject item = Instantiate(roommatePrefab, roommateParent);
UI_OrderedEntryAnimator.PlayFadeOnly(item, i, 0.16f, 0.012f, true);
roomPrefab itemController = item.GetComponent<roomPrefab>();
if (itemController == null)
{
@@ -784,6 +791,7 @@ public class roomDetails : MonoBehaviour
systemController.Bind(systemEntry.richText);
}
UI_OrderedEntryAnimator.PlayFadeOnly(systemInstance, Mathf.Max(0, messageParent.childCount - 1), 0.14f, 0.01f, true);
return systemInstance;
}
@@ -809,6 +817,7 @@ public class roomDetails : MonoBehaviour
controller.Bind(senderSteamId, avatarUrl, displayName, title, message.content, bubbleColor);
}
UI_OrderedEntryAnimator.PlayFadeOnly(instance, Mathf.Max(0, messageParent.childCount - 1), 0.14f, 0.01f, true);
return instance;
}
@@ -1260,8 +1269,7 @@ public class roomDetails : MonoBehaviour
{
if (_spawnedRoomRankingInstance != null)
{
Destroy(_spawnedRoomRankingInstance);
_spawnedRoomRankingInstance = null;
CloseRoomRankingWithExitAnim();
}
return true;
@@ -1284,6 +1292,50 @@ public class roomDetails : MonoBehaviour
localSteamId);
}
private void CloseSelfWithExitAnim()
{
if (_isClosingSelf)
{
return;
}
_isClosingSelf = true;
UI_PanelExitUtility.PlayExitThen(gameObject, () =>
{
if (gameObject != null)
{
Destroy(gameObject);
}
});
}
private void CloseRoomRankingWithExitAnim()
{
GameObject rankingInstance = _spawnedRoomRankingInstance;
if (rankingInstance == null)
{
return;
}
UIBackStack.Unregister(rankingInstance);
_spawnedRoomRankingInstance = null;
UI_PanelExitUtility.PlayExitThen(rankingInstance, () =>
{
if (rankingInstance != null)
{
Destroy(rankingInstance);
}
});
}
private void EnsurePopupTween()
{
if (GetComponent<UI_PanelPopupTween>() == null)
{
gameObject.AddComponent<UI_PanelPopupTween>();
}
}
private void UpdateQuitButtonTexts(ArenaRoomSnapshot snapshot)
{
string localSteamId = NetworkManager.Instance != null ? NetworkManager.Instance.SteamId : string.Empty;
+6 -2
View File
@@ -6842,7 +6842,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6249172551117239467, guid: 6ad36126be99a574285929280ea8fac7, type: 3}
propertyPath: m_AnchoredPosition.y
value: -120.500015
value: -120.5
objectReference: {fileID: 0}
- target: {fileID: 6249172551117239467, guid: 6ad36126be99a574285929280ea8fac7, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@@ -7026,7 +7026,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 423933864671952839, guid: f3c648c5e98a3d64fb64514c03aaf7a3, type: 3}
propertyPath: m_AnchoredPosition.x
value: 121
value: 0
objectReference: {fileID: 0}
- target: {fileID: 423933864671952839, guid: f3c648c5e98a3d64fb64514c03aaf7a3, type: 3}
propertyPath: m_AnchoredPosition.y
@@ -7232,6 +7232,10 @@ PrefabInstance:
propertyPath: m_SizeDelta.x
value: 116
objectReference: {fileID: 0}
- target: {fileID: 8469056815856914825, guid: f3c648c5e98a3d64fb64514c03aaf7a3, type: 3}
propertyPath: m_AnchoredPosition.x
value: 118
objectReference: {fileID: 0}
- target: {fileID: 8469056815856914825, guid: f3c648c5e98a3d64fb64514c03aaf7a3, type: 3}
propertyPath: m_AnchoredPosition.y
value: -2
@@ -202,7 +202,10 @@ public class UI_SelectSong_EnterAnim : MonoBehaviour
return;
}
CacheBase(rect);
rect.anchoredPosition = basePos[rect] + offset;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
{
rect.anchoredPosition = basePos[rect] + offset;
}
CanvasGroup group = EnsureCanvasGroup(rect);
if (group != null) group.alpha = 0f;
}
@@ -214,7 +217,10 @@ public class UI_SelectSong_EnterAnim : MonoBehaviour
return;
}
CacheBase(rect);
rect.localScale = baseScale[rect] * scaleMul;
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(rect))
{
rect.localScale = baseScale[rect] * scaleMul;
}
CanvasGroup group = EnsureCanvasGroup(rect);
if (group != null) group.alpha = 0f;
}
@@ -268,7 +274,8 @@ public class UI_SelectSong_EnterAnim : MonoBehaviour
return;
}
CacheBase(rect);
if (basePos.TryGetValue(rect, out Vector2 pos))
bool layoutSensitive = UI_OrderedEntryAnimator.IsLayoutSensitive(rect);
if (!layoutSensitive && basePos.TryGetValue(rect, out Vector2 pos))
{
enterSeq.Insert(at, rect.DOAnchorPos(pos, time).SetEase(ease).SetUpdate(useUnscaledTime));
}
@@ -286,7 +293,8 @@ public class UI_SelectSong_EnterAnim : MonoBehaviour
return;
}
CacheBase(rect);
if (baseScale.TryGetValue(rect, out Vector3 scale))
bool layoutSensitive = UI_OrderedEntryAnimator.IsLayoutSensitive(rect);
if (!layoutSensitive && baseScale.TryGetValue(rect, out Vector3 scale))
{
enterSeq.Insert(at, rect.DOScale(scale, time).SetEase(ease).SetUpdate(useUnscaledTime));
}
@@ -320,12 +328,13 @@ public class UI_SelectSong_EnterAnim : MonoBehaviour
if (!rect.gameObject.activeSelf) return;
CacheBase(rect);
if (basePos.TryGetValue(rect, out Vector2 pos))
bool layoutSensitive = UI_OrderedEntryAnimator.IsLayoutSensitive(rect);
if (!layoutSensitive && basePos.TryGetValue(rect, out Vector2 pos))
{
rect.anchoredPosition = pos;
}
if (applyScale && baseScale.TryGetValue(rect, out Vector3 scale))
if (!layoutSensitive && applyScale && baseScale.TryGetValue(rect, out Vector3 scale))
{
rect.localScale = scale;
}
@@ -250,13 +250,14 @@ public class SongSelectUI : MonoBehaviour
root.DOKill();
cg.DOKill();
float moveOffset = list_Move_Offset;
if (root.GetComponent<LayoutGroup>() != null)
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(root);
if (!canMove)
{
moveOffset = 0f;
}
Sequence seq = DOTween.Sequence().SetUpdate(list_Use_Unscaled);
seq.Join(cg.DOFade(0f, list_FadeOut_Time));
if (Mathf.Abs(moveOffset) > 0.01f)
if (canMove && Mathf.Abs(moveOffset) > 0.01f)
{
seq.Join(root.DOAnchorPos(listBasePos + new Vector2(-moveOffset, 0f), list_FadeOut_Time).SetEase(list_Move_Ease));
}
@@ -283,22 +284,23 @@ public class SongSelectUI : MonoBehaviour
root.DOKill();
cg.DOKill();
float moveOffset = list_Move_Offset;
if (root.GetComponent<LayoutGroup>() != null)
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(root);
if (!canMove)
{
moveOffset = 0f;
}
if (Mathf.Abs(moveOffset) > 0.01f)
if (canMove && Mathf.Abs(moveOffset) > 0.01f)
{
root.anchoredPosition = listBasePos + new Vector2(moveOffset, 0f);
}
else
else if (canMove)
{
root.anchoredPosition = listBasePos;
}
cg.alpha = 0f;
Sequence seq = DOTween.Sequence().SetUpdate(list_Use_Unscaled);
seq.Join(cg.DOFade(1f, list_FadeIn_Time));
if (Mathf.Abs(moveOffset) > 0.01f)
if (canMove && Mathf.Abs(moveOffset) > 0.01f)
{
seq.Join(root.DOAnchorPos(listBasePos, list_FadeIn_Time).SetEase(list_Move_Ease));
}
@@ -421,6 +423,7 @@ public class SongSelectUI : MonoBehaviour
GameObject songButtonObj = Instantiate(songButtonPrefab, contentPanel);
songButtonObj.transform.SetParent(contentPanel, false);
UI_OrderedEntryAnimator.PlayFadeOnly(songButtonObj, contentPanel.childCount - 1, 0.16f, 0.01f, true);
SongData sd = song;
if (SongDataLibrary.Instance != null && SongDataLibrary.Instance.IsLoaded)
+5
View File
@@ -631,6 +631,11 @@ public class SongDetailsUI : MonoBehaviour
rect.localScale = Vector3.one;
rect.anchoredPosition3D = Vector3.zero;
}
if (panel.GetComponent<UI_PanelPopupTween>() == null)
{
panel.AddComponent<UI_PanelPopupTween>();
}
}
private void RegisterManagedOverlay(GameObject panel, Action closeAction)
+31 -1
View File
@@ -4,6 +4,7 @@ using UnityEngine.EventSystems;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using DG.Tweening;
public class dlcButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
@@ -74,7 +75,7 @@ public class dlcButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandle
public void OnPointerExit(PointerEventData eventData)
{
if (hoverCoroutine != null) StopCoroutine(hoverCoroutine);
if (dlcDetailParent != null) dlcDetailParent.SetActive(false);
HideDlcDetail();
}
public void SetDlcData(dlcData so)
@@ -105,6 +106,7 @@ public class dlcButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandle
if (dlcDetailParent != null)
{
dlcDetailParent.SetActive(true);
UI_OrderedEntryAnimator.PlayFadeOnly(dlcDetailParent, 0, 0.12f, 0f, true);
// 鏇存柊绠€浠嬩俊鎭?
if (dlcDescription != null)
{
@@ -122,6 +124,34 @@ public class dlcButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandle
}
}
private void HideDlcDetail()
{
if (dlcDetailParent == null)
{
return;
}
CanvasGroup group = dlcDetailParent.GetComponent<CanvasGroup>();
if (group == null)
{
group = dlcDetailParent.AddComponent<CanvasGroup>();
}
group.DOKill();
group.DOFade(0f, 0.1f)
.SetEase(Ease.OutQuad)
.SetUpdate(true)
.SetTarget(dlcDetailParent)
.OnComplete(() =>
{
if (dlcDetailParent != null)
{
dlcDetailParent.SetActive(false);
group.alpha = 1f;
}
});
}
void Awake()
{
_btn = GetComponent<Button>();
@@ -61,6 +61,7 @@ public class loadDlcListPrefab : MonoBehaviour
{
var headerGO = Instantiate(columnPrefab, dlc_scContent.transform);
headerGO.name = "Column_" + colIndex;
UI_OrderedEntryAnimator.PlayFadeOnly(headerGO, dlc_scContent.transform.childCount - 1, 0.14f, 0.008f, true);
var card = headerGO.GetComponent<columnCardPrefab>();
if (card != null && card.columnNameText != null)
@@ -87,6 +88,7 @@ public class loadDlcListPrefab : MonoBehaviour
var itemGO = Instantiate(dlcButtonPrefab, dlc_scContent.transform);
itemGO.name = $"DLC_Col{colIndex}_Item{entryIndex}";
UI_OrderedEntryAnimator.PlayFadeOnly(itemGO, dlc_scContent.transform.childCount - 1, 0.16f, 0.01f, true);
var btn = itemGO.GetComponent<dlcButton>();
if (btn != null)
+32 -8
View File
@@ -387,9 +387,10 @@ public class selected_songInfo : MonoBehaviour
blackMaskImage.DOKill();
}
if (Music_Mgr.Singleton != null && Music_Mgr.Singleton.AudioSource != null)
AudioSource globalMusicSource = GetGlobalMusicSource();
if (globalMusicSource != null)
{
Music_Mgr.Singleton.AudioSource.DOKill();
globalMusicSource.DOKill();
}
}
@@ -668,13 +669,26 @@ public class selected_songInfo : MonoBehaviour
private void FadeGlobalMusic(bool fadeIn)
{
if (Music_Mgr.Singleton != null && Music_Mgr.Singleton.AudioSource != null)
AudioSource globalMusicSource = GetGlobalMusicSource();
if (globalMusicSource != null)
{
float targetVolume = fadeIn ? 1f : 0f;
Music_Mgr.Singleton.AudioSource.DOFade(targetVolume, 0.5f).SetUpdate(true);
globalMusicSource.DOFade(targetVolume, 0.5f).SetUpdate(true);
}
}
private static AudioSource GetGlobalMusicSource()
{
BgmPlaybackManager bgm = BgmPlaybackManager.Instance;
if (bgm != null && bgm.audioSource != null)
{
return bgm.audioSource;
}
Music_Mgr musicManager = SceneObjectLookupCache.FindAny<Music_Mgr>();
return musicManager != null ? musicManager.AudioSource : null;
}
private void OnSliderValueChanged(float value)
{
if (preListenAS == null || preListenAS.clip == null) return;
@@ -1009,10 +1023,17 @@ public class selected_songInfo : MonoBehaviour
songInfo_BaseCached = true;
songInfo_Root.DOKill();
songInfo_Canvas.DOKill();
songInfo_Root.anchoredPosition = songInfo_BasePos + new Vector2(-songSwitch_Move, 0f);
bool canMove = !UI_OrderedEntryAnimator.IsLayoutSensitive(songInfo_Root);
if (canMove)
{
songInfo_Root.anchoredPosition = songInfo_BasePos + new Vector2(-songSwitch_Move, 0f);
}
songInfo_Canvas.alpha = 0f;
Sequence seq = DOTween.Sequence().SetUpdate(switch_Use_Unscaled);
seq.Join(songInfo_Root.DOAnchorPos(songInfo_BasePos, songSwitch_Time).SetEase(songSwitch_Ease));
if (canMove)
{
seq.Join(songInfo_Root.DOAnchorPos(songInfo_BasePos, songSwitch_Time).SetEase(songSwitch_Ease));
}
seq.Join(songInfo_Canvas.DOFade(1f, songSwitch_Time));
}
@@ -1030,8 +1051,11 @@ public class selected_songInfo : MonoBehaviour
Transform t = btn.transform;
t.DOKill();
t.localScale = Vector3.one;
t.DOPunchScale(Vector3.one * diffSwitch_Punch, diffSwitch_Punch_Time, 6, 0.7f)
.SetUpdate(switch_Use_Unscaled);
if (!UI_OrderedEntryAnimator.IsLayoutSensitive(btn.transform as RectTransform))
{
t.DOPunchScale(Vector3.one * diffSwitch_Punch, diffSwitch_Punch_Time, 6, 0.7f)
.SetUpdate(switch_Use_Unscaled);
}
}
}
FlashGraphic(currentDifficulty);