Mini demo with all features
This commit is contained in:
+6
-10
@@ -42,7 +42,7 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
[Tooltip("Maximum width for short texts (1-3 words)")]
|
||||
[SerializeField] private float _shortTextMaxWidth = 80f;
|
||||
[Tooltip("Maximum width for medium texts (4-5 words)")]
|
||||
[SerializeField] private float _mediumTextMaxWidth = 150f;
|
||||
[SerializeField] private float _mediumTextMaxWidth = 120f;
|
||||
[Tooltip("Maximum width for long texts (6-10 words)")]
|
||||
[SerializeField] private float _longTextMaxWidth = 200f;
|
||||
[Tooltip("Maximum width for very long texts (11+ words)")]
|
||||
@@ -123,10 +123,6 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
ghostColor.a = GetGhostTrailAlpha();
|
||||
_ghostTextComponent.color = ghostColor;
|
||||
|
||||
Canvas ghostCanvas = ghostObj.AddComponent<Canvas>();
|
||||
ghostCanvas.overrideSorting = true;
|
||||
ghostCanvas.sortingOrder = -1;
|
||||
|
||||
_positionHistory.Clear();
|
||||
}
|
||||
}
|
||||
@@ -266,18 +262,18 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
DialogueAnimationSettings settings = GetAnimationSettings();
|
||||
float textScaleMultiplier = settings != null ? settings.FocusedTextScaleMultiplier : 0.9f;
|
||||
float textScaleDuration = settings != null ? settings.FocusedTextScaleDuration : 0.3f;
|
||||
SetTextScale(textScaleMultiplier, textScaleDuration);
|
||||
SetTextScale(_originalTextScale * textScaleMultiplier, textScaleDuration);
|
||||
}
|
||||
|
||||
transform.localScale = Vector3.one * Mathf.Lerp(_originalScale, MAX_FOCUS_SCALE, progress);
|
||||
// transform.localScale = Vector3.one * Mathf.Lerp(_originalScale, MAX_FOCUS_SCALE, progress);
|
||||
|
||||
bool shouldMoveToPlayer = GetMoveTowardPlayerOnFocus();
|
||||
|
||||
if (shouldMoveToPlayer && Player.Instance != null)
|
||||
if (shouldMoveToPlayer && PlayerController.Instance != null)
|
||||
{
|
||||
float distance = GetFocusDistanceFromPlayer();
|
||||
Vector3 targetPos = Player.Instance.transform.position
|
||||
+ Player.Instance.transform.forward * distance;
|
||||
Vector3 targetPos = PlayerController.Instance.transform.position
|
||||
+ PlayerController.Instance.transform.forward * distance;
|
||||
transform.position = Vector3.Lerp(transform.position, targetPos, Time.deltaTime * _focusLerpSpeed);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user