Esempio n. 1
0
 void CanvasSetState(UICanvasBase obj, bool active)
 {
     if (active)
     {
         obj.ChengeUIState(UICanvasBase.UISTATE.ACTIVE);
     }
     else
     {
         obj.ChengeUIState(UICanvasBase.UISTATE.CLOSE);
     }
 }
Esempio n. 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);
 }
Esempio n. 3
0
 //実際に遷移を実行する
 void RunTransition(UICanvasBase chengeUI, bool selfActive)
 {
     if (selfActive)
     {
         _uiCtrl.AddCanvas(chengeUI);
     }
     else
     {
         //_uiCtrl.CloseToNextCanvas(chengeUI);
         _uiCtrl.CloseAndAddCanvas(chengeUI);
     }
 }
Esempio n. 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);
        }
Esempio n. 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);
            }
        }
Esempio n. 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;
     }
 }
Esempio n. 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;
     }
 }
Esempio n. 8
0
 void SetSortOrder(UICanvasBase target, int order)
 {
     target.SelfCanvas.sortingOrder = order;
 }
Esempio n. 9
0
 public DefaultCanvasImpl(UICanvasBase firstCanvas) : base(firstCanvas)
 {
 }
Esempio n. 10
0
 //履歴stackに含まれているかどうか
 public bool ContaintHitory(UICanvasBase target)
 {
     return(_openCanvasHirtory.Contains(target));
 }
Esempio n. 11
0
 //履歴にあるキャンバスまで閉じる
 //lastOpen=trueならnextCanvasは閉じない
 public abstract void CloseCanvas(UICanvasBase nextCanvas, bool lastOpen);
Esempio n. 12
0
        //現在のキャンバスを閉じて別のものを開く ができない

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