Exemplo n.º 1
0
    public void Emphasize()
    {
        float halfTime = _missionTextScalingTime * 0.5f;

        _missionText.LeanCancel();

        LTSeq sequence = LeanTween.sequence();

        sequence.append(_missionText.LeanScale(_missionTextScale, halfTime).setEaseOutBack());
        sequence.append(_missionText.LeanScale(Vector3.one, halfTime).setEaseInBack());
    }
Exemplo n.º 2
0
    void ShowHUD(Vector3 position, string message, Action onComplete = null)
    {
        position = _cachedMainCamera.WorldToScreenPoint(position);

        Vector3 begin = position + _addedScoreBeginOffset;
        Vector3 end   = position + _addedScoreEndOffset;

        _addedScoreText.text = message;

        float appearTime    = _addedScoreAppearTime * HUD_APPEAR_RATIO;
        float disappearTime = _addedScoreAppearTime * (1.0f - HUD_APPEAR_RATIO);

        _addedScoreText.LeanCancel();

        LTSeq sequence = LeanTween.sequence();

        sequence.append(() => _addedScoreText.LeanAlpha(0.0f, 1.0f, appearTime));
        sequence.append(_addedScoreText.LeanScale(Vector3.zero, Vector3.one, appearTime).setEaseOutBack());
        sequence.append(HUD_DISAPPEAR_DELAY);
        sequence.append(() => _addedScoreText.LeanAlpha(0.0f, disappearTime));
        sequence.append(_addedScoreText.LeanMove(begin, end, disappearTime));

        sequence.append(() => {
            if (onComplete != null)
            {
                onComplete();
            }
        });
    }