コード例 #1
0
ファイル: FageUIManagerIdle.cs プロジェクト: buzzler/titan
    private void ExcuteFlush(FageUIManager manager, FageUIRequest request)
    {
        Stack stack = manager.GetStack ();
        FageUIMem current = stack.Peek () as FageUIMem;
        stack.Clear ();
        stack.Push (current);

        manager.GetRequests ().Dequeue ();
    }
コード例 #2
0
    private void ExcuteFlush(FageUIManager manager, FageUIRequest request)
    {
        Stack     stack   = manager.GetStack();
        FageUIMem current = stack.Peek() as FageUIMem;

        stack.Clear();
        stack.Push(current);

        manager.GetRequests().Dequeue();
    }
コード例 #3
0
    private void ExcutePush(FageUIManager manager, FageUIRequest request)
    {
        Stack stack = manager.GetStack();

        FageUIMem current = new FageUIMem(request.uiSet);

        stack.Push(current);
        // load bundle
        FageBundleLoader.Instance.ReserveLoad();
    }
コード例 #4
0
 private void ExcutePush(FageUIManager manager, FageUIRequest request)
 {
     Stack stack = manager.GetStack ();
     if (stack.Count > 0) {
         FageUIMem current = stack.Peek () as FageUIMem;
         current.Destroy ();
         this.current = current;
     } else {
         manager.ReserveState("FageUIManagerSwitch");
     }
 }
コード例 #5
0
ファイル: FageUIManagerSwitch.cs プロジェクト: buzzler/titan
    private void ExcuteChange(FageUIManager manager, FageUIRequest request)
    {
        Stack stack = manager.GetStack ();
        if (stack.Count > 0) {
            stack.Pop();
        }

        FageUIMem current = new FageUIMem (request.uiSet);
        stack.Push (current);
        // load bundle
        FageBundleLoader.Instance.ReserveLoad();
    }
コード例 #6
0
    private void ExcutePush(FageUIManager manager, FageUIRequest request)
    {
        Stack stack = manager.GetStack();

        if (stack.Count > 0)
        {
            manager.ReserveState("FageUIManagerTransOut");
        }
        else
        {
            manager.ReserveState("FageUIManagerSwitch");
        }
    }
コード例 #7
0
ファイル: FageUIManagerTransIn.cs プロジェクト: buzzler/titan
 private void ExcutePop(FageUIManager manager, FageUIRequest request)
 {
     Stack stack = manager.GetStack ();
     if (stack.Count > 0) {
         FageUIMem current = stack.Peek () as FageUIMem;
         this.current = current;
         current.Resume(manager.canvas, request.param);
     } else {
         manager.GetRequests ().Dequeue ();
         manager.ReserveState ("FageUIManagerIdle");
         return;
     }
 }
コード例 #8
0
    private void ExcutePush(FageUIManager manager, FageUIRequest request)
    {
        Stack stack = manager.GetStack();

        if (stack.Count > 0)
        {
            FageUIMem current = stack.Peek() as FageUIMem;
            current.Destroy();
            this.current = current;
        }
        else
        {
            manager.ReserveState("FageUIManagerSwitch");
        }
    }
コード例 #9
0
ファイル: FageUIManagerSwitch.cs プロジェクト: buzzler/titan
    private void ExcutePop(FageUIManager manager, FageUIRequest request)
    {
        Stack stack = manager.GetStack ();
        if (stack.Count > 0) {
            stack.Pop ();
        }

        if (stack.Count == 0) {
            manager.GetRequests ().Dequeue ();
            manager.ReserveState ("FageUIManagerIdle");
            return;
        }

        // load bundle
        FageBundleLoader.Instance.ReserveLoad();
    }
コード例 #10
0
    private void ExcutePop(FageUIManager manager, FageUIRequest request)
    {
        Stack stack = manager.GetStack();

        if (stack.Count > 0)
        {
            FageUIMem current = stack.Peek() as FageUIMem;
            this.current = current;
            current.Resume(manager.canvas, request.param);
        }
        else
        {
            manager.GetRequests().Dequeue();
            manager.ReserveState("FageUIManagerIdle");
            return;
        }
    }
コード例 #11
0
    private void ExcutePop(FageUIManager manager, FageUIRequest request)
    {
        Stack stack = manager.GetStack();

        if (stack.Count > 0)
        {
            stack.Pop();
        }

        if (stack.Count == 0)
        {
            manager.GetRequests().Dequeue();
            manager.ReserveState("FageUIManagerIdle");
            return;
        }

        // load bundle
        FageBundleLoader.Instance.ReserveLoad();
    }
コード例 #12
0
ファイル: FageUIManagerIdle.cs プロジェクト: buzzler/titan
 private void ExcutePush(FageUIManager manager, FageUIRequest request)
 {
     Stack stack = manager.GetStack ();
     if (stack.Count > 0) {
         manager.ReserveState("FageUIManagerTransOut");
     } else {
         manager.ReserveState("FageUIManagerSwitch");
     }
 }
コード例 #13
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        List <string> resources     = new List <string>();
        List <string> loadBundles   = new List <string>();
        List <string> unloadBundles = new List <string>();

        FageBundleLoader loader = stateMachine as FageBundleLoader;
        Dictionary <string, AssetBundle> downloadedBundles = loader.GetDownloadedBundles();
        Dictionary <string, object>      loadedAsset       = loader.GetLoadedAssets();
        List <string> loadedBundles = loader.GetLoadedBundles();

        FageUIManager manager = FageUIManager.Instance;
        Stack         stack   = manager.GetStack();
        Queue         queue   = manager.GetQueue();

        if (stack.Count > 0)
        {
            FageUIMem mem = stack.Peek() as FageUIMem;
            foreach (string s in mem.uiSet.GetBundles())
            {
                if (!resources.Contains(s))
                {
                    resources.Add(s);
                }
            }
        }
        if (queue.Count > 0)
        {
            FageUIPopupMem mem = queue.Peek() as FageUIPopupMem;
            foreach (string s in mem.uiSet.GetBundles())
            {
                if (!resources.Contains(s))
                {
                    resources.Add(s);
                }
            }
        }
        foreach (FageBundle bundle in FageBundleRoot.Instance.bundles)
        {
            if ((!bundle.isDynamic) && (!loadBundles.Contains(bundle.id)))
            {
                loadBundles.Add(bundle.id);
            }
            else if ((resources.Contains(bundle.id)) && (!loadBundles.Contains(bundle.id)))
            {
                loadBundles.Add(bundle.id);
            }
        }

        foreach (string id in loadedBundles)
        {
            if (loadBundles.Contains(id))
            {
                loadBundles.Remove(id);
            }
            else if (!unloadBundles.Contains(id))
            {
                unloadBundles.Add(id);
            }
        }

        queueBundle = new Queue();
        foreach (string s in loadBundles)
        {
            AssetBundle ab = downloadedBundles[s];
            ab.name = s;
            queueBundle.Enqueue(ab);
        }

        foreach (string s in unloadBundles)
        {
            AssetBundle ab = downloadedBundles[s];
            foreach (string abname in ab.GetAllAssetNames())
            {
                loadedAsset.Remove(abname);
            }
            loadedBundles.Remove(s);
        }
        if (queueBundle.Count > 0)
        {
            AssetBundle ab = queueBundle.Peek() as AssetBundle;
            queueAsset = new Queue(ab.GetAllAssetNames());
        }

        stateMachine.DispatchEvent(new FageBundleEvent(FageBundleEvent.LOADING));
    }