Ver Fonte

公告主界面红点

zhaoyang há 3 anos atrás
pai
commit
fe548a7a81

+ 6 - 0
FGUIProject/assets/CommonGame/components/ComRedDot.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="32,32" opaque="false">
+  <displayList>
+    <image id="n5_hspq" name="imgRed" src="oq7r9k" fileName="imagesExport/zx_hogndian.png" xy="0,0"/>
+  </displayList>
+</component>

+ 1 - 0
FGUIProject/assets/CommonGame/package.xml

@@ -193,6 +193,7 @@
     <image id="kztethq" name="test.png" path="/imagesExport/" exported="true"/>
     <image id="kztethr" name="hyhy_btbt_1.png" path="/imagesExport/" exported="true"/>
     <image id="kzteths" name="gxhd_scjlscjl.png" path="/images/"/>
+    <component id="hspqf4" name="ComRedDot.xml" path="/components/" exported="true"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\CommonGame" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 1 - 1
FGUIProject/assets/Main/components/ButtonModle.xml

@@ -3,7 +3,7 @@
   <controller name="button" pages="0,up,1,down" selected="0"/>
   <displayList>
     <image id="n3_wg7t" name="n3" src="wg7t8x" fileName="images/zjm_gn_dik_2.png" xy="0,0"/>
-    <loader id="n4_wg7t" name="icon" xy="48,48" pivot="0.5,0.5" anchor="true" size="60,60" url="ui://mfvz4q8kq08x9" autoSize="true"/>
+    <loader id="n4_wg7t" name="icon" xy="48,48" pivot="0.5,0.5" anchor="true" size="96,97" url="ui://mfvz4q8kq08x9" autoSize="true"/>
   </displayList>
   <Button/>
   <customProperty target="loaIcon" propertyId="1"/>

+ 27 - 0
GameClient/Assets/Game/HotUpdate/Controller/RedDotController.cs

@@ -0,0 +1,27 @@
+
+using FairyGUI;
+
+namespace GFGGame
+{
+    public class RedDotController : SingletonBase<RedDotController>
+    {
+        public void SetComRedDot(GComponent parentCom, bool isRed)
+        {
+            GComponent comRedDot;
+            if (parentCom.GetChild("comResDot") == null)
+            {
+                comRedDot = UIPackage.CreateObject("CommonGame", "ComRedDot").asCom;
+                parentCom.AddChild(comRedDot);
+                comRedDot.name = "comResDot";
+                comRedDot.SetPosition(parentCom.width - comRedDot.width, 0, 0);
+                comRedDot.AddRelation(comRedDot, RelationType.TopExt_Top);
+                comRedDot.AddRelation(comRedDot, RelationType.RightExt_Right);
+            }
+            else
+            {
+                comRedDot = parentCom.GetChild("comResDot").asCom;
+            }
+            comRedDot.visible = isRed;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Controller/RedDotController.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: af67434d4d1376449b6fc318a59791ff
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 18 - 0
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -0,0 +1,18 @@
+using System.Collections.Generic;
+
+namespace GFGGame
+{
+    public class RedDotDataManager : SingletonBase<RedDotDataManager>
+    {
+        public bool GetNoticeRed()
+        {
+            List<NoticeInfo> noticeInfos = NoticeDataManager.Instance.NoticeInfos;
+            for (int i = 0; i < noticeInfos.Count; i++)
+            {
+                if (noticeInfos[i].readStatus == false) return true;
+            }
+            return false;
+        }
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 27ab67e2e64189e4fb0579a7f3dbdaf1
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ComRedDot.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.CommonGame
+{
+    public partial class UI_ComRedDot
+    {
+        public GComponent target;
+        public GImage m_imgRed;
+        public const string URL = "ui://eg2y0ldphspqf4";
+        public const string PACKAGE_NAME = "CommonGame";
+        public const string RES_NAME = "ComRedDot";
+        private static UI_ComRedDot _proxy;
+
+        public static UI_ComRedDot Create(GObject gObject = null)
+        {
+            var ui = new UI_ComRedDot();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ComRedDot Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComRedDot();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_imgRed = (GImage)comp.GetChild("imgRed");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_imgRed = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ComRedDot.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 339447b410eb8e3479edcf267c29aaca
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 12 - 0
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -140,6 +140,7 @@ namespace GFGGame
             }
             _valueBarController.OnHide();
             Timers.inst.Remove(Update);
+
         }
 
         private void AddEffect()
@@ -311,6 +312,11 @@ namespace GFGGame
 
         private void Update(object param)
         {
+            UpdateRedDot();
+            ShowExitAlert();
+        }
+        private void ShowExitAlert()
+        {
             if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Home))
             {
                 Alert.Show("我会想你的")
@@ -334,6 +340,12 @@ namespace GFGGame
         }
 
 
+        private void UpdateRedDot()
+        {
+            RedDotController.Instance.SetComRedDot(_btnGongGao, RedDotDataManager.Instance.GetNoticeRed());
+        }
+
+
         protected override void UpdateToCheckGuide(object param)
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;

BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes


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