public void UIGoldTextRefresh() { RefreshTween.Kill(); //_goldText.text = string.Format("{0}", OutGameManager.instance._GoldData._Gold); int newGold = OutGameManager.instance._GoldData._Gold; RefreshTween = DOTween.To(() => beforeGold, x => { beforeGold = x; _goldText.text = string.Format("{0}", beforeGold); }, newGold, 0.5f); }
public void GoToPosAndSay(Vector3 position, float flyTime, string message, float messageTime) { if (tweener != null) { tweener.Kill(false); } text.text = " "; transform.GetChild(0).localScale = new Vector3(position.x - transform.position.x < 0 ? -1 : 1, 1, 1); tweener = transform.DOMove(position, flyTime, false).OnComplete(() => Say(message, messageTime)); }
void SetZoomOut() { if (zoomValue != defaultFOV) { if (zoomInTween != null) { print("Has Killed Zoom In"); zoomInTween.Kill(); zoomInTween = null; } DOTween.To(() => zoomValue, x => zoomValue = x, defaultFOV, .5f); } }
public void PauseSeeker(bool pauseState) { if (pauseState) { isIdle = false; StopAllCoroutines(); if (moveTween != null) { moveTween.Kill(); } } else { if (isIdle) { return; } isIdle = true; MoveToNext(); } }
public void DisplayTextBox(string title, string text, float time = 0f) { if (textboxPopAnim != null) { textboxPopAnim.Kill(); textboxFadeAnim.Kill(); } textbox.alpha = 0; textbox.transform.localScale = new Vector3(1.1f, 1.1f, 1f); textboxPopAnim = textbox.transform.DOScale(Vector3.one, 0.2f).SetEase(Ease.OutBack); textboxFadeAnim = textbox.DOFade(1f, 0.2f) .OnComplete(() => textboxFadeAnim = textbox.DOFade(0, 1f).SetDelay(time)); textBoxTitle.text = title; textBoxText.text = text; }
public void DisplayItemBox(SOItem item) { if (itemboxPopAnim != null) { itemboxPopAnim.Kill(); itemboxFadeAnim.Kill(); } itemBox.alpha = 0; itemBox.transform.localScale = new Vector3(1.1f, 1.1f, 1f); itemboxPopAnim = itemBox.transform.DOScale(Vector3.one, 0.2f).SetEase(Ease.OutBack); itemboxFadeAnim = itemBox.DOFade(1f, 0.2f) .OnComplete(() => itemboxFadeAnim = itemBox.DOFade(0, 1f).SetDelay(Mathf.Clamp(item.name.Length * 0.15f + item.description.Length * 0.05f, 3, 10))); itemBoxTitle.text = $"You Picked Up: {item.name}!"; itemBoxText.text = item.description; itemBoxIcon.sprite = item.sprite; }
IEnumerator IRespawnTimmer() { dot.transform.localScale = new Vector3(0.1f, 0.1f, 1); dot.color = new Color(1, 1, 1, 0.1f); DG.Tweening.Core.TweenerCore <Vector3, Vector3, DG.Tweening.Plugins.Options.VectorOptions> pop = null; dot.DOColor(new Color(1, 1, 1, 0.5f), respawnTime).SetEase(Ease.Linear); dot.transform.DOScale(new Vector3(0.4f, 0.4f, 1), respawnTime - 0.15f).SetEase(Ease.Linear) .OnComplete(() => pop = dot.transform.DOScale(new Vector3(0.5f, 0.5f, 1), 0.75f).SetEase(Ease.OutElastic)); yield return(new WaitForSeconds(respawnTime)); disable.SetActive(true); col.enabled = true; if (pop != null) { pop.Kill(); } dot.color = new Color(1, 1, 1, 0); }
public void ChangeBG(Sprite bg) { if (bgBase.sprite == bg || isBGTransitioning && bgOverlay.sprite == bg) { return; } if (isBGTransitioning) { if (bgAnimBase != null) { bgAnimBase.Kill(); } if (bgAnimOverlay != null) { bgAnimOverlay.Kill(); } bgBase.sprite = bg; } isBGTransitioning = true; bgOverlay.sprite = bg; bgBase.color = Color.white; bgBase.DOColor(new Color(1, 1, 1, 0), 1f).SetEase(Ease.Linear); bgOverlay.color = new Color(1, 1, 1, 0); bgAnimOverlay = bgOverlay.DOColor(Color.white, 1f).SetEase(Ease.Linear).OnComplete(() => { bgBase.sprite = bgOverlay.sprite; bgBase.color = Color.white; bgOverlay.color = new Color(1, 1, 1, 0); isBGTransitioning = false; }); }