Exemplo n.º 1
0
    public void CallAnimationClose() // => CanvasGame - ButtonCloseRewardBasicPanel - OnClick
    {
        buttonClosePanelReward.interactable = false;
        GameAnims.moveLabelAnimation(gameObject, parentForFly, imageCoinIncrease, startFlyPoint.localPosition, pointFly.localPosition, 1, ArrivalEndPoint);

        foreach (Transform child in panelReward.GetComponentsInChildren <Transform>())
        {
            if (child.GetComponent <Image>() == null)
            {
                child.GetComponent <Text>().DOFade(0, 1);
            }
            else
            {
                child.GetComponent <Image>().DOFade(0, 1);
            }
        }
    }
Exemplo n.º 2
0
    public static void lerpFillImageLabel(Image imageLabel, float oldValue, float newValue, float lerpValue, Action callback = null)
    {
        float    lerp       = 0f;
        float    lerpEndVal = lerpValue;
        Sequence seq        = DOTween.Sequence();

        while (lerp < lerpEndVal)
        {
            lerp += Time.deltaTime;
            float val = GameAnims.lerp(oldValue, newValue, lerp);
            seq.AppendInterval(Time.deltaTime);
            seq.AppendCallback(() => imageLabel.fillAmount = val);
        }
        seq.AppendInterval(Time.deltaTime);
        seq.AppendCallback(() =>
        {
            imageLabel.fillAmount = newValue;
            if (callback != null)
            {
                callback();
            }
        });
    }
Exemplo n.º 3
0
    public static void lerpTextLabel(Text textLabel, double oldValue, double newValue, float lerpValue, Action callback = null)
    {
        float    lerp       = 0f;
        float    lerpEndVal = lerpValue;
        Sequence seq        = DOTween.Sequence();

        while (lerp < lerpEndVal)
        {
            lerp += Time.deltaTime;
            double val = GameAnims.lerp(oldValue, newValue, lerp);
            seq.AppendInterval(Time.deltaTime);
            seq.AppendCallback(() => textLabel.text = "" + NumberSystem.Output(val));
        }
        seq.AppendInterval(Time.deltaTime);
        seq.AppendCallback(() =>
        {
            textLabel.text = "" + NumberSystem.Output(newValue);
            if (callback != null)
            {
                callback();
            }
        });
    }
Exemplo n.º 4
0
 private void ArrivalEndPoint()
 {
     GameAnims.lerpTextLabel(Income.In.TextCoins, GameManager.In.Coins, GameManager.In.Coins + rewardCoins, 1, StartInicState);
     Income.In.ChangeCoins(rewardCoins);
 }