示例#1
0
 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;
 }
示例#2
0
    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);
    }
示例#3
0
    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);
    }
示例#4
0
    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);
    }
示例#5
0
 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()
         );
 }
示例#6
0
 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(); });
     }
 }
示例#7
0
 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);
     }
 }
示例#8
0
    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);
    }
示例#9
0
 void OnEnable()
 {
     Tween.CanvasGroupAlpha(GetComponent <CanvasGroup> (), 0, 1, .5f, 0);
 }
示例#10
0
 private IEnumerator Fade(float endValue)
 {
     Tween.CanvasGroupAlpha(_textCanvasGroup, endValue, _fadeDuration, 0);
     yield return(Yielders.WaitForSeconds(_fadeDuration));
 }
示例#11
0
    private void Unpause()
    {
        Tween.CanvasGroupAlpha(overlay, 1f, 0, 0.2f, 0f, Tween.EaseOut, Tween.LoopType.None, null, null, false);

        StartCoroutine(Pausing());
    }
示例#12
0
 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);
 }
示例#13
0
 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);
 }
示例#14
0
 private void FadeOut()
 {
     Tween.CanvasGroupAlpha(textCanvasGroup, 1f, 0f, duration, delay + 1f, Tween.EaseInOut, Tween.LoopType.None, null, null, false);
 }