예제 #1
0
 void CanvasSetState(UICanvasBase obj, bool active)
 {
     if (active)
     {
         obj.ChengeUIState(UICanvasBase.UISTATE.ACTIVE);
     }
     else
     {
         obj.ChengeUIState(UICanvasBase.UISTATE.CLOSE);
     }
 }
예제 #2
0
 public override void AddCanvas(UICanvasBase target)
 {
     if (_openCanvasHirtory.Count > 0)
     {
         var head = _openCanvasHirtory.Peek();
         head.ChengeUIState(UICanvasBase.UISTATE.SLEEP);
     }
     CanvasSetState(target, true);
     target.GetComponent <Canvas>().sortingOrder = CaluculateNextSortOrder();
     _openCanvasHirtory.Push(target);
 }
예제 #3
0
 //実際に遷移を実行する
 void RunTransition(UICanvasBase chengeUI, bool selfActive)
 {
     if (selfActive)
     {
         _uiCtrl.AddCanvas(chengeUI);
     }
     else
     {
         //_uiCtrl.CloseToNextCanvas(chengeUI);
         _uiCtrl.CloseAndAddCanvas(chengeUI);
     }
 }
예제 #4
0
        public override void AddCanvas(UICanvasBase target)
        {
            if (_openCanvasHirtory.Count > 0)
            {
                var head = _openCanvasHirtory.Peek();
                head.ChengeUIState(UICanvasBase.UISTATE.SLEEP);
            }

            target.gameObject.SetActive(true);
            _openCanvasHirtory.Push(target);
            target.ChengeUIState(UICanvasBase.UISTATE.ACTIVE);
        }
예제 #5
0
        //UIのグループを閉じて別のUIを開く という動きをしたいができない
        public void CloseAndAddCanvas(UICanvasBase nextCanvas)
        {
            var impl = (DefaultCanvasImpl)_uiCvImpl;

            if (impl.ContaintHitory(nextCanvas))
            {
                CloseToNextCanvas(nextCanvas);
            }
            else
            {
                CloseCanvas(impl._historyTop);
                AddCanvas(nextCanvas);
            }
        }
예제 #6
0
 public override void CloseCanvas(UICanvasBase nextCanvas, bool lastOpen)
 {
     if (_openCanvasHirtory.Contains(nextCanvas))
     {
         while (true)
         {
             //nextCanvasより上の階層のものをすべて閉じる
             //lastOpen=falseならnextCanvasも閉じる
             var next = _openCanvasHirtory.Peek();
             if (next != nextCanvas)
             {
                 _openCanvasHirtory.Pop();
                 next.gameObject.SetActive(false);
                 next.ChengeUIState(UICanvasBase.UISTATE.CLOSE);
             }
             else if (next == nextCanvas && !lastOpen)
             {
                 _openCanvasHirtory.Pop();
                 next.gameObject.SetActive(false);
                 next.ChengeUIState(UICanvasBase.UISTATE.CLOSE);
                 break;
             }
             else if (next == nextCanvas && lastOpen)
             {
                 next.ChengeUIState(UICanvasBase.UISTATE.ACTIVE);
                 break;
             }
         }
     }
     else
     {
         //閉じるものがスタックにないときのエラー
         //わかりやすいエラーコードにしたい
         Debug.Log("DefaultCanvasImpl error");
         return;
     }
 }
예제 #7
0
 public override void CloseCanvas(UICanvasBase nextCanvas)
 {
     if (_openCanvasHirtory.Contains(nextCanvas))
     {
         while (true)
         {
             //nextCanvasより上の階層のものをすべて閉じる
             //lastOpen=falseならnextCanvasも閉じる
             var topCanvas = _openCanvasHirtory.Pop();
             CanvasSetState(topCanvas, false);
             if (topCanvas == nextCanvas)
             {
                 break;
             }
         }
     }
     else
     {
         //閉じるものがスタックにないときのエラー
         //わかりやすいエラーコードにしたい
         Debug.Log("DefaultCanvasImpl error");
         return;
     }
 }
예제 #8
0
 void SetSortOrder(UICanvasBase target, int order)
 {
     target.SelfCanvas.sortingOrder = order;
 }
예제 #9
0
 public DefaultCanvasImpl(UICanvasBase firstCanvas) : base(firstCanvas)
 {
 }
예제 #10
0
 //履歴stackに含まれているかどうか
 public bool ContaintHitory(UICanvasBase target)
 {
     return(_openCanvasHirtory.Contains(target));
 }
예제 #11
0
 //履歴にあるキャンバスまで閉じる
 //lastOpen=trueならnextCanvasは閉じない
 public abstract void CloseCanvas(UICanvasBase nextCanvas, bool lastOpen);
예제 #12
0
        //現在のキャンバスを閉じて別のものを開く ができない

        //キャンバスを開く処理
        public abstract void AddCanvas(UICanvasBase target);
예제 #13
0
 //コンストラクタなくてもいいかも
 public UICanvasOpenImplementor(UICanvasBase firstCanvas)
 {
     AddCanvas(firstCanvas);
 }
예제 #14
0
 public void CloseToNextCanvas(UICanvasBase nextCanvas)
 {
     _uiCvImpl.CloseCanvas(nextCanvas, lastOpen: true);
 }
예제 #15
0
 public void CloseCanvas(UICanvasBase target)
 {
     _uiCvImpl.CloseCanvas(target, lastOpen: false);
 }
예제 #16
0
 public void AddCanvas(UICanvasBase target)
 {
     SetSortOrder(target, _uiCvImpl.CaluculateNextSortOrder());
     _uiCvImpl.AddCanvas(target);
 }
 //履歴にあるキャンバスまで閉じる
 //lastOpen=trueならnextCanvasは閉じない
 public abstract void CloseCanvas(UICanvasBase nextCanvas);