예제 #1
0
 void OnClickBnt3(UControl control, PointerEventData data)
 {
     Callback_Bnt3?.Invoke();
     Show(false);
     LastNeedDirtyView?.SetDirtyAll();
     LastNeedDirtyView = null;
 }
예제 #2
0
 void OnOpenView(UView view, bool useGroup)
 {
     //UI互斥,相同UI组只能有一个UI被打开
     if (useGroup && view.Group > 0)
     {
         view.MutexPreviews.Clear();
         for (int i = 0; i < AllMainViews.Count; ++i)
         {
             var otherView = AllMainViews[i];
             if (!otherView.IsDragged &&
                 otherView != view &&
                 otherView.Group != ViewGroup.None &&
                 otherView.Group == view.Group &&
                 otherView.ViewLevel == view.ViewLevel &&
                 otherView.IsExclusive && view.IsExclusive &&
                 otherView.IsShow)
             {
                 view.MutexPreviews.Add(otherView);
                 otherView.Show(false, false);
             }
         }
     }
     if (view.Group == ViewGroup.Main)
     {
         OpenedMainViews.Add(view);
     }
 }
예제 #3
0
 void OnOpenSubView(UView view, bool useGroup)
 {
     //子界面UI互斥,相同UI组只能有一个UI被打开
     if (useGroup &&
         view.Group > 0 &&
         view.ViewLevel == ViewLevel.Sub)
     {
         view.MutexPreviews.Clear();
         foreach (var item in SubViews)
         {
             if (
                 !item.IsDragged &&
                 item != view &&
                 item.Group != ViewGroup.None &&
                 item.Group == view.Group &&
                 item.ViewLevel == view.ViewLevel &&
                 item.IsExclusive && view.IsExclusive &&
                 item.IsShow)
             {
                 view.MutexPreviews.Add(item);
                 item.Show(false, false);
             }
         }
     }
 }
예제 #4
0
 public virtual void Attach(ViewLevel viewLevel, UView beAttchedView)
 {
     UIMgr = beAttchedView?.UIMgr;
     ParentView?.SubViews.Remove(this);
     if (viewLevel == ViewLevel.Root)
     {
         ParentView = beAttchedView;
         RootView   = beAttchedView;
         ViewLevel  = ViewLevel.Main;
         RectTrans.SetParent(RootView?.CanvasTrans);
         UIMgr.AddToMainViews(this);
         UIMgr.AddToGroupViews(this);
     }
     else if (viewLevel == ViewLevel.Main)
     {
         ParentView = beAttchedView;
         RootView   = beAttchedView.RootView;
         ViewLevel  = ViewLevel.Sub;
         RectTrans.SetParent(RootView?.CanvasTrans);
         UIMgr.AddToGroupViews(this);
         //移动到父节点下面
         Trans.SetSiblingIndex(ParentView.Trans.GetSiblingIndex() + ParentView.SubViews.Count + 1);
     }
     else
     {
         CLog.Error("无法挂载到:" + viewLevel);
     }
     ParentView.SubViews.Add(this);
 }
예제 #5
0
 protected override void OnOpen(UView baseView, bool useGroup)
 {
     base.OnOpen(baseView, useGroup);
     openDelayJob?.Kill();
     openDelayJob = Util.Invoke(() => OnOpenDelay(baseView, useGroup), 0.01f);
     //if (LayoutGroup != null)
     //    Util.Invoke(() => LayoutGroup.RebuildLayout(), 0.01f);
 }
예제 #6
0
 public sealed override void Attach(ViewLevel viewLevel, UView beAttchedView)
 {
     base.Attach(viewLevel, beAttchedView);
     if (ParentView != null)
     {
         Trans.SetParent(ParentView.Trans);
     }
     Trans.localPosition = sourceLocalPos;
 }
예제 #7
0
 public void AddToGroupViews(UView tempUI)
 {
     if (GroupViews.ContainsKey(tempUI.Group))
     {
         GroupViews[tempUI.Group].Add(tempUI);
     }
     else
     {
         GroupViews.Add(tempUI.Group, new List <UView> {
             tempUI
         });
     }
 }
예제 #8
0
 void OnCloseSubView(UView view, bool useGroup)
 {
     if (useGroup && view.Group > 0)
     {
         if (view.IsReturn)
         {
             foreach (var item in view.MutexPreviews)
             {
                 item.Show(true, false);
             }
         }
     }
 }
예제 #9
0
 void OnCloseView(UView view, bool useGroup)
 {
     if (useGroup && view.Group > 0)
     {
         if (view.IsReturn)
         {
             foreach (var item in view.MutexPreviews)
             {
                 item.Show(true, false);
             }
         }
     }
     if (view.Group == ViewGroup.Main)
     {
         OpenedMainViews.Remove(view);
     }
 }
예제 #10
0
 protected virtual void OnOpen(UView baseView, bool useGroup)
 {
     if (GO == null)
     {
         return;
     }
     if (IsActiveByShow)
     {
         GO.SetActive(true);
     }
     if (IsRecord)
     {
         BaseUIMgr.AddRecordView(this);
     }
     IsDragged = false;
     Callback_OnOpen?.Invoke(baseView, useGroup);
 }
예제 #11
0
 public void AddToMainViews(UView tempUI)
 {
     MainViews.Add(tempUI);
     AllMainViews.Add(tempUI);
 }
예제 #12
0
 protected virtual void OnOpenDelay(UView baseView, bool useGroup)
 {
 }
예제 #13
0
 // 打开界面,关联一个父界面,当父界面关闭的时候自身也会关闭
 public void Show(UView parentView)
 {
     Attach(ViewLevel.Main, parentView);
     Show(true, false, true);
 }
예제 #14
0
 protected override void OnOpenDelay(UView baseView, bool useGroup)
 {
     base.OnOpenDelay(baseView, useGroup);
     LayoutGroup?.RebuildLayout();
 }
예제 #15
0
 // 将界面挂到其他界面下
 public sealed override void Attach(ViewLevel viewLevel, UView beAttchedView)
 {
     base.Attach(viewLevel, beAttchedView);
     ResetSourcePosData();
 }
예제 #16
0
 public static void AddRecordView(UView view) => LastOpenViews.Add(view);
예제 #17
0
 public static void RemoveRecordView(UView view) => LastOpenViews.Remove(view);
예제 #18
0
 public void SetNeedDirtyView(UView view)
 {
     LastNeedDirtyView = view;
 }