private void initOpenCloseTweener()
    {
        animationContainer = (base.transform.Find("AnimationContainer") as RectTransform);
        float y = animationContainer.anchoredPosition.y;
        float closedPosition = y - animationContainer.sizeDelta.y;

        openCloseTweener = GetComponent <OpenCloseTweener>();
        openCloseTweener.OnPositionChanged += onPositionChanged;
        openCloseTweener.OnComplete        += onTweenComplete;
        openCloseTweener.Init(y, closedPosition);
        openCloseTweener.SetOpen();
    }
Exemple #2
0
        private void initOpenCloseTweener()
        {
            openPosition = rect.anchoredPosition.y;
            float closedPosition = openPosition - rect.rect.height;

            tweener                    = GetComponent <OpenCloseTweener>();
            tweener.OnComplete        += onTweenComplete;
            tweener.OnPositionChanged += onPositionChanged;
            tweener.Init(openPosition, closedPosition);
            if (wasCellPhoneAutoOpened())
            {
                tweener.SetClosed();
            }
            else
            {
                tweener.SetOpen();
            }
            onTweenComplete();
        }