public IEnumerator FadeSlide(Slide slide) { playing = true; slideImage.sprite = slide.sprite; slideText.text = slide.text; slideText.DOColor(Color.white, slidefadeInDuration); slideImage.DOColor(Color.white, slidefadeInDuration); yield return(new WaitForSeconds(slidefadeInDuration)); yield return(new WaitForSeconds(slideWaitTime)); playing = false; }
private void Awake() { txt = GetComponent <TMPro.TMP_Text>(); startScale = transform.localScale; startPos = transform.localPosition; shakeTween = DOTween.Shake(() => transform.position, x => transform.position = x, 0.2f + secondsActive, new Vector3(0.3f, 0.3f, 0)); shakeTween.SetAutoKill(false).Pause(); colorTween = txt.DOColor(new Color(1, 0, 0, 0), secondsActive).SetDelay(0.2f); colorTween.SetAutoKill(false).Pause(); }
override public GeneratedAnimation GenerateAnimation(Transform target) { Sequence animation = DOTween.Sequence(); TMPro.TMP_Text text = target.GetComponent <TMPro.TMP_Text>(); if (!text) { throw new MissingComponentException("Missing TMP_Text component for animation."); } if (reverse) { animation.Append(text.DOColor(targetColor, duration / 2)); animation.Append(text.DOColor(text.color, duration / 2)); } else { animation.Append(text.DOColor(targetColor, duration)); } animation.SetAutoKill(false); animation.SetLoops(loops, loopType); animation.SetEase(generalEase); animation.Pause(); return(new GeneratedAnimation(animation, Name)); }
public void Rotate(bool right) { string newName; if (canRotate) { canRotate = false; startButton.interactable = driverButton.interactable = passengerButton.interactable = false; RectTransform rt = transform.GetChild(0).GetComponent <RectTransform>(); if (right) { newName = rt.GetChild(2).name; //, 2f, scrambleMode:ScrambleMode.All); if (!TeamManager.IsUnlocked(newName)) { newName = "???"; } rt.DOAnchorPos(new Vector2(-704f, 0f), 2f).OnComplete( () => { rt.transform.GetChild(0).SetSiblingIndex(rt.transform.childCount - 1); rt.anchoredPosition = new Vector2(-352f, 0f); }); } else { newName = rt.GetChild(0).name; if (!TeamManager.IsUnlocked(newName)) { newName = "???"; } rt.DOAnchorPos(new Vector2(0f, 0f), 2f).OnComplete(() => { rt.transform.GetChild(rt.transform.childCount - 1).SetSiblingIndex(0); rt.anchoredPosition = new Vector2(-352f, 0f); } ); } text.DOText(newName, 2f, scrambleMode: ScrambleMode.All); text.DOColor((newName == "???"?Color.white:TeamManager.peopleDict[newName].color), 2f); description.DOFade(0f, 1f).OnComplete(() => { description.text = (newName == "???"?"???":TeamManager.peopleDict[newName].description.Replace("_", "\n")); description.DOFade(1f, 1f).OnComplete(() => { canRotate = true; driverButton.interactable = passengerButton.interactable = newName != "???"; startButton.interactable = TeamManager.HasMain(); }); }); } }