UI换了很多,spine主视觉停用
This commit is contained in:
@@ -300,7 +300,7 @@ public class SkillBuilder : MonoBehaviour
|
||||
// Note: AllyCombatant.ReceiveDamage already applies (1 - Resistance), so we calculate the base here.
|
||||
|
||||
float enemyAtk = 0f;
|
||||
var enemyGO = GameObject.Find("thisEnemy");
|
||||
var enemyGO = SceneObjectLookupCache.Find("thisEnemy");
|
||||
if (enemyGO != null)
|
||||
{
|
||||
var ec = enemyGO.GetComponent<EnemyCombatant>();
|
||||
@@ -417,7 +417,7 @@ public class SkillBuilder : MonoBehaviour
|
||||
{
|
||||
for (int i = 1; i <= 5; i++)
|
||||
{
|
||||
var go = GameObject.Find($"ally_0{i}");
|
||||
var go = SceneObjectLookupCache.Find($"ally_0{i}");
|
||||
if (go != null && !_cachedAllies.Contains(go)) _cachedAllies.Add(go);
|
||||
}
|
||||
}
|
||||
@@ -497,14 +497,14 @@ public class SkillBuilder : MonoBehaviour
|
||||
{
|
||||
var go = ui.GetAllyObjectBySlot(idx);
|
||||
if (go != null) list.Add(go);
|
||||
else { var named = GameObject.Find($"ally_0{idx + 1}"); if (named != null) list.Add(named); }
|
||||
else { var named = SceneObjectLookupCache.Find($"ally_0{idx + 1}"); if (named != null) list.Add(named); }
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int left = slotIndex - 1, right = slotIndex + 1;
|
||||
if (left >= 0) { var g = GameObject.Find($"ally_0{left + 1}"); if (g != null) list.Add(g); }
|
||||
if (right <= 4) { var g = GameObject.Find($"ally_0{right + 1}"); if (g != null) list.Add(g); }
|
||||
if (left >= 0) { var g = SceneObjectLookupCache.Find($"ally_0{left + 1}"); if (g != null) list.Add(g); }
|
||||
if (right <= 4) { var g = SceneObjectLookupCache.Find($"ally_0{right + 1}"); if (g != null) list.Add(g); }
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -514,14 +514,14 @@ public class SkillBuilder : MonoBehaviour
|
||||
break;
|
||||
case Selector.CurrentEnemies:
|
||||
if (specificTarget != null) list.Add(specificTarget);
|
||||
else { try { var tagged = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var g in tagged) if (!list.Contains(g)) list.Add(g); } catch { var single = GameObject.Find("thisEnemy"); if (single != null) list.Add(single); } }
|
||||
else { try { var tagged = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var g in tagged) if (!list.Contains(g)) list.Add(g); } catch { var single = SceneObjectLookupCache.Find("thisEnemy"); if (single != null) list.Add(single); } }
|
||||
break;
|
||||
case Selector.AllEntities:
|
||||
foreach (var go in GetAlliesCached())
|
||||
{
|
||||
if (go != null) list.Add(go);
|
||||
}
|
||||
try { var taggedE = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var g in taggedE) if (!list.Contains(g)) list.Add(g); } catch { var single = GameObject.Find("thisEnemy"); if (single != null && !list.Contains(single)) list.Add(single); }
|
||||
try { var taggedE = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var g in taggedE) if (!list.Contains(g)) list.Add(g); } catch { var single = SceneObjectLookupCache.Find("thisEnemy"); if (single != null && !list.Contains(single)) list.Add(single); }
|
||||
break;
|
||||
}
|
||||
list.RemoveAll(x => x == null);
|
||||
@@ -730,7 +730,7 @@ public class SkillBuilder : MonoBehaviour
|
||||
{
|
||||
var ui = teamUIController.Instance;
|
||||
if (ui != null) return ui.GetAllyObjectBySlot(slotIndex);
|
||||
var named = GameObject.Find($"ally_0{slotIndex + 1}");
|
||||
var named = SceneObjectLookupCache.Find($"ally_0{slotIndex + 1}");
|
||||
return named;
|
||||
}
|
||||
|
||||
@@ -1414,7 +1414,7 @@ ResolvedGroup:
|
||||
}
|
||||
if (caster == null)
|
||||
{
|
||||
var byName = GameObject.Find($"ally_0{slotIndex + 1}");
|
||||
var byName = SceneObjectLookupCache.Find($"ally_0{slotIndex + 1}");
|
||||
if (byName != null)
|
||||
{
|
||||
caster = byName;
|
||||
@@ -3560,7 +3560,7 @@ ResolvedGroup:
|
||||
LogVerbose($"[SkillBuilder] teamUIController.allySlotIds = [{string.Join(",", teamUIController.Instance.allySlotIds)}]");
|
||||
}
|
||||
// Try to find ally GameObject named by convention
|
||||
var foundGO = GameObject.Find($"ally_0{trackIndex + 1}");
|
||||
var foundGO = SceneObjectLookupCache.Find($"ally_0{trackIndex + 1}");
|
||||
if (foundGO != null)
|
||||
{
|
||||
LogVerbose($"[SkillBuilder] Found GameObject by name ally_0{trackIndex + 1}: {foundGO.name}");
|
||||
|
||||
Reference in New Issue
Block a user