瀏覽代碼

Merge remote-tracking branch 'remotes/origin/zhaoyang' into guodong

# Conflicts:
#	GameClient/Assets/Game/CSShare
guodong 3 年之前
父節點
當前提交
78efa09338

+ 1 - 1
FGUIProject/assets/LuckyBox/components/ComListBgItem.xml

@@ -10,7 +10,7 @@
     <graph id="n31_qi04" name="holder1" xy="697,779" size="100,100">
       <relation target="" sidePair="top-middle"/>
     </graph>
-    <text id="n28_vek8" name="txtTime" xy="324,409" size="80,902" fontSize="40" color="#fffbdd" align="center" vAlign="middle" autoSize="none" text="剩余81天">
+    <text id="n28_vek8" name="txtTime" xy="324,409" size="70,902" fontSize="40" color="#fffbdd" align="center" vAlign="middle" ubb="true" autoSize="none" text="剩余811小时">
       <relation target="" sidePair="height-height,top-top"/>
     </text>
     <graph id="n30_qi04" name="holder" xy="312,700" size="100,100">

+ 6 - 6
GameClient/Assets/Editor/Excel/Scanner/InstanceZonesScanner.cs

@@ -22,8 +22,8 @@ namespace GFGEditor
                     levelCountDIc.TryGetValue(key, out var count);
                     count++;
                     levelCountDIc[key] = count;
-                    var names = new string[] { "_" + nameof(cfg.order) };
-                    var values = new string[] { "" + count };
+                    var names = new string[] { "_" + nameof(cfg.order), "_" + nameof(cfg.subType) };
+                    var values = new string[] { "" + count, "" + cfg.subType };
                     SQLiteHelper.Instance.UpdateValues(nameof(StoryLevelCfgArray), names, values, "_" + nameof(cfg.id), "=", cfg.id.ToString());
                 }
             }
@@ -35,7 +35,7 @@ namespace GFGEditor
             {
                 SQLiteHelper.Instance.CloseConnection();
             }
-            
+
             //写入
             WriteStoryChapter();
             WriteStudioChapter();
@@ -50,7 +50,7 @@ namespace GFGEditor
             {
                 foreach (var cfg in dataArray)
                 {
-                    var key = CalculateHelper.GenerateInstanceZonesLevelStateKey(cfg.type,cfg.subType, cfg.id);
+                    var key = CalculateHelper.GenerateInstanceZonesLevelStateKey(cfg.type, cfg.subType, cfg.id);
                     levelCountDIc.TryGetValue(key, out var count);
                     var names = new string[] { "_" + nameof(cfg.levelCount) };
                     var values = new string[] { "" + count };
@@ -65,7 +65,7 @@ namespace GFGEditor
             {
                 SQLiteHelper.Instance.CloseConnection();
             }
-            
+
         }
 
         public static void WriteStudioChapter()
@@ -92,7 +92,7 @@ namespace GFGEditor
             {
                 SQLiteHelper.Instance.CloseConnection();
             }
-            
+
         }
     }
 }

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 38ee4a10d5bfb81cfdd684a61e8bf59559332032
+Subproject commit e6a0bb2f509320e97099fd6b8a7dc7825bc28572

+ 2 - 24
GameClient/Assets/Game/HotUpdate/Data/StudioDataManager.cs

@@ -4,30 +4,8 @@ namespace GFGGame
 {
     public class StudioDataManager : SingletonBase<StudioDataManager>
     {
-        private Dictionary<string, List<StudioCfg>> _studioCfgByViewName;
 
-        public List<StudioCfg> GetStudioCfgListByViewName(string name)
-        {
-            if (_studioCfgByViewName == null)
-            {
-                _studioCfgByViewName = new Dictionary<string, List<StudioCfg>>();
-                StudioCfg[] cfgs = StudioCfgArray.Instance.dataArray;
-                for (int i = 0; i < cfgs.Length; i++)
-                {
-                    string viewName = cfgs[i].funId;
-                    if (!_studioCfgByViewName.ContainsKey(viewName))
-                    {
-                        _studioCfgByViewName[viewName] = new List<StudioCfg>();
-                    }
-                    _studioCfgByViewName[viewName].Add(cfgs[i]);
-                }
-            }
-            if (!_studioCfgByViewName.ContainsKey(name))
-            {
-                PromptController.Instance.ShowFloatTextPrompt(name + "配置不存在");
-                return null;
-            }
-            return _studioCfgByViewName[name];
-        }
+
+
     }
 }

+ 0 - 89
GameClient/Assets/Game/HotUpdate/Utils/DateUtils.cs

