예제 #1
0
        protected void processLoading( )
        {
            // Preload, load, unload and post unload as required

            /*		We try to PreLoad
             *      If no preload is required, then try to Load
             *      If no load is required, then try to UnLoad
             *      If no unload is required, then try to PostUnLoad.
             */
            Page e;

            e = pagePreloadQueue.Pop();
            if (e != null)
            {
                e.Preload();
            }
            else
            {
                e = pageLoadQueue.Pop();
                if (e != null)
                {
                    e.Load(ref sceneRoot);
                    if (e.IsLoaded == false)
                    {
                        if (e.IsPreLoaded == false)
                        {
                            // If we are not PreLoaded, then we must preload
                            pagePreloadQueue.Push(e);
                        }
                        // If we are not loaded then queue again, since maybe we are not preloaded.
                        pageLoadQueue.Push(e);
                    }
                }
                else
                {
                    e = pageUnloadQueue.Pop();
                    if (e != null)
                    {
                        e.Unload();
                    }
                    else
                    {
                        e = pagePostunloadQueue.Pop();
                        if (e != null)
                        {
                            e.PostUnload();
                            if (e.IsPreLoaded)
                            {
                                // If we are not post unloaded the queue again
                                pagePostunloadQueue.Push(e);
                            }
                        }
                    }
                }
            }
            // load some renderables
            RenderableManager.Instance.ExecuteRenderableLoading();
        }