public void Animate(float width, float height, float thickens) { canvasGroup.alpha = 0; canvasGroup.DoFade(1, .3f).SetEase(Ease.InQuad).SetLoops(2, LoopType.Yoyo); left.SetWidth(thickens); right.SetWidth(thickens); top.SetHeight(thickens); bottom.SetHeight(thickens); left.offsetMin = new Vector2(left.offsetMin.x, -thickens); left.offsetMax = new Vector2(left.offsetMax.x, -thickens); left.SetHeight(1 + 2 * thickens); right.offsetMin = new Vector2(right.offsetMin.x, -thickens); right.offsetMax = new Vector2(right.offsetMax.x, -thickens); right.SetHeight(1 + 2 * thickens); var canvasRect = canvasGroup.GetComponent <RectTransform>(); canvasRect.SetWidth(width); canvasRect.SetHeight(height); canvasRect.DoWidth(canvasRect.GetWidth() + .4f, .8f); canvasRect.DoHeight(canvasRect.GetHeight() + .4f, .8f); }
protected override IEnumerator PlayAdmissionAnimation() { if (startAlphaRate == 1) { yield break; } _canvasGroup.DoFade(_initAlpha, durationShow).SetEase(easeActive); yield return(null); }
protected override void OnSetActive(bool active) { if (!cg) { cg = GetComponent <CanvasGroup>(); } if (active) { cg.alpha = 0.5f; cg.DoFade(1, durationShow).SetEase(easeActive); if (autoHide) { AutoHide().Go().Delay(UnitySecond.New.Start(durationShow)); } } base.OnSetActive(active); }
private void Awake() { gameOverScreen.gameObject.SetActive(false); gameOverScreen.alpha = 0; scoreText.alpha = 0; retryText.alpha = 0; tween = DOTween.Sequence() .Insert(0, gameOverScreen.DoFade(1, .4f)) .Insert(0.2f, scoreText.DoFade(1, .4f)) .Insert(0.2f, retryText.DoFade(1, .4f)) .SetAutoKill(false) .SetUpdate(true) .Pause(); retryText.gameObject.AddComponent <EventTrigger>() .PointerClick(arg0 => SceneManager.LoadScene(SceneManager.GetActiveScene().name)); }