Hallucination system

This commit is contained in:
Ferlat Thibaud
2026-03-16 17:06:47 +01:00
parent 10faf74405
commit 0d968f75ab
44 changed files with 2860 additions and 909 deletions
@@ -253,7 +253,8 @@ namespace Unheimlich.Features.Dialogue.UI
{
if (!_positionCaptured)
{
_startLocalPos = transform.localPosition;
// Subtract shake offset to get the clean base position, not the shaken one
_startLocalPos = transform.localPosition - _shakeOffset;
_positionCaptured = true;
LeanTween.cancel(gameObject);
@@ -516,13 +517,15 @@ namespace Unheimlich.Features.Dialogue.UI
ResetSketchFade();
// Reset position capture and restart shake immediately — don't rely on a LeanTween
// callback for this, since stale tween IDs (Domain Reload disabled) can silently
// drop callbacks, leaving some words permanently non-shaking.
_positionCaptured = false;
StartOrganicShake();
TweenHelper.MoveLocal(gameObject, _startLocalPos, duration, () => {
_positionCaptured = false;
if (DialogueManager.Instance != null)
DialogueManager.Instance.UnlockFocus();
StartOrganicShake();
}, LeanTweenType.easeOutQuad);
transform.localScale = Vector3.one * _originalScale;