UI换了很多,spine主视觉停用

This commit is contained in:
FloatGaming
2026-06-15 20:17:25 +08:00
parent 5eec879582
commit 216ab08e8d
3634 changed files with 814422 additions and 382766 deletions
@@ -10,6 +10,8 @@ public class UI_CharacterDialogController : MonoBehaviour
[SerializeField] private string requiredSceneName = "UI_UI";
[SerializeField] private string characterObjectName = "Image_Character";
[SerializeField] private string dialogObjectName = "UI_DIALOG";
[SerializeField] private RectTransform characterObject;
[SerializeField] private RectTransform dialogObject;
[Header("Enter")]
[SerializeField] private float enterDuration = 0.3f;
@@ -127,7 +129,9 @@ public class UI_CharacterDialogController : MonoBehaviour
if (!scene.IsValid() || !scene.isLoaded)
scene = SceneManager.GetActiveScene();
Transform dialogTr = FindInSceneByName(scene, dialogObjectName);
Transform dialogTr = dialogObject;
if (dialogTr == null)
dialogTr = FindInSceneByName(scene, dialogObjectName);
if (dialogTr == null)
dialogTr = FindInSceneByName(SceneManager.GetActiveScene(), dialogObjectName);
if (dialogTr != null)
@@ -155,7 +159,9 @@ public class UI_CharacterDialogController : MonoBehaviour
}
}
Transform characterTr = FindInSceneByName(scene, characterObjectName);
Transform characterTr = characterObject;
if (characterTr == null)
characterTr = FindInSceneByName(scene, characterObjectName);
if (characterTr == null)
characterTr = FindInSceneByName(SceneManager.GetActiveScene(), characterObjectName);
if (characterTr != null)
@@ -409,6 +415,13 @@ static class UI_CharacterDialogControllerBootstrap
if (!string.Equals(scene.name, SceneName, System.StringComparison.OrdinalIgnoreCase))
return;
UI_CharacterDialogController existing = FindControllerInScene(scene);
if (existing != null)
{
existing.RebindSoon();
return;
}
GameObject host = FindHostInScene(scene, HostName);
if (host == null)
{
@@ -422,6 +435,23 @@ static class UI_CharacterDialogControllerBootstrap
controller.RebindSoon();
}
private static UI_CharacterDialogController FindControllerInScene(Scene scene)
{
if (!scene.IsValid() || !scene.isLoaded)
return null;
UI_CharacterDialogController[] controllers = UnityEngine.Object.FindObjectsByType<UI_CharacterDialogController>(FindObjectsInactive.Include, FindObjectsSortMode.None);
for (int i = 0; i < controllers.Length; i++)
{
UI_CharacterDialogController controller = controllers[i];
if (controller == null)
continue;
if (controller.gameObject.scene == scene)
return controller;
}
return null;
}
private static GameObject FindHostInScene(Scene scene, string hostName)
{
if (!scene.IsValid() || !scene.isLoaded)