Rework diapason with octo arms
This commit is contained in:
+57
-47
@@ -94,14 +94,13 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
|
||||
_isEffectActive = true;
|
||||
|
||||
_scribbleTweenId = TweenHelper.AnimateMaterialFloat(
|
||||
gameObject,
|
||||
_scribbleMaterialInstance,
|
||||
ProgressID,
|
||||
0f,
|
||||
1f,
|
||||
scribbleDuration,
|
||||
() => {
|
||||
_scribbleTweenId = LeanTween.value(gameObject, 0f, 1f, scribbleDuration)
|
||||
.setEase(LeanTweenType.easeInOutQuad)
|
||||
.setOnUpdate((float val) => {
|
||||
if (_scribbleMaterialInstance != null)
|
||||
_scribbleMaterialInstance.SetFloat(ProgressID, val);
|
||||
})
|
||||
.setOnComplete(() => {
|
||||
_scribbleTweenId = -1;
|
||||
|
||||
float ghostAlphaRatio = _ghostTextComponent != null ? (_originalGhostColor.a / _originalTextColor.a) : 0f;
|
||||
@@ -126,63 +125,74 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
})
|
||||
.setOnComplete(() => {
|
||||
_fadeTweenId = -1;
|
||||
_isEffectActive = false;
|
||||
}).id;
|
||||
},
|
||||
LeanTweenType.easeInOutQuad);
|
||||
}).id;
|
||||
}
|
||||
|
||||
public void ResetEffect()
|
||||
{
|
||||
if (!_overlayCreated || _scribbleOverlay == null)
|
||||
{
|
||||
_isEffectActive = false;
|
||||
return;
|
||||
}
|
||||
|
||||
bool overlayIsActive = _scribbleOverlay.gameObject.activeSelf;
|
||||
|
||||
if (!overlayIsActive)
|
||||
{
|
||||
_isEffectActive = false;
|
||||
return;
|
||||
}
|
||||
|
||||
CancelActiveTweens();
|
||||
_isEffectActive = false;
|
||||
|
||||
if (_scribbleMaterialInstance != null)
|
||||
{
|
||||
float currentProgress = _scribbleMaterialInstance.GetFloat(ProgressID);
|
||||
|
||||
if (currentProgress > 0f)
|
||||
{
|
||||
_scribbleTweenId = TweenHelper.AnimateMaterialFloat(
|
||||
gameObject,
|
||||
_scribbleMaterialInstance,
|
||||
ProgressID,
|
||||
currentProgress,
|
||||
0f,
|
||||
0.3f,
|
||||
() => {
|
||||
_scribbleTweenId = -1;
|
||||
if (_scribbleOverlay != null)
|
||||
_scribbleOverlay.gameObject.SetActive(false);
|
||||
},
|
||||
LeanTweenType.easeOutQuad);
|
||||
}
|
||||
_scribbleTweenId = LeanTween.value(gameObject, currentProgress, 0f, 0.3f)
|
||||
.setEase(LeanTweenType.easeOutQuad)
|
||||
.setOnUpdate((float val) => {
|
||||
if (_scribbleMaterialInstance != null)
|
||||
_scribbleMaterialInstance.SetFloat(ProgressID, val);
|
||||
})
|
||||
.setOnComplete(() => {
|
||||
_scribbleTweenId = -1;
|
||||
if (_scribbleOverlay != null)
|
||||
_scribbleOverlay.gameObject.SetActive(false);
|
||||
}).id;
|
||||
}
|
||||
|
||||
if (_textComponent != null)
|
||||
{
|
||||
float currentAlpha = _textComponent.color.a;
|
||||
float ghostAlphaRatio = _ghostTextComponent != null ? (_originalGhostColor.a / _originalTextColor.a) : 0f;
|
||||
|
||||
if (currentAlpha < _originalTextColor.a)
|
||||
{
|
||||
float ghostAlphaRatio = _ghostTextComponent != null ? (_originalGhostColor.a / _originalTextColor.a) : 0f;
|
||||
|
||||
_fadeTweenId = TweenHelper.FadeText(
|
||||
gameObject,
|
||||
_textComponent,
|
||||
_ghostTextComponent,
|
||||
_originalTextColor.a,
|
||||
0.3f,
|
||||
ghostAlphaRatio,
|
||||
() => { _fadeTweenId = -1; },
|
||||
LeanTweenType.easeOutQuad);
|
||||
}
|
||||
_fadeTweenId = LeanTween.value(gameObject, currentAlpha, _originalTextColor.a, 0.3f)
|
||||
.setEase(LeanTweenType.easeOutQuad)
|
||||
.setOnUpdate((float val) => {
|
||||
if (_textComponent != null)
|
||||
{
|
||||
_textComponent.color = _textComponent.color.WithAlpha(val);
|
||||
}
|
||||
|
||||
if (_ghostTextComponent != null)
|
||||
{
|
||||
_ghostTextComponent.color = _ghostTextComponent.color.WithAlpha(val * ghostAlphaRatio);
|
||||
}
|
||||
|
||||
if (_scribbleOverlay != null)
|
||||
{
|
||||
_scribbleOverlay.color = _scribbleOverlay.color.WithAlpha(val);
|
||||
}
|
||||
})
|
||||
.setOnComplete(() => {
|
||||
_fadeTweenId = -1;
|
||||
}).id;
|
||||
}
|
||||
|
||||
if (_scribbleOverlay != null)
|
||||
{
|
||||
_scribbleOverlay.color = _scribbleOverlay.color.WithAlpha(1f);
|
||||
}
|
||||
|
||||
_isEffectActive = false;
|
||||
}
|
||||
|
||||
private void CancelActiveTweens()
|
||||
|
||||
Reference in New Issue
Block a user