Browse Source

修改通用窗口打开动画
补充ViewManager乱码的注释

leiyasi 1 year ago
parent
commit
696947c288

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Notice/UI_NoticeUI.cs

@@ -17,6 +17,7 @@ namespace UI.Notice
         public GList m_listActivity;
         public GList m_listActivity;
         public GList m_listNotice;
         public GList m_listNotice;
         public GTextField m_txtTips;
         public GTextField m_txtTips;
+        public Transition m_openViewAction;
         public const string URL = "ui://d8t5ezjbkjq3i";
         public const string URL = "ui://d8t5ezjbkjq3i";
         public const string PACKAGE_NAME = "Notice";
         public const string PACKAGE_NAME = "Notice";
         public const string RES_NAME = "NoticeUI";
         public const string RES_NAME = "NoticeUI";
@@ -74,6 +75,7 @@ namespace UI.Notice
             m_listActivity = (GList)comp.GetChild("listActivity");
             m_listActivity = (GList)comp.GetChild("listActivity");
             m_listNotice = (GList)comp.GetChild("listNotice");
             m_listNotice = (GList)comp.GetChild("listNotice");
             m_txtTips = (GTextField)comp.GetChild("txtTips");
             m_txtTips = (GTextField)comp.GetChild("txtTips");
+            m_openViewAction = comp.GetTransition("openViewAction");
         }
         }
         public void Dispose(bool disposeTarget = false)
         public void Dispose(bool disposeTarget = false)
         {
         {
@@ -87,6 +89,7 @@ namespace UI.Notice
             m_listActivity = null;
             m_listActivity = null;
             m_listNotice = null;
             m_listNotice = null;
             m_txtTips = null;
             m_txtTips = null;
+            m_openViewAction = null;
             if(disposeTarget && target != null)
             if(disposeTarget && target != null)
             {
             {
                 target.RemoveFromParent();
                 target.RemoveFromParent();

+ 23 - 4
GameClient/Assets/Game/HotUpdate/Views/ViewAnimationFactory.cs

@@ -9,14 +9,33 @@ namespace GFGGame
 
 
         public static void ZoomInCenter(GComponent gComponent, GTweenCallback callback = null)
         public static void ZoomInCenter(GComponent gComponent, GTweenCallback callback = null)
         {
         {
-            gComponent.SetScale(0.1f, 0.1f);
-            gComponent.SetPivot(0.5f, 0.5f);
-            gComponent.TweenScale(new Vector2(1, 1), 0.2f).OnComplete(callback);
+            Transition transition = (gComponent as Window).contentPane.GetTransition("openViewAction");
+
+            if (transition != null)
+            {
+                transition.Play(() =>
+                {
+                    callback?.Invoke();
+                });
+            }
+            else
+            {
+                gComponent.visible = false;
+                gComponent.SetScale(0.4f, 0.4f);
+                gComponent.SetPivot(0.5f, 0.5f);
+                gComponent.TweenFade(0, 0).OnComplete(() =>
+                {
+                    gComponent.visible = true;
+                    gComponent.TweenFade(1, 0.3f);
+                    gComponent.TweenScale(new Vector2(1, 1), 0.3f).SetEase(EaseType.BackOut).OnComplete(callback);
+                });
+            }
+
         }
         }
 
 
         public static void ZoomOutCenter(GComponent gComponent, GTweenCallback callback)
         public static void ZoomOutCenter(GComponent gComponent, GTweenCallback callback)
         {
         {
-            gComponent.TweenScale(new Vector2(0.1f, 0.1f), 0.2f).OnComplete(callback);
+            callback?.Invoke();
         }
         }
     }
     }
 }
 }

+ 8 - 8
GameClient/Assets/Game/HotUpdate/Views/ViewManager.cs

@@ -8,8 +8,8 @@ using ET;
 namespace GFGGame
 namespace GFGGame
 {
 {
     /// <summary>
     /// <summary>
-    /// ��ͼ������
-    /// ������ͼ����ʾ������
+    /// 视图管理类
+    /// 管理视图的显示、隐藏
     /// </summary>
     /// </summary>
     public class ViewManager
     public class ViewManager
     {
     {
@@ -53,7 +53,7 @@ namespace GFGGame
             UIConfig.bringWindowToFrontOnClick = false;
             UIConfig.bringWindowToFrontOnClick = false;
 
 
             _viewDic = new Dictionary<string, IUIView>();
             _viewDic = new Dictionary<string, IUIView>();
-            //��ʼ����ͼ������
+            //初始化视图层容器
             _bottomLayer = CreateLayer("BottomLayer");
             _bottomLayer = CreateLayer("BottomLayer");
             _topLayer = CreateLayer("TopLayer");
             _topLayer = CreateLayer("TopLayer");
             _topLayer.sortingOrder = ConstSortingOrder.TOP;
             _topLayer.sortingOrder = ConstSortingOrder.TOP;
@@ -106,12 +106,12 @@ namespace GFGGame
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// ��ʾһ����ͼ
+        /// 显示一个视图
         /// </summary>
         /// </summary>
-        /// <param name="name">Ҫ��ʾ����ͼ����</param>
-        /// <param name="viewData">Ҫ���ݸ���ͼ�IJ���</param>
-        /// <param name="goBackParams">�Ӹ���ͼ���ص���ͼ��Ϣ</param>
-        /// <param name="hideOthers">�Ƿ�ر�������ͼ</param>
+        /// <param name="viewName">要显示的视图名称</param>
+        /// <param name="viewData">要传递给视图的参数</param>
+        /// <param name="goBackParams">从该视图返回的视图信息</param>
+        /// <param name="hideOthers">是否关闭其他视图</param>
         public static bool Show(string fullViewName, object viewData = null, object[] goBackParams = null, bool hideOthers = false, bool resetGobackParams = false)
         public static bool Show(string fullViewName, object viewData = null, object[] goBackParams = null, bool hideOthers = false, bool resetGobackParams = false)
         {
         {
             string name = GetName(fullViewName);
             string name = GetName(fullViewName);

BIN
GameClient/Assets/ResIn/UI/Mail/Mail_fui.bytes


BIN
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes


BIN
GameClient/Assets/ResIn/UI/Notice/Notice_fui.bytes