Пример #1
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageUIManager manager = stateMachine as FageUIManager;
        Queue         queue   = manager.GetRequests();

        if (queue.Count > 0)
        {
            FageUIRequest request = queue.Peek() as FageUIRequest;
            switch (request.command)
            {
            case FageUIRequest.POP:
                ExcutePop(manager, request);
                break;

            case FageUIRequest.CHANGE:
            case FageUIRequest.PUSH:
                ExcutePush(manager, request);
                break;

            case FageUIRequest.POPUP:
            case FageUIRequest.POPDOWN:
                ExcutePopdown(manager, request);
                break;

            default:
                throw new UnityException("unkown command");
            }
        }
        else
        {
            throw new UnityException("request lost");
        }
    }
Пример #2
0
    private void OnOpenComplete()
    {
        GameObject.Destroy(_curtain.GetGameObject());
        FageUIManager manager = FageUIManager.Instance;

        manager.GetRequests().Dequeue();
        manager.ReserveState("FageUIManagerIdle");
    }
Пример #3
0
 private void ExcutePopdown(FageUIManager manager, FageUIRequest request)
 {
     Queue queue = manager.GetQueue ();
     if (queue.Count > 0) {
         manager.ReserveState ("FageUIManagerTransOut");
     } else {
         manager.GetRequests ().Dequeue ();
     }
 }
Пример #4
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 ();
    }
Пример #5
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageUIManager manager   = stateMachine as FageUIManager;
        FageUIRequest request   = manager.GetRequests().Peek() as FageUIRequest;
        string        levelName = request.levelName;

        _async = FageBundleLoader.Instance.LoadLevel(levelName);
    }
Пример #6
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();
    }
Пример #7
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageUIManager manager = stateMachine as FageUIManager;

        if (current.state == FageUICommonMem.INTANTIATED)
        {
            manager.GetRequests().Dequeue();
            manager.ReserveState("FageUIManagerIdle");
        }
    }
Пример #8
0
 private void ExcutePopup(FageUIManager manager, FageUIRequest request)
 {
     Queue queue = manager.GetQueue ();
     FageUIPopupMem mem = new FageUIPopupMem (request.uiSet);
     queue.Enqueue(mem);
     if (queue.Count == 1) {
         manager.ReserveState("FageUIManagerSwitch");
     } else {
         manager.GetRequests().Dequeue();
     }
 }
Пример #9
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;
     }
 }
Пример #10
0
    private void ExcutePopup(FageUIManager manager, FageUIRequest request)
    {
        Queue queue = manager.GetQueue();

        if (queue.Count == 0)
        {
            manager.GetRequests().Dequeue();
            manager.ReserveState("FageUIManagerIdle");
            return;
        }
        // load bundle
        FageBundleLoader.Instance.ReserveLoad();
    }
Пример #11
0
    private void ExcutePopdown(FageUIManager manager, FageUIRequest request)
    {
        Queue queue = manager.GetQueue();

        if (queue.Count > 0)
        {
            manager.ReserveState("FageUIManagerTransOut");
        }
        else
        {
            manager.GetRequests().Dequeue();
        }
    }
Пример #12
0
 private void ExcutePopdown(FageUIManager manager, FageUIRequest request)
 {
     Queue queue = manager.GetQueue ();
     if (queue.Count > 0) {
         FageUIPopupMem current = queue.Peek () as FageUIPopupMem;
         this.current = current;
         current.Instantiate (manager.canvas, request.param);
     } else {
         manager.GetRequests ().Dequeue ();
         manager.ReserveState ("FageUIManagerIdle");
         return;
     }
 }
Пример #13
0
    private void ExcutePopup(FageUIManager manager, FageUIRequest request)
    {
        Queue          queue = manager.GetQueue();
        FageUIPopupMem mem   = new FageUIPopupMem(request.uiSet);

        queue.Enqueue(mem);
        if (queue.Count == 1)
        {
            manager.ReserveState("FageUIManagerSwitch");
        }
        else
        {
            manager.GetRequests().Dequeue();
        }
    }
Пример #14
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();
    }
Пример #15
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;
        }
    }
