Exemplo n.º 1
0
    protected virtual IEnumerator StartAnimation(ActionWithInvokes actionWithInvokes)
    {
        while (IsAnimating)
        {
            if (!isAnimatingIgnoreTimeScale)
            {
                yield return(new WaitForSeconds(0.1f));
            }
            else
            {
                #if UNITY_5_5_OR_NEWER
                yield return(new WaitForSecondsRealtime(0.1f));
                #else
                yield return(StartCoroutine(WaitForRealTimeSeconds(0.1f)));
                #endif
            }
        }

        if (actionWithInvokes.onFinished != null)
        {
            actionWithInvokes.onFinished(this);
        }

        if (IsHidden)
        {
            DeactivateObjectsToHide();

            if ((CachedTransform.localScale.x < 0.01f) || (CachedTransform.localScale.y < 0.01f))
            {
                gameObject.SetActive(false);
            }
        }
    }
Exemplo n.º 2
0
    protected virtual IEnumerator StartAnimation(ActionWithInvokes actionWithInvokes)
    {
        while (IsAnimating)
        {
            yield return(new WaitForSeconds(0.1f));
        }

        if (actionWithInvokes.onFinished != null)
        {
            actionWithInvokes.onFinished(this);
        }

        if (IsHidden)
        {
            DeactivateObjectsToHide();

            if (CachedTransform1.localScale.x < 0.01f || CachedTransform1.localScale.y < 0.01f)
            {
                gameObject.SetActive(false);
            }
        }
    }