예제 #1
0
    IEnumerator Start()
    {
        LayoutAnchor anchor = GetComponent <LayoutAnchor>();

        while (true)
        {
            for (int i = 0; i < 9; ++i)
            {
                for (int j = 0; j < 9; ++j)
                {
                    TextAnchor a1 = (TextAnchor)i;
                    TextAnchor a2 = (TextAnchor)j;
                    Debug.Log(string.Format("A1:{0}   A2:{1}", a1, a2));
                    if (animated)
                    {
                        Tweener t = anchor.MoveToAnchorPosition(a1, a2, Vector2.zero);
                        while (t != null)
                        {
                            yield return(null);
                        }
                    }
                    else
                    {
                        anchor.SnapToAnchorPosition(a1, a2, Vector2.zero);
                    }
                    yield return(new WaitForSeconds(delay));
                }
            }
        }
    }
예제 #2
0
    public Tweener SetPosition(Position p, bool animated)
    {
        CurrentPosition = p;
        if (CurrentPosition == null)
        {
            return(null);
        }

        if (InTransition)
        {
            Transition.easingControl.Stop();
        }

        if (animated)
        {
            Debug.Log("Animated");
            Transition = anchor.MoveToAnchorPosition(p.myAnchor, p.parentAnchor, p.offset);
            return(Transition);
        }
        else
        {
            Debug.Log("Not animated");
            anchor.SnapToAnchorPosition(p.myAnchor, p.parentAnchor, p.offset);
            return(null);
        }
    }
예제 #3
0
    public Tweener SetPosition(Position p, bool animated)
    {
        CurrentPosition = p;
        if (CurrentPosition == null)
        {
            return(null);
        }

        if (InTransition)
        {
            Transition.Stop();
        }

        if (animated)
        {
            Transition = anchor.MoveToAnchorPosition(p.myAnchor, p.parentAnchor, p.offset);
            return(Transition);
        }

        else
        {
            anchor.SnapToAnchorPosition(p.myAnchor, p.parentAnchor, p.offset);
            return(null);
        }
    }
예제 #4
0
    IEnumerator Start()
    {
        LayoutAnchor anchor = GetComponent <LayoutAnchor>();

        while (true)
        {
            for (int i = 0; i < 9; ++i)
            {
                for (int j = 0; j < 9; ++j)
                {
                    // 정렬기준(좌, 우, 상, 하 조합)을
                    // 반복문으로 돌립니다.
                    TextAnchor a1 = (TextAnchor)i;
                    TextAnchor a2 = (TextAnchor)j;
                    Debug.Log(string.Format("A1:{0}   A2:{1}", a1, a2));

                    if (animated)
                    {
                        // animated가 true 이면 UI 가 이동하면서 좌표를 변경합니다.
                        Tweener t = anchor.MoveToAnchorPosition(a1, a2, Vector2.zero);
                        while (t != null)
                        {
                            yield return(null);
                        }
                    }
                    else
                    {
                        // animated가 false 이면 UI 가 순간이동합니다.
                        anchor.SnapToAnchorPosition(a1, a2, Vector2.zero);
                    }
                    yield return(new WaitForSeconds(delay));
                }
            }
        }
    }
예제 #5
0
    // Positon 클래스로 좌표이동할 때 호출
    public Tweener SetPosition(Position p, bool animated)
    {
        // positionList 의 첫번째 녀석의 Position값 저장
        CurrentPosition = p;

        if (CurrentPosition == null)
        {
            return(null);
        }

        // 이동 중인 UI 가 있으면
        // 멈춘다.
        if (InTransition)
        {
            Transition.easingControl.Stop();
        }


        if (animated)
        {
            // 이동하면서 좌표 변경
            Transition = anchor.MoveToAnchorPosition(p.myAnchor, p.parentAnchor, p.offset);
            return(Transition);
        }
        else
        {
            // 순간적으로 좌표 변경
            anchor.SnapToAnchorPosition(p.myAnchor, p.parentAnchor, p.offset);
            return(null);
        }
    }