Ejemplo n.º 1
0
    public void Update()
    {
        while (!m_bPushingView && (m_ShowQueue.Count > 0) && (m_RootCanvas != null))
        {
            ViewQueueEntry QueueEntry = m_ShowQueue.Dequeue();

            StartCoroutine(PushView(QueueEntry));
        }
    }
Ejemplo n.º 2
0
    private IEnumerator PushView(ViewQueueEntry QueueEntry)
    {
        if (!m_bPushingView && QueueEntry.IsValid())
        {
            m_bPushingView = true;

            if (m_ViewStack.Count > 0)
            {
                yield return(StartCoroutine(m_ViewStack.Peek().GetView <BaseView>().Hide()));
            }

            BaseView NewView = Instantiate <BaseView>(QueueEntry.PrefabType, m_RootCanvas.transform);

            QueueEntry.Tracker.Track(NewView);
            NewView.OnClosed += QueueEntry.Tracker.End;

            m_ViewStack.Push(QueueEntry.Tracker);

            yield return(QueueEntry.Tracker.GetView <BaseView>().Open());

            m_bPushingView = false;
        }
    }