Add utils + refacto
This commit is contained in:
+18
-17
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using Unheimlich.Data.Dialogues;
|
||||
using Unheimlich.Managers;
|
||||
using Unheimlich.Gameplay.Player;
|
||||
using Unheimlich.Utility;
|
||||
|
||||
namespace Unheimlich.Interactions.FloatingWords
|
||||
{
|
||||
@@ -219,12 +220,15 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
if (_choiceTextComponent == null)
|
||||
return;
|
||||
|
||||
if (_textScaleTweenId >= 0)
|
||||
LeanTween.cancel(_textScaleTweenId);
|
||||
TweenHelper.CancelTween(ref _textScaleTweenId);
|
||||
|
||||
_textScaleTweenId = LeanTween.scale(_choiceTextComponent.gameObject, Vector3.one * targetScale, duration)
|
||||
.setEase(LeanTweenType.easeOutQuad)
|
||||
.id;
|
||||
_textScaleTweenId = TweenHelper.ScaleLocal(
|
||||
_choiceTextComponent.gameObject,
|
||||
Vector3.one * targetScale,
|
||||
duration,
|
||||
null,
|
||||
LeanTweenType.easeOutQuad
|
||||
);
|
||||
}
|
||||
|
||||
public void ResetTextScale(float duration = 0.3f)
|
||||
@@ -510,23 +514,20 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
{
|
||||
LeanTween.cancel(gameObject);
|
||||
|
||||
if (_textScaleTweenId >= 0)
|
||||
LeanTween.cancel(_textScaleTweenId);
|
||||
TweenHelper.CancelTween(ref _textScaleTweenId);
|
||||
|
||||
StopOrganicShake();
|
||||
|
||||
ResetSketchFade();
|
||||
|
||||
LeanTween.moveLocal(gameObject, _startLocalPos, duration)
|
||||
.setEase(LeanTweenType.easeOutQuad)
|
||||
.setOnComplete(() => {
|
||||
_positionCaptured = false;
|
||||
|
||||
TweenHelper.MoveLocal(gameObject, _startLocalPos, duration, () => {
|
||||
_positionCaptured = false;
|
||||
|
||||
if (DialogueManager.Instance != null)
|
||||
DialogueManager.Instance.UnlockFocus();
|
||||
|
||||
if (DialogueManager.Instance != null)
|
||||
DialogueManager.Instance.UnlockFocus();
|
||||
|
||||
StartOrganicShake();
|
||||
});
|
||||
StartOrganicShake();
|
||||
}, LeanTweenType.easeOutQuad);
|
||||
|
||||
transform.localScale = Vector3.one * _originalScale;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user