예제 #1
0
    /// <summary>
    /// Show the element.
    /// </summary>
    public void Show()
    {
        if (extendedCoroutine != null && extendedCoroutine.IsFinshed == false)
        {
            return;
        }

        extendedCoroutine = new ExtendedCoroutine
                            (
            this,
            EnumeratorUtil.GoToInSecondsLocalCurve(transform, endPos, hideShowCurve, showInSeconds),
            OnShownFinished,
            true
                            );
    }
예제 #2
0
    /// <summary>
    /// Displays the name first and then displays the health.
    /// </summary>
    /// <param name="nameDisplayLength">How long the name should display for.</param>
    /// <returns></returns>
    private IEnumerator DoHealthAnimation(float nameDisplayLength)
    {
        nameObject.SetActive(true);

        RectTransform rectTransform = nameObject.transform as RectTransform;

        rectTransform.localPosition = new Vector2(0.0f, 0.0f);
        Vector3 pos = new Vector3(0.0f, -rectTransform.rect.height * 1.5f);

        yield return(EnumeratorUtil.GoToInSecondsLocalCurve(rectTransform, pos, nameCurve, nameDisplayLength));

        nameObject.SetActive(false);

        group.alpha = 0.0f;
        healthObject.SetActive(true);
        yield return(EnumeratorUtil.FadeGroupCurve(group, healthCurve, healthFadeInTime));
    }
예제 #3
0
 /// <summary>
 /// Starts the fading out of the element.
 /// </summary>
 public void FadeOut()
 {
     GetPositions(out Vector2 left, out Vector2 mid, out Vector2 right);
     transform.localPosition = mid;
     StartCoroutine(EnumeratorUtil.GoToInSecondsLocalCurve(transform, fadeFromRight ? left : right, loadingScreenManager.FadeOutCurve, loadingScreenManager.FadeOutTime));
 }
예제 #4
0
 /// <summary>
 /// Starts the fading in of the element.
 /// </summary>
 public void FadeIn()
 {
     GetPositions(out Vector2 left, out Vector2 mid, out Vector2 right);
     transform.localPosition = fadeFromRight ? right : left;
     StartCoroutine(EnumeratorUtil.GoToInSecondsLocalCurve(transform, mid, loadingScreenManager.FadeInCurve, loadingScreenManager.FadeInTime));
 }
예제 #5
0
 public IEnumerator OnHide()
 {
     yield return(EnumeratorUtil.GoToInSecondsLocalCurve(transform, GetStartPos(), hideShowCurve, showInSeconds));
 }