gameplay手游触屏支持,一些小优化和修复

This commit is contained in:
FloatGaming
2026-07-15 01:32:14 +08:00
parent 020ca473c7
commit d9990d6fdb
17 changed files with 1489 additions and 50 deletions
@@ -0,0 +1,32 @@
using System;
using System.Collections;
using UnityEngine;
public static class AllyHeroSkillSelectionValidator
{
public static IEnumerator ValidateAllHeroesAsync(int heroesPerFrame = 2, Action<bool> onCompleted = null)
{
AllyHero_SO[] heroes = RuntimeResourcesCache.LoadAllAllyHeroes();
bool anyChanged = false;
int processedThisFrame = 0;
int batchSize = Mathf.Max(1, heroesPerFrame);
for (int i = 0; i < heroes.Length; i++)
{
AllyHero_SO hero = heroes[i];
if (hero != null && hero.ValidateEquippedSkillSelections())
{
anyChanged = true;
}
processedThisFrame++;
if (processedThisFrame >= batchSize)
{
processedThisFrame = 0;
yield return null;
}
}
onCompleted?.Invoke(anyChanged);
}
}