Fix: cleanup and minor perf improvements
This commit is contained in:
@@ -48,11 +48,14 @@ namespace Unheimlich.Features.Dialogue.UI
|
||||
private int _fadeCanvasTweenId = -1;
|
||||
private int _rotationTweenId = -1;
|
||||
private List<int> _floatingTweenIds = new List<int>();
|
||||
private Camera _mainCamera;
|
||||
|
||||
private static readonly Vector3 ViewportCenter = new Vector3(0.5f, 0.5f, 0f);
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_mainCamera = Camera.main;
|
||||
|
||||
if (_dialogueCanvasGroup == null && _dialoguePanel != null)
|
||||
{
|
||||
_dialogueCanvasGroup = _dialoguePanel.GetComponent<CanvasGroup>();
|
||||
@@ -366,7 +369,7 @@ namespace Unheimlich.Features.Dialogue.UI
|
||||
|
||||
_sortTimer = 0f;
|
||||
|
||||
FloatingWordsSpawner.SortByDistance(_activeChoices, Camera.main);
|
||||
FloatingWordsSpawner.SortByDistance(_activeChoices, _mainCamera);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user