@@ -1,89 +0,0 @@
-using System;
-using System.Collections;
-using UnityEngine;
-
-namespace GFGGame
-{
-    public class DateUtils : SingletonBase<DateUtils>
-    {
-
-        public const int TIME_FORMAT_1 = 1;
-
-        public int MONTH_PER_YEAR = 12;//每年的月数
-        public int DAYS_PER_MONTH = 30;//每月的天数
-        public int HOURS_PER_DAY = 24;//每天的小时数
-        public int MUNITE_PER_HOUR = 60;//每小时的分钟数
-        public int SECOND_PER_MUNITE = 60;//每分钟的秒数
-        public int SECOND_PER_DAY = 86400;//一天的秒数
-        public int GetCurTime()
-        {
-            var utcNow = DateTime.UtcNow;
-            var timeSpan = utcNow - new DateTime(1970, 1, 1, 0, 0, 0);
-
-            return (int)timeSpan.TotalSeconds;
-        }
-        //direction排版方向:0横向,1纵向
-        public string getFormatBySecond(int second, int type = 1, int direction = 0)
-        {
-            string str = "";
-            int ms = second * 1000;
-            switch (type)
-            {
-                case DateUtils.TIME_FORMAT_1:
-                    str = this.format_1(second, direction);
-                    break;
-            }
-            return str;
-        }
-        //剩余时间大于1天返回天数,小于一天返回小时数,小于一小时返回分钟数,小于1分钟返回秒数
-        public string format_1(int second, int direction = 0)
-        {
-            if (second / this.SECOND_PER_DAY >= 1)
-            {
-                if (direction == 0)
-                {
-                    return string.Format("剩余{0}天", Mathf.Floor(second / this.SECOND_PER_DAY));
-                }
-                else
-                {
-                    return string.Format("剩\n余\n{0}\n天", Mathf.Floor(second / this.SECOND_PER_DAY));
-                }
-            }
-            else if (second / this.SECOND_PER_DAY < 1 && second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE) >= 1)
-            {
-                if (direction == 0)
-                {
-                    return string.Format("剩余{0}小时", Mathf.Floor(second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE)));
-
-                }
-                else
-                {
-                    return string.Format("剩\n余\n{0}\n小\n时", Mathf.Floor(second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE)));
-                }
-            }
-            else if (second / this.SECOND_PER_DAY < 1 && second / (this.MUNITE_PER_HOUR * this.SECOND_PER_MUNITE) < 1 && second / this.SECOND_PER_MUNITE >= 1)
-            {
-                if (direction == 0)
-                {
-                    return string.Format("剩余{0}分钟", Mathf.Floor(second / this.SECOND_PER_MUNITE));
-                }
-                else
-                {
-                    return string.Format("剩\n余\n{0}\n分\n钟", Mathf.Floor(second / this.SECOND_PER_MUNITE));
-                }
-            }
-            else if (second < this.SECOND_PER_MUNITE)
-            {
-                if (direction == 0)
-                {
-                    return string.Format("剩余{0}秒", second);
-                }
-                else
-                {
-                    return string.Format("剩\n余\n{0}\n秒", second);
-                }
-            }
-            return "";
-        }
-    }
-}

+ 26 - 0
GameClient/Assets/Game/HotUpdate/Utils/TimeUtil.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public partial class TimeUtil : SingletonBase<TimeUtil>
+    {
+        public static string FormattingTime(int curTime, int endTime)
+        {
+            int time = endTime - curTime;
+
+            int hours = (int)Math.Floor((decimal)time / TimeUtil.SECOND_PER_HOUR);
+            if (hours >= 1)
+            {
+                return string.Format("{0}小时", hours);
+            }
+            int minutes = (int)Math.Floor((decimal)time / TimeUtil.SECOND_PER_MUNITE);
+            if (minutes >= 1)
+            {
+                return string.Format("{0}分钟", minutes);
+            }
+            return string.Format("{0}秒", minutes);
+        }
+    }
+}

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Utils/DateUtils.cs.meta → GameClient/Assets/Game/HotUpdate/Utils/TimeUtil.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 5f0b81650b4637446abe2dd505a43826
+guid: 4771a2705424e2d4d9c856fc6686eaad
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographSaveView.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using System.IO;
+using ET;
 using FairyGUI;
 using UI.DressUp;
 using UnityEngine;
@@ -62,7 +63,7 @@ namespace GFGGame
 
                 }
             }
-            string fileName = "wsj" + DateUtils.Instance.GetCurTime() + ".jpg";
+            string fileName = "wsj" + TimeHelper.ServerNowSecs + ".jpg";
 
             Texture2D tex = this.viewData as Texture2D;
             byte[] bytes = tex.EncodeToJPG();//将纹理数据,转化成一个jpg图片

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -4,6 +4,7 @@ using UI.CommonGame;
 using System;
 using System.Collections.Generic;
 using UnityEngine;
+using ET;
 
 namespace GFGGame
 {
@@ -109,8 +110,8 @@ namespace GFGGame
                 return;
             }
             int endTime = LuckyBoxDataManager.Instance.endTime;
