Пример #1
0
    public void Reset()
    {
        _missionText.LeanCancel();
        _missionText.transform.localScale = Vector3.one;

        gameObject.LeanCancel();
        UpdateHeight(_minSize);
    }
Пример #2
0
    public void Setup(int number, int rotateStep = 0)
    {
        _number     = number;
        _rotateStep = rotateStep;
        _angle      = _rotateStep * GameConstants.HEXA_STEP_ANGLE;

        OnSwapTheme(GameManager.instance.theme);

        //
        _numberText.LeanCancel();
        _numberText.text = GameManager.instance.displayNumberToPower ? Mathf.Pow(2, _number).ToString() : _number.ToString();
        _numberText.transform.localRotation = Quaternion.Euler(0.0f, 0.0f, _angle);

        _specularMask.gameObject.SetActive(_number == GameConstants.HIGHEST_CELL_NUMBER);
    }
Пример #3
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();
            }
        });
    }