public void SetAreaText(string newAreaName) { StopAllCoroutines(); textComponent.text = ""; Tween.CanvasGroupAlpha(textCanvasGroup, 0f, 1f, duration, delay, Tween.EaseLinear, Tween.LoopType.None, null, FadeOut, false); textComponent.text = newAreaName; }
public IEnumerator EndGame() { Tween.CanvasGroupAlpha(overlay, 0f, 1f, 2f, 1f, null, Tween.LoopType.None, null, null, false); yield return(new WaitForSeconds(3f)); SceneManager.LoadScene(1); }
private IEnumerator StartGame() { Tween.CanvasGroupAlpha(overlay, 0f, 1f, 0.5f, 0f, null, Tween.LoopType.None, null, null, false); starting = true; yield return(new WaitForSeconds(0.5f)); SceneManager.LoadScene(2); }
void DoAlpha(TweenData data) { CanvasGroup cg = transform.GetComponent <CanvasGroup>(); if (cg == null) { Debug.LogWarning("Trying to do alpha change without a canvas group", gameObject); return; } Tween.CanvasGroupAlpha(cg, data.StartAlpha, data.EndAlpha, data.Duration, data.Delay, data.Curve, Tween.LoopType.None, null, OnTweenFinish); }
public void TransitionOpacity(CanvasGroup group, float endValue, TweenArgs tween, Action onComplete) { Tween.CanvasGroupAlpha( group, endValue, Mathf.Clamp(tween.Duration, 1f / int.MaxValue, Mathf.Infinity), // Make sure duration is not 0 else tweener jumps to final value tween.Delay, easeCurve: Convert(tween.Curve), loop: Convert(tween.Loop), completeCallback: () => onComplete?.Invoke() ); }
public void PlayReverse() { if (forceFrom) { _tween = Tween.CanvasGroupAlpha(target, toAlpha, fromAlpha, duration, delay, easing, loopType, delegate { startCallback?.Invoke(); }, delegate { completeCallback?.Invoke(); }); } else { _tween = Tween.CanvasGroupAlpha(target, fromAlpha, duration, delay, easing, loopType, delegate { startCallback?.Invoke(); }, delegate { completeCallback?.Invoke(); }); } }
public void ShowInventory(bool state) { if (state == true) { CreateInventory(); Tween.CanvasGroupAlpha(inventoryCanvasGroup, 0.0f, 1.0f, 0.5f, 0.0f, Tween.EaseInOut, Tween.LoopType.None, null, null, false); } else { DisableItems(); Tween.CanvasGroupAlpha(inventoryCanvasGroup, 1.0f, 0.0f, 0.5f, 0.0f, Tween.EaseInOut, Tween.LoopType.None, null, null, false); } }
private IEnumerator StartGame() { Tween.CanvasGroupAlpha(overlay, 1f, 0.25f, 0.75f, 0f, Tween.EaseIn, Tween.LoopType.None, null, null, false); yield return(new WaitForSecondsRealtime(0.75f)); countdownLabel.text = "3"; countdownObject.SetActive(true); yield return(new WaitForSecondsRealtime(0.75f)); countdownObject.SetActive(false); yield return(new WaitForSecondsRealtime(0.25f)); countdownLabel.text = "2"; countdownObject.SetActive(true); yield return(new WaitForSecondsRealtime(0.75f)); countdownObject.SetActive(false); yield return(new WaitForSecondsRealtime(0.25f)); countdownLabel.text = "1"; countdownObject.SetActive(true); yield return(new WaitForSecondsRealtime(0.75f)); countdownObject.SetActive(false); Tween.CanvasGroupAlpha(overlay, 0.25f, 0f, 0.25f, 0f, Tween.EaseIn, Tween.LoopType.None, null, null, false); yield return(new WaitForSecondsRealtime(0.25f)); Time.timeScale = 1f; playing = true; countdownLabel.text = "GO"; countdownObject.SetActive(true); yield return(new WaitForSecondsRealtime(0.25f)); countdownObject.SetActive(false); }
void OnEnable() { Tween.CanvasGroupAlpha(GetComponent <CanvasGroup> (), 0, 1, .5f, 0); }
private IEnumerator Fade(float endValue) { Tween.CanvasGroupAlpha(_textCanvasGroup, endValue, _fadeDuration, 0); yield return(Yielders.WaitForSeconds(_fadeDuration)); }
private void Unpause() { Tween.CanvasGroupAlpha(overlay, 1f, 0, 0.2f, 0f, Tween.EaseOut, Tween.LoopType.None, null, null, false); StartCoroutine(Pausing()); }
public void Refill() { Tween.LocalScale(transform, new Vector3(2, 2, 2), Vector3.one, 0.25f, 0f, Tween.EaseIn); Tween.CanvasGroupAlpha(canvas, 0f, 1f, 0.25f, 0f, Tween.EaseIn); }
public void Deplete() { Tween.LocalScale(transform, Vector3.one, new Vector3(2, 2, 2), 0.25f, 0f, Tween.EaseOut); Tween.CanvasGroupAlpha(canvas, 1f, 0f, 0.25f, 0f, Tween.EaseOut); }
private void FadeOut() { Tween.CanvasGroupAlpha(textCanvasGroup, 1f, 0f, duration, delay + 1f, Tween.EaseInOut, Tween.LoopType.None, null, null, false); }