-            int curTime = DateUtils.Instance.GetCurTime();
-            UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(0)).m_txtTime.text = DateUtils.Instance.getFormatBySecond(endTime - curTime, 1, 1);
+            int curTime = TimeHelper.ServerNowSecs;
+            UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(0)).m_txtTime.text = string.Format("剩余\n{0}", TimeUtil.FormattingTime(curTime, endTime));
         }
         private void OnListBgScroll()
         {

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioFabricView.cs

@@ -23,11 +23,12 @@ namespace GFGGame
 
         protected override void OnShown()
         {
-            base.OnShown();
             _ui.m_c1.selectedIndex = 0;
-            this.studioCfg = StudioDataManager.Instance.GetStudioCfgListByViewName(typeof(StudioFabricView).FullName)[0];
+            this.studioCfg = StudioCfgArray.Instance.GetCfgs(typeof(StudioFabricView).Name)[0];
             this.storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgs(this.studioCfg.type, this.studioCfg.subType, this.studioCfg.id);
             _ui.m_list.numItems = this.storyLevelCfgs.Length;
+            base.OnShown();
+
         }
 
         protected override void OnHide()

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioMetalView.cs

@@ -23,12 +23,13 @@ namespace GFGGame
 
         protected override void OnShown()
         {
-            base.OnShown();
+
             _ui.m_c1.selectedIndex = 0;
-            this.studioCfg = StudioDataManager.Instance.GetStudioCfgListByViewName(typeof(StudioMetalView).FullName)[0];
+
+            this.studioCfg = StudioCfgArray.Instance.GetCfgs(typeof(StudioMetalView).Name)[0];
             this.storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgs(this.studioCfg.type, this.studioCfg.subType, this.studioCfg.id);
             _ui.m_list.numItems = this.storyLevelCfgs.Length;
-
+            base.OnShown();
         }
 
         protected override void OnHide()

+ 6 - 5
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioPropertyView.cs

@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using FairyGUI;
 using UI.Studio;
+using UnityEngine;
 
 namespace GFGGame
 {
@@ -23,11 +24,12 @@ namespace GFGGame
 
         protected override void OnShown()
         {
-            base.OnShown();
             _ui.m_c1.selectedIndex = 1;
+            _ui.m_listProperty.numItems = StudioCfgArray.Instance.GetCfgs(typeof(StudioPropertyView).Name).Length;
+            _ui.m_listProperty.selectedIndex = 0;
+            this.studioCfg = StudioCfgArray.Instance.GetCfgs(typeof(StudioPropertyView).Name)[0];
+            base.OnShown();
 
-
-            _ui.m_listProperty.numItems = StudioDataManager.Instance.GetStudioCfgListByViewName(typeof(StudioPropertyView).FullName).Count;
         }
 
         protected override void OnHide()
@@ -44,13 +46,12 @@ namespace GFGGame
         {
             GButton item = obj.asButton;
 
-            item.data = StudioDataManager.Instance.GetStudioCfgListByViewName(typeof(StudioPropertyView).FullName)[index];
+            item.data = StudioCfgArray.Instance.GetCfgs(typeof(StudioPropertyView).Name)[index];
         }
         private void OnClickListProperty(EventContext context)
         {
             GButton item = (context.data as GObject).asButton;
 
-            // UI_ListPropertyItem item = UI_ListPropertyItem.Proxy(context.data as GObject);
             this.studioCfg = item.data as StudioCfg;
             this.storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgs(this.studioCfg.type, this.studioCfg.subType, this.studioCfg.id);
             _ui.m_list.numItems = this.storyLevelCfgs.Length;

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioView.cs

@@ -35,12 +35,12 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            int isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioMetalView).FullName) ? 1 : 0;
+            int isopen = 1;// FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioMetalView).FullName) ? 1 : 0;
             _ui.m_comMetal.m_c1.selectedIndex = isopen;
-            isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFabricView).FullName) ? 1 : 0; ;
-            _ui.m_comFabric.m_c1.selectedIndex = isopen;
-            isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPropertyView).FullName) ? 1 : 0;
+            //isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioFabricView).FullName) ? 1 : 0; ;
             _ui.m_comFabric.m_c1.selectedIndex = isopen;
+            // isopen = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StudioPropertyView).FullName) ? 1 : 0;
+            _ui.m_comProperty.m_c1.selectedIndex = isopen;
         }
 
         protected override void OnHide()

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

@@ -51,10 +51,10 @@ namespace GFGGame
         /// <param name="hideOthers">�Ƿ�ر�������ͼ</param>
         public static void Show(string viewName, object viewData = null, object[] goBackParams = null, bool hideOthers = false, bool resetGobackParams = false)
         {
-            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(viewName))
-            {
-                return;
-            }
+            // if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(viewName.Split('.')[1]))
+            // {
+            //     return;
+            // }
             if (hideOthers)
             {
                 HideAllView(viewName);
@@ -116,10 +116,10 @@ namespace GFGGame
         public static bool Show<T>(object viewData = null, object[] goBackParams = null, bool hideOthers = false, bool resetGobackParams = false) where T : class, new()
         {
             string viewName = typeof(T).FullName;
-            if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(viewName))
-            {
-                return false;
-            }
+            // if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(viewName))
+            // {
+            //     return false;
+            // }
             if (hideOthers)
             {
                 HideAllView(viewName);

二進制
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes


二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0!a.png


二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0.png


二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_fui.bytes