Пример #16
0
    private void ExcutePopdown(FageUIManager manager, FageUIRequest request)
    {
        Queue queue = manager.GetQueue();

        if (queue.Count > 0)
        {
            FageUIPopupMem current = queue.Peek() as FageUIPopupMem;
            this.current = current;
            current.Instantiate(manager.canvas, request.param);
        }
        else
        {
            manager.GetRequests().Dequeue();
            manager.ReserveState("FageUIManagerIdle");
            return;
        }
    }
Пример #17
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageUIManager manager = stateMachine as FageUIManager;

        if (_async != null)
        {
            if (_async.isDone)
            {
                manager.ReserveState("FageUIManagerCurtOpen");
            }
        }
        else
        {
            manager.GetRequests().Dequeue();
            manager.ReserveState("FageUIManagerIdle");
        }
    }
Пример #18
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();
    }
Пример #19
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageBundleLoader.Instance.AddEventListener(FageEvent.COMPLETE, OnLoadBundleComplete);

        FageUIManager manager = stateMachine as FageUIManager;
        Queue         queue   = manager.GetRequests();

        if (queue.Count > 0)
        {
            FageUIRequest request = queue.Peek() as FageUIRequest;
            switch (request.command)
            {
            case FageUIRequest.CHANGE:
                ExcuteChange(manager, request);
                break;

            case FageUIRequest.PUSH:
                ExcutePush(manager, request);
                break;

            case FageUIRequest.POP:
                ExcutePop(manager, request);
                break;

            case FageUIRequest.POPUP:
                ExcutePopup(manager, request);
                break;

            case FageUIRequest.POPDOWN:
                ExcutePopdown(manager, request);
                break;

            default:
                throw new UnityException("unkown command");
            }
        }
        else
        {
            throw new UnityException("request lost");
        }
    }
Пример #20
0
    public override void Excute(FageStateMachine stateMachine)
    {
        base.Excute(stateMachine);
        FageUIManager manager = stateMachine as FageUIManager;
        Queue         queue   = manager.GetRequests();

        if (queue.Count > 0)
        {
            FageUIRequest request = queue.Peek() as FageUIRequest;
            switch (request.command)
            {
            case FageUIRequest.CHANGE:
            case FageUIRequest.POP:
            case FageUIRequest.PUSH:
                ExcutePush(manager, request);
                break;

            case FageUIRequest.FLUSH:
                ExcuteFlush(manager, request);
                break;

            case FageUIRequest.POPUP:
                ExcutePopup(manager, request);
                break;

            case FageUIRequest.POPDOWN:
                ExcutePopdown(manager, request);
                break;

            case FageUIRequest.LEVEL:
                ExcuteLevel(manager, request);
                break;

            default:
                throw new UnityException("unknown commnad");
            }
        }
    }
Пример #21
0
    public override void AfterSwitch(FageStateMachine stateMachine, string beforeId)
    {
        base.AfterSwitch(stateMachine, beforeId);
        FageUIManager manager = stateMachine as FageUIManager;
        FageUIRequest request = manager.GetRequests().Peek() as FageUIRequest;

        if ((request.uiCurtain == null) || (request.levelName == null))
        {
            throw new UnityException("parameter (FageUICurtain, levelName) is required");
        }

        GameObject go = GameObject.Instantiate(FageBundleLoader.Instance.Load(request.uiCurtain) as GameObject);

        go.transform.SetParent(manager.canvas, false);
        IFageUICurtainComponent curtain = go.GetComponent <IFageUICurtainComponent> ();

        if (curtain == null)
        {
            throw new UnityException("no interface found : IFageUICurtainComponent");
        }

        curtain.StartClose(OnCloseComplete);
    }
Пример #22
0
 private void ExcutePopup(FageUIManager manager, FageUIRequest request)
 {
     Queue queue = manager.GetQueue ();
     if (queue.Count == 0) {
         manager.GetRequests ().Dequeue ();
         manager.ReserveState ("FageUIManagerIdle");
         return;
     }
     // load bundle
     FageBundleLoader.Instance.ReserveLoad();
 }