add : lighting of the stairs and motion blur when subtitles are enabled

This commit is contained in:
Ferlat Thibaud
2026-06-01 18:48:39 +02:00
parent defd7434ec
commit 9fc9979caa
5 changed files with 613 additions and 242 deletions
@@ -10,52 +10,41 @@ namespace Unheimlich.Features.Dialogue
public class LocalizedSubtitle : MonoBehaviour
{
[SerializeField] private OctoLocalizedTextData _data;
private OctoLocalizedText _localizedText; // A retirer
private PerLetterFontShifter _shifter;
private Action localize;
private Action _localize;
void Awake()
{
_localizedText = GetComponent<OctoLocalizedText>(); // A retirer
_shifter = GetComponent<PerLetterFontShifter>();
}
void Start()
{
if (!OctoFramework.Instance)
{
Debug.LogWarning($"OctoCore.Instance not found");
Debug.LogWarning("[LocalizedSubtitle] OctoCore.Instance not found");
return;
}
Localize();
OctoFramework.Instance.Localization.SubscribeOnLanguageWrittenChange(localize = Localize);
OctoFramework.Instance.Localization.SubscribeOnLanguageWrittenChange(_localize = Localize);
}
void OnDestroy()
{
if (!OctoFramework.Instance) return;
if (localize != null)
if (_localize != null)
{
OctoFramework.Instance.Localization.UnsubscribeOnLanguageWrittenChange(localize);
localize = null;
OctoFramework.Instance.Localization.UnsubscribeOnLanguageWrittenChange(_localize);
_localize = null;
}
}
private void Localize()
void Localize()
{
string localized = "Not localized";
if (_data)
{
localized = OctoLocalization.GetLocalizedText(_data);
}
else // A retirer
{ // A retirer
_localizedText.Localize(); // A retirer
localized = GetComponent<TMPro.TextMeshProUGUI>().text; // A retirer
} // A retirer
// Read it back from the source TMP (it's disabled but the .text field is still set).
string localized = _data ? OctoLocalization.GetLocalizedText(_data) : string.Empty;
_shifter.SetText(localized);
}
}