UI换了很多,spine主视觉停用
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using Spine;
|
||||
using Spine.Unity;
|
||||
using SmoothShakeFree;
|
||||
@@ -12,7 +12,14 @@ using UnityEditor;
|
||||
|
||||
public class teamUIController : MonoBehaviour
|
||||
{
|
||||
private const bool VerboseLogs = false;
|
||||
private static readonly bool VerboseLogs = false;
|
||||
private static string NoEnemyLabel => LocalizationService.Get("enemy.none", "(No Enemy)");
|
||||
private static string EnemyDefeatedLabel => LocalizationService.Get("enemy.all_defeated", "所有敌人已被击败");
|
||||
private static string EnemyTypeNormalLabel => LocalizationService.Get("enemy.type.normal", "(普通敌人)");
|
||||
private static string EnemyTypeEliteLabel => LocalizationService.Get("enemy.type.elite", "(精英敌人)");
|
||||
private static string EnemyTypeBossLabel => LocalizationService.Get("enemy.type.boss", "(Boss)");
|
||||
private static string EnemyTypeLegendLabel => LocalizationService.Get("enemy.type.legend", "(史诗野怪)");
|
||||
private static string EnemyTypeGuardianLabel => LocalizationService.Get("enemy.type.guardian", "(远古巨龙)");
|
||||
public static teamUIController Instance
|
||||
{
|
||||
get;
|
||||
@@ -1317,7 +1324,7 @@ public class teamUIController : MonoBehaviour
|
||||
// If candidate not found or no components under it, try direct scene object by name
|
||||
if (!string.IsNullOrEmpty(sceneNameHint))
|
||||
{
|
||||
var goByName = GameObject.Find(sceneNameHint);
|
||||
var goByName = SceneObjectLookupCache.Find(sceneNameHint);
|
||||
if (goByName != null)
|
||||
{
|
||||
var tmp2 = goByName.GetComponent<TextMeshProUGUI>();
|
||||
@@ -1352,10 +1359,12 @@ public class teamUIController : MonoBehaviour
|
||||
{
|
||||
var all = Resources.FindObjectsOfTypeAll<TextMeshProUGUI>();
|
||||
var lowHint = sceneNameHint.ToLower();
|
||||
bool checkPm = lowHint.Contains("pm");
|
||||
foreach (var t in all)
|
||||
{
|
||||
if (t == null || t.gameObject == null) continue;
|
||||
if (t.gameObject.name.ToLower().Contains(lowHint) || t.gameObject.name.ToLower().Contains("pm") && t.gameObject.name.ToLower().Contains(lowHint))
|
||||
var lowerName = t.gameObject.name.ToLower();
|
||||
if (lowerName.Contains(lowHint) || (checkPm && lowerName.Contains("pm")))
|
||||
return t;
|
||||
}
|
||||
}
|
||||
@@ -1412,7 +1421,7 @@ public class teamUIController : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
var byName = GameObject.Find("currentTotalScore");
|
||||
var byName = SceneObjectLookupCache.Find("currentTotalScore");
|
||||
if (byName != null)
|
||||
{
|
||||
var t = byName.GetComponent<TextMeshProUGUI>() ?? byName.GetComponent<Text>()?.gameObject.AddComponent<TextMeshProUGUI>();
|
||||
@@ -1531,7 +1540,7 @@ public class teamUIController : MonoBehaviour
|
||||
private void InitializeEnemyInstance()
|
||||
{
|
||||
// Try to find an existing enemy object in scene
|
||||
enemyCombatantInstance = FindFirstObjectByType<EnemyCombatant>();
|
||||
enemyCombatantInstance = SceneObjectLookupCache.FindFirst<EnemyCombatant>();
|
||||
if (enemyCombatantInstance == null)
|
||||
{
|
||||
var go = new GameObject("thisEnemy");
|
||||
@@ -1823,14 +1832,14 @@ public class teamUIController : MonoBehaviour
|
||||
if (_spineSystemObject != null) _spineSystemObject.SetActive(false);
|
||||
if (_imgSystemObject != null) _imgSystemObject.SetActive(false);
|
||||
if (objectFather_enemy != null) objectFather_enemy.SetActive(true);
|
||||
if (currentEnemy_nameText != null) currentEnemy_nameText.text = "(No Enemy)";
|
||||
if (currentEnemy_nameText != null) currentEnemy_nameText.text = NoEnemyLabel;
|
||||
if (currentEnemy_characterImage != null) currentEnemy_characterImage.sprite = null;
|
||||
if (currentEnemy_healthImage != null) currentEnemy_healthImage.fillAmount = 0f;
|
||||
if (currentEnemy_fadehealthImage != null) currentEnemy_fadehealthImage.fillAmount = 0f;
|
||||
if (currentEnemy_healthRate != null) currentEnemy_healthRate.text = "0/0";
|
||||
if (currentEnemy_manaImage != null) currentEnemy_manaImage.fillAmount = 0f;
|
||||
if (currentEnemy_fademanaImage != null) currentEnemy_fademanaImage.fillAmount = 0f;
|
||||
if (currentEnemy_typeText != null) currentEnemy_typeText.text = "(普通敌人)";
|
||||
if (currentEnemy_typeText != null) currentEnemy_typeText.text = EnemyTypeNormalLabel;
|
||||
HideEnemyBountyUiImmediate();
|
||||
UpdateEnemyListText();
|
||||
// Documentation text normalized.
|
||||
@@ -1864,14 +1873,14 @@ public class teamUIController : MonoBehaviour
|
||||
hurtColor.a = 0f;
|
||||
currentEnemy_hurtRedImage.color = hurtColor;
|
||||
}
|
||||
if (currentEnemy_nameText != null) currentEnemy_nameText.text = "所有敌人已被击败";
|
||||
if (currentEnemy_nameText != null) currentEnemy_nameText.text = EnemyDefeatedLabel;
|
||||
// if (currentEnemy_characterImage != null) currentEnemy_characterImage.sprite = null;
|
||||
if (currentEnemy_healthImage != null) currentEnemy_healthImage.fillAmount = 0f;
|
||||
if (currentEnemy_fadehealthImage != null) currentEnemy_fadehealthImage.fillAmount = 0f;
|
||||
if (currentEnemy_healthRate != null) currentEnemy_healthRate.text = "0/0";
|
||||
if (currentEnemy_manaImage != null) currentEnemy_manaImage.fillAmount = 0f;
|
||||
if (currentEnemy_fademanaImage != null) currentEnemy_fademanaImage.fillAmount = 0f;
|
||||
if (currentEnemy_typeText != null) currentEnemy_typeText.text = "(普通敌人)";
|
||||
if (currentEnemy_typeText != null) currentEnemy_typeText.text = EnemyTypeNormalLabel;
|
||||
if (!enemyBountyTransitionActive)
|
||||
HideEnemyBountyUiImmediate();
|
||||
UpdateEnemyListText();
|
||||
@@ -1892,7 +1901,7 @@ public class teamUIController : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
var sb = UnityEngine.Object.FindAnyObjectByType<SkillBuilder>();
|
||||
var sb = SceneObjectLookupCache.FindAny<SkillBuilder>();
|
||||
if (sb != null)
|
||||
{
|
||||
sb.TriggerOnAllEnemiesDefeated();
|
||||
@@ -1932,19 +1941,19 @@ public class teamUIController : MonoBehaviour
|
||||
switch (so.enemyType)
|
||||
{
|
||||
case EnemyData_SO.EnemyType.Elite:
|
||||
currentEnemy_typeText.text = "(精英敌人)";
|
||||
currentEnemy_typeText.text = EnemyTypeEliteLabel;
|
||||
break;
|
||||
case EnemyData_SO.EnemyType.Boss:
|
||||
currentEnemy_typeText.text = "(Boss)";
|
||||
currentEnemy_typeText.text = EnemyTypeBossLabel;
|
||||
break;
|
||||
case EnemyData_SO.EnemyType.Legend:
|
||||
currentEnemy_typeText.text = "(史诗野怪)";
|
||||
currentEnemy_typeText.text = EnemyTypeLegendLabel;
|
||||
break;
|
||||
case EnemyData_SO.EnemyType.Guardian:
|
||||
currentEnemy_typeText.text = "(远古巨龙)";
|
||||
currentEnemy_typeText.text = EnemyTypeGuardianLabel;
|
||||
break;
|
||||
default:
|
||||
currentEnemy_typeText.text = "(普通敌人)";
|
||||
currentEnemy_typeText.text = EnemyTypeNormalLabel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user