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); } } }
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(); } }); }
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(); } }); }
private void ArrivalEndPoint() { GameAnims.lerpTextLabel(Income.In.TextCoins, GameManager.In.Coins, GameManager.In.Coins + rewardCoins, 1, StartInicState); Income.In.ChangeCoins(rewardCoins); }