guodong hace 3 años
padre
commit
1c6dbb2913
Se han modificado 40 ficheros con 178 adiciones y 546 borrados
  1. 1 1
      GameClient/Assets/Editor/Excel/ExcelChecker.cs
  2. 1 1
      GameClient/Assets/Game/CSShare
  3. 0 16
      GameClient/Assets/Game/HotUpdate/Constant/ConstItemID.cs
  4. 0 11
      GameClient/Assets/Game/HotUpdate/Constant/ConstItemID.cs.meta
  5. 0 25
      GameClient/Assets/Game/HotUpdate/Constant/ConstItemType.cs
  6. 0 11
      GameClient/Assets/Game/HotUpdate/Constant/ConstItemType.cs.meta
  7. 1 6
      GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs
  8. 24 17
      GameClient/Assets/Game/HotUpdate/Controller/GMController.cs
  9. 1 3
      GameClient/Assets/Game/HotUpdate/Controller/GameController.cs
  10. 5 5
      GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs
  11. 2 1
      GameClient/Assets/Game/HotUpdate/Data/FunctionOpenDataManager.cs
  12. 6 3
      GameClient/Assets/Game/HotUpdate/Data/Handler/RoleDataHandler.cs
  13. 15 97
      GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs
  14. 28 138
      GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs
  15. 3 2
      GameClient/Assets/Game/HotUpdate/Data/ScoreSystemData.cs
  16. 10 21
      GameClient/Assets/Game/HotUpdate/Data/StoryDataManager.cs
  17. 6 5
      GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs
  18. 1 1
      GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs
  19. 1 6
      GameClient/Assets/Game/HotUpdate/ETView/Numeric/Event/NumericWatcher_RefreshMainUI.cs
  20. 0 39
      GameClient/Assets/Game/HotUpdate/GameConst.cs
  21. 0 11
      GameClient/Assets/Game/HotUpdate/GameConst.cs.meta
  22. 5 3
      GameClient/Assets/Game/HotUpdate/GameGlobal.cs
  23. 11 11
      GameClient/Assets/Game/HotUpdate/Net/Proxy/GameProxy.cs
  24. 12 45
      GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs
  25. 1 1
      GameClient/Assets/Game/HotUpdate/Utils/SuitUtil.cs
  26. 1 1
      GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs
  27. 2 2
      GameClient/Assets/Game/HotUpdate/Views/ClothingShop/ClothingShopView.cs
  28. 1 1
      GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs
  29. 1 1
      GameClient/Assets/Game/HotUpdate/Views/Common/Controller/GoodsItemTipsController.cs
  30. 9 36
      GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs
  31. 1 1
      GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyCountView.cs
  32. 2 2
      GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs
  33. 2 2
      GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs
  34. 2 1
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs
  35. 2 2
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightQuicklyView.cs
  36. 2 2
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryLevelInfoView.cs
  37. 9 6
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs
  38. 4 5
      GameClient/Assets/Game/HotUpdate/Views/MainUI/GMPanelView.cs
  39. 2 1
      GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs
  40. 4 3
      GameClient/Assets/Game/HotUpdate/Views/MainUI/RoleInfoView.cs

+ 1 - 1
GameClient/Assets/Editor/Excel/ExcelChecker.cs

@@ -213,7 +213,7 @@ namespace GFGEditor
             ItemCfg[] dataArray = cfgArray.dataArray;
             foreach(ItemCfg cfg in dataArray)
             {
-                if (cfg.resLayer1 == 0 && cfg.resLayer2 == 0 && ItemUtil.IsDressUpItem(cfg.id))
+                if (cfg.resLayer1 == 0 && cfg.resLayer2 == 0 && ItemUtilCS.IsDressUpItem(cfg.id))
                 {
                     throw (new Exception("物品" + cfg.id + "没有配置显示层"));
                 }

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 3731dcb4a522420dc9225021ab78f16b0b82962b
+Subproject commit 11e7472b286f3f9eaacaf2d28679924978ca07b4

+ 0 - 16
GameClient/Assets/Game/HotUpdate/Constant/ConstItemID.cs

@@ -1,16 +0,0 @@
-namespace GFGGame
-{
-    public class ConstItemID
-    {
-        public const int EXP = 1000001;
-        public const int POWER = 1000002;
-        public const int GOLD = 1000003;
-        public const int DIAMOND_PURPLE = 1000004;
-        public const int DIAMOND_RED = 1000005;
-
-        public const int DEFULT_FA_XING = 10000;
-        public const int DEFULT_LIAN_YI_QUN = 20000;
-        public const int DEFULT_NEI_DA = 30000;
-        public const int DEFULT_XIA_ZHUANG = 50000;
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/Constant/ConstItemID.cs.meta

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

+ 0 - 25
GameClient/Assets/Game/HotUpdate/Constant/ConstItemType.cs

@@ -1,25 +0,0 @@
-using System.Collections;
-using UnityEngine;
-
-namespace GFGGame
-{
-    public class ConstItemType
-    {
-        /// <summary>
-        /// 换装部件
-        /// </summary>
-        public const int DRESS_UP = 99;
-        /// <summary>
-        /// 货币
-        /// </summary>
-        public const int CURRENCY = 100;
-        /// <summary>
-        /// 卡牌
-        /// </summary>
-        public const int CARD = 200;
-        /// <summary>
-        /// 道具
-        /// </summary>
-        public const int ITEM = 300;
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/Constant/ConstItemType.cs.meta

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

+ 1 - 6
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -3,15 +3,9 @@ namespace GFGGame
     public class ConstMessage
     {
         public const string DRESS_UP_SCORE_CHANGED = "DRESS_UP_SCORE_CHANGED";
-        public const string ROLE_EXP_CHANGED = "ROLE_EXP_CHANGED";
-        public const string ROLE_POWER_CHANGED = "ROLE_POWER_CHANGED";
         public const string ROLE_GOLD_CHANGED = "ROLE_GOLD_CHANGED";
-        public const string ROLE_DIAMOND_PURPLE_CHANGED = "ROLE_DIAMOND_PURPLE_CHANGED";
-        public const string ROLE_DIAMOND_RED_CHANGED = "ROLE_DIAMOND_PURPLE_CHANGED";
-        public const string ROLE_LEVEL_CHANGED = "ROLE_LEVEL_CHANGED";
         public const string ITEM_CHANGED = "ITEM_CHANGED";
         public const string SUIT_BOX_STATUS_CHANGED = "SUIT_BOX_STATUS_CHANGED";
-        public const string MONEY_CHANGE = "MONEY_CHANGE";
         public const string CJ_FINISH = "CJ_FINISH";
         public const string MAIL_CHANGE = "MAIL_CHANGE";
         public const string DRESS_FILTER = "DRESS_FILTER";
@@ -24,6 +18,7 @@ namespace GFGGame
         public const string CLOSE_PHOTOGRAPHVIEW = "CLOSE_PHOTOGRAPHVIEW";
 
         public const string CARD_UP_SKILL = "CARD_UP_SKILL";
+        public const string NUMERIC_CHANGE = "NUMERIC_CHANGE";
 
 
 

+ 24 - 17
GameClient/Assets/Game/HotUpdate/Controller/GMController.cs

@@ -1,40 +1,47 @@
 using System;
+using ET;
 
 namespace GFGGame
 {
     public class GMController
     {
-        public static void GetAllDressUpItem()
+        public static async ETTask GetAllDressUpItem()
         {
             GetSuitItemController.enable = false;
             //获得所有换装部件
-            ItemCfg[] dataArray = ItemCfgArray.Instance.dataArray;
-            for(int i = 0; i < dataArray.Length; i++)
+            var errorCode = await GMHelper.SendGMToServer("get all dressup");
+            GetSuitItemController.enable = true;
+            if (errorCode != ET.ErrorCode.ERR_Success)
             {
-                ItemCfg itemCfg = dataArray[i];
-                if(ItemUtil.IsDressUpItem(itemCfg.id))
-                {
-                    ItemDataManager.Add(itemCfg.id, 1);
-                }
+                ErrorCodeController.Handler(errorCode);
+                return;
             }
-            GetSuitItemController.enable = true;
             PromptController.Instance.ShowFloatTextPrompt("已获得所有服装", MessageType.SUCCESS);
         }
 
 
-        public static void GetAllCardItem()
+        public static async ETTask GetAllCardItem()
         {
             //获得所有卡牌部件
-            ItemCfg[] dataArray = ItemCfgArray.Instance.dataArray;
-            for (int i = 0; i < dataArray.Length; i++)
+            var errorCode = await GMHelper.SendGMToServer("get all card");
+            if (errorCode != ET.ErrorCode.ERR_Success)
             {
-                ItemCfg itemCfg = dataArray[i];
-                if (itemCfg.itemType == ConstItemType.CARD)
-                {
-                    ItemDataManager.Add(itemCfg.id, 1);
-                }
+                ErrorCodeController.Handler(errorCode);
+                return;
             }
             PromptController.Instance.ShowFloatTextPrompt("已获得所有卡牌", MessageType.SUCCESS);
         }
+
+        public static async ETTask<bool> SendGMCommand(string messageGM, string messageSuc)
+        {
+            var errorCode = await GMHelper.SendGMToServer(messageGM);
+            if (errorCode != ET.ErrorCode.ERR_Success)
+            {
+                ErrorCodeController.Handler(errorCode);
+                return false;
+            }
+            PromptController.Instance.ShowFloatTextPrompt(messageSuc, MessageType.SUCCESS);
+            return true;
+        }
     }
 }

+ 1 - 3
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -66,8 +66,6 @@ namespace GFGGame
         {
             //RoleInfo roleInfo = null;
             GetSuitItemController.enable = false;
-            DressUpMenuSuitDataManager.InitData();
-            DressUpMenuItemDataManager.InitData();
             //roleInfo = result.roleInfo;
             //bool rerult = AntiAddictionController.CheckAntiAddiction(roleInfo.onlineTimeSecs, roleInfo.onlineDurationSecs, roleInfo.onlineDurationSecsDay);
             //if (rerult)
@@ -75,7 +73,7 @@ namespace GFGGame
             //    return;
             //}
             //ServerDataManager.SetServerTime(roleInfo.serverTime);
-            //RoleDataManager.InitServerData(roleInfo);
+            RoleDataManager.InitServerData();
             //ItemDataManager.InitServerData(result.roleItemList);
             //CustomSuitDataManager.InitServerData(roleInfo.suitIndex, result.roleSuitList);
             //StoryDataManager.InitServerData(roleInfo);

+ 5 - 5
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -67,7 +67,7 @@ namespace GFGGame
             for (int i = 0; i < _itemDatas.Count; i++)
             {
                 int itemID = (int)_itemDatas[i];
-                int subType = ItemUtil.GetItemSubType(itemID);
+                int subType = ItemUtilCS.GetItemSubType(itemID);
                 if (type == (int)ConstDressUpItemType.TE_SHU && subType > type)
                 {
                     arrayList.Add(itemID);
@@ -121,8 +121,8 @@ namespace GFGGame
         {
             arrayList.Sort((int a, int b) =>
             {
-                int typeA = ItemUtil.GetItemSubType(a);
-                int typeB = ItemUtil.GetItemSubType(b);
+                int typeA = ItemUtilCS.GetItemSubType(a);
+                int typeB = ItemUtilCS.GetItemSubType(b);
                 int scoreA = GetItemScore(a);
                 int scoreB = GetItemScore(b);
                 if (typeB < typeA)
@@ -195,7 +195,7 @@ namespace GFGGame
             }
             foreach (int itemID in tempAllList)
             {
-                int subType = ItemUtil.GetItemSubType(itemID);
+                int subType = ItemUtilCS.GetItemSubType(itemID);
                 if (!CheckIsSceneType(itemID))
                 {
                     if (!recommendTypeList.Contains(subType))
@@ -216,7 +216,7 @@ namespace GFGGame
 
         public static bool CheckIsSceneType(int itemID)
         {
-            int subType = ItemUtil.GetItemSubType(itemID);
+            int subType = ItemUtilCS.GetItemSubType(itemID);
             DressUpMenuItemCfg1 typeCfg = DressUpMenuItemCfg1Array.Instance.GetCfg(12);
             foreach (int temp in typeCfg.subMenusArr)
             {

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Data/FunctionOpenDataManager.cs

@@ -1,3 +1,4 @@
+using ET;
 using System.Collections.Generic;
 using UnityEngine;
 
@@ -92,7 +93,7 @@ namespace GFGGame
         //检测配置角色是否开启
         private bool CheckIsLvFunOpen(FunctionOpenCfg cfg, bool showTips = true)
         {
-            if (RoleDataManager.lvl >= cfg.lv)
+            if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) >= cfg.lv)
             {
                 return true;
             }

+ 6 - 3
GameClient/Assets/Game/HotUpdate/Data/Handler/RoleDataHandler.cs

@@ -1,3 +1,4 @@
+using ET;
 using FairyGUI;
 
 namespace GFGGame
@@ -21,12 +22,14 @@ namespace GFGGame
 
         private static void OnUpdate(object param)
         {
-            if(!RoleDataManager.CheckPowerFull())
+            if(!RoleDataManager.powerTimeLock &&!RoleDataManager.CheckPowerFull())
             {
-                int passTime = ServerDataManager.currentTimeSecs - RoleDataManager.powerTime;
+                int powerTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerTime);
+                int passTime = ServerDataManager.currentTimeSecs - powerTime;
                 if(passTime >= GameConst.INTERVAL_TIME_SECONDS_POWER)
                 {
-                    RoleDataManager.power++;
+                    RoleDataManager.powerTimeLock = true;
+                    NumericHelper.RequestAddAttributePoint(GameGlobal.zoneScene, NumericType.Power).Coroutine();
                 }
             }
             int currentTimeSecs = ServerDataManager.currentTimeSecs;

+ 15 - 97
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -1,35 +1,17 @@
 using System.Collections.Generic;
+using ET;
 using FairyGUI;
 using UnityEngine;
+using static UnityEditor.Progress;
 
 namespace GFGGame
 {
     public class ItemDataManager
     {
         private static Dictionary<int, ItemData> _dataDic = new Dictionary<int, ItemData>();
-        private static Dictionary<int, int> _prepareDic = new Dictionary<int, int>();
 
-        public static void Add(int itemID, int itemNum, bool sendToServer = true)
+        public static void Add(int itemID, int itemNum)
         {
-            switch (itemID)
-            {
-                case ConstItemID.EXP:
-                    RoleDataManager.exp += itemNum;
-                    return;
-                case ConstItemID.POWER:
-                    RoleDataManager.power += itemNum;
-                    return;
-                case ConstItemID.GOLD:
-                    RoleDataManager.gold += itemNum;
-                    return;
-                case ConstItemID.DIAMOND_PURPLE:
-                    RoleDataManager.diaP += itemNum;
-                    return;
-                case ConstItemID.DIAMOND_RED:
-                    RoleDataManager.diaR += itemNum;
-                    return;
-            }
-
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
             if (itemCfg == null)
             {
@@ -52,7 +34,7 @@ namespace GFGGame
                 _dataDic.Add(itemID, itemData);
             }
             itemData.num += itemNum;
-            if (ItemUtil.IsDressUpItem(itemID) && itemID % GameConst.MAX_COUNT_EVERY_TYPE_ITEM > 0)
+            if (ItemUtilCS.IsDressUpItem(itemID) && itemID % GameConst.MAX_COUNT_EVERY_TYPE_ITEM > 0)
             {
                 DressUpMenuItemDataManager.Add(itemID);
             }
@@ -68,33 +50,11 @@ namespace GFGGame
                 DecomposeDataManager.Instance.Add(itemID);
             }
             PhotographDataManager.Instance.Add(itemID);
-            if (sendToServer)
-            {
-                PrepareUpdateToServer(itemData.id, itemData.num);
-            }
             EventAgent.DispatchEvent(ConstMessage.ITEM_CHANGED, itemID);
         }
 
         public static void Remove(int itemID, int itemNum)
         {
-            switch (itemID)
-            {
-                case ConstItemID.EXP:
-                    RoleDataManager.exp -= itemNum;
-                    return;
-                case ConstItemID.POWER:
-                    RoleDataManager.power -= itemNum;
-                    return;
-                case ConstItemID.GOLD:
-                    RoleDataManager.gold -= itemNum;
-                    return;
-                case ConstItemID.DIAMOND_PURPLE:
-                    RoleDataManager.diaP -= itemNum;
-                    return;
-                case ConstItemID.DIAMOND_RED:
-                    RoleDataManager.diaR -= itemNum;
-                    return;
-            }
             if (_dataDic.ContainsKey(itemID))
             {
                 ItemData itemData = _dataDic[itemID];
@@ -105,12 +65,10 @@ namespace GFGGame
                     itemData.num = 0;
                     _dataDic.Remove(itemID);
 
-                    if (ItemUtil.IsDressUpItem(itemID))
+                    if (ItemUtilCS.IsDressUpItem(itemID))
                     {
                         DressUpMenuItemDataManager.Remove(itemID);
                     }
-
-                    PrepareUpdateToServer(itemData.id, itemData.num);
                 }
 
                 ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
@@ -122,69 +80,29 @@ namespace GFGGame
             }
         }
 
-        public static int GetItemNum(int itemID)
-        {
-            switch (itemID)
-            {
-                case ConstItemID.EXP:
-                    return RoleDataManager.exp;
-                case ConstItemID.POWER:
-                    return RoleDataManager.power;
-                case ConstItemID.GOLD:
-                    return RoleDataManager.gold;
-                case ConstItemID.DIAMOND_PURPLE:
-                    return RoleDataManager.diaP;
-                case ConstItemID.DIAMOND_RED:
-                    return RoleDataManager.diaR;
+        public static int GetItemNum(int itemId)
+{
+            int numericType = NumericUtil.GetNumericTypeByItemId(itemId);
+            if (numericType != 0)
+            {
+                return GameGlobal.myNumericComponent.GetAsInt(numericType);
             }
-            if (_dataDic.ContainsKey(itemID))
+            if (_dataDic.TryGetValue(itemId, out var itemData))
             {
-                ItemData itemData = _dataDic[itemID];
                 return itemData.num;
             }
             return 0;
         }
 
-        public static void InitServerData(List<RoleItem> list)
+        public static void InitServerData(List<ItemInfoProto> items)
         {
             _dataDic.Clear();
-            _prepareDic.Clear();
-            if (list != null)
+            foreach (ItemInfoProto roleItem in items)
             {
-                foreach (RoleItem roleItem in list)
-                {
-                    Add(roleItem.itemId, roleItem.num, false);
-                }
+                Add(roleItem.ConfigId, roleItem.Count);
             }
         }
 
-        private static void PrepareUpdateToServer(int itemId, int itemNum)
-        {
-            _prepareDic[itemId] = itemNum;
-            if (!Timers.inst.Exists(UpdateToServer))
-            {
-                Timers.inst.Add(0.1f, 1, UpdateToServer);
-            }
-        }
-
-        private static void UpdateToServer(object param)
-        {
-            List<RoleItem> list = new List<RoleItem>();
-            foreach (KeyValuePair<int, int> item in _prepareDic)
-            {
-                RoleItem roleItem = new RoleItem();
-                roleItem.itemId = item.Key;
-                roleItem.num = item.Value;
-                list.Add(roleItem);
-            }
-            GameProxy.ReqUpdateRoleItems(list);
-            _prepareDic.Clear();
-        }
-
-        public static Dictionary<int, ItemData> GetItemDic()
-        {
-            return _dataDic;
-        }
         public static void GetMainScore(int itemId, out int mainScore, out int mainScoreValue)
         {
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);

+ 28 - 138
GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs

@@ -1,81 +1,41 @@
 using System;
 using UnityEngine;
 using FairyGUI;
+using ET;
+using System.Collections.Generic;
 
 namespace GFGGame
 {
     public class RoleDataManager
     {
+        public static bool powerTimeLock;
         public static long roleId;
         public static string roleName;
         public static int rechargeTotal;
         public static int rechargeTotalMon;
-        public static int powerTime
-        {
-            get;
-            private set;
-        }
 
-        private static int _powerBuyTimes = 0;
-        public static int powerBuyTimes
-        {
-            get
-            {
-                return _powerBuyTimes;
-            }
-            set
-            {
-                _powerBuyTimes = value;
-            }
-        }
-        private static int _power = GameConst.MAX_POWER_AUTO_REGAIN;
+
         public static int power
         {
             get
             {
-                return _power;
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.Power);
             }
             set
             {
-                int dValue = value - _power;
-                _power = value;
-                if (dValue != 0)
-                {
-                    powerTime = ServerDataManager.currentTimeSecs;
-                    GameController.PrepareUpdateTreasure();
-                    EventAgent.DispatchEvent(ConstMessage.ROLE_POWER_CHANGED, dValue);
-                }
+                
             }
         }
 
-        private static int _goldBuyTimes = 0;
-        public static int goldBuyTimes
-        {
-            get
-            {
-                return _goldBuyTimes;
-            }
-            set
-            {
-                _goldBuyTimes = value;
-            }
-        }
-        private static int _gold = 0;
         public static int gold
         {
             get
             {
-                return _gold;
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.Gold);
             }
             set
             {
-                int dValue = value - _gold;
-                _gold = value;
-                if (dValue != 0)
-                {
-                    GameController.PrepareUpdateTreasure();
-                    EventAgent.DispatchEvent(ConstMessage.ROLE_GOLD_CHANGED, dValue);
-                }
+                
             }
         }
         private static int _exp = 0;
@@ -83,35 +43,11 @@ namespace GFGGame
         {
             get
             {
-                return _exp;
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
             }
             set
             {
-                int oldValue = _exp;
-                RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(lvl);
-                if (roleLevelCfg.exp > 0)
-                {
-
-                    _exp = value;
-                    while (exp >= roleLevelCfg.exp)
-                    {
-                        lvl++;
-                        FunctionOpenDataManager.Instance.CheckHasLvFunOpen(lvl);//等级变化要加测是否有功能开启
-                        exp -= roleLevelCfg.exp;
-                        roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(lvl);
-                    }
-
-                }
-                else
-                {
-                    _exp = 0;
-                }
-                int dValue = _exp - oldValue;
-                if (dValue != 0)
-                {
-                    GameController.PrepareUpdateTreasure();
-                    EventAgent.DispatchEvent(ConstMessage.ROLE_EXP_CHANGED, dValue);
-                }
+                
             }
         }
         private static int _lvl = 1;
@@ -119,17 +55,11 @@ namespace GFGGame
         {
             get
             {
-                return _lvl;
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
             }
             set
             {
-                int dValue = value - _lvl;
-                _lvl = value;
-                if (dValue != 0)
-                {
-                    GameController.PrepareUpdateTreasure();
-                    EventAgent.DispatchEvent(ConstMessage.ROLE_LEVEL_CHANGED, dValue);
-                }
+                
             }
         }
         private static int _diaP = 0;
@@ -137,17 +67,11 @@ namespace GFGGame
         {
             get
             {
-                return _diaP;
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondP);
             }
             set
             {
-                int dValue = value - _diaP;
-                _diaP = value;
-                if (dValue != 0)
-                {
-                    GameController.PrepareUpdateTreasure();
-                    EventAgent.DispatchEvent(ConstMessage.ROLE_DIAMOND_PURPLE_CHANGED, dValue);
-                }
+                
             }
         }
         private static int _diaR = 0;
@@ -155,17 +79,11 @@ namespace GFGGame
         {
             get
             {
-                return _diaR;
+                return GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondR);
             }
             set
             {
-                int dValue = value - _diaR;
-                _diaR = value;
-                if (dValue != 0)
-                {
-                    GameController.PrepareUpdateTreasure();
-                    EventAgent.DispatchEvent(ConstMessage.ROLE_DIAMOND_RED_CHANGED, dValue);
-                }
+                
             }
         }
         private static string _lastRandomName = null;
@@ -186,49 +104,21 @@ namespace GFGGame
 
         public static bool CheckPowerFull()
         {
-            return RoleDataManager.power >= GameConst.MAX_POWER_AUTO_REGAIN;
+            return GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) >= GameConst.MAX_POWER_AUTO_REGAIN;
         }
 
-        public static void InitServerData(RoleInfo roleInfo)
+        public static void InitServerData()
         {
-            if (roleInfo != null)
-            {
-                roleId = roleInfo.id;
-                roleName = roleInfo.name;
-                rechargeTotal = roleInfo.rechargeTotal;
-                rechargeTotalMon = roleInfo.rechargeTotalMon;
-                _power = roleInfo.power;
-                _gold = roleInfo.gold;
-                _exp = roleInfo.exp;
-                _lvl = roleInfo.lvl;
-                _diaP = roleInfo.diaP;
-                _diaR = roleInfo.diaR;
-                powerTime = roleInfo.powerTime;
-                //处理体力
-                while (!CheckPowerFull())
-                {
-                    int passTime = ServerDataManager.currentTimeSecs - powerTime;
-                    if (passTime >= GameConst.INTERVAL_TIME_SECONDS_POWER)
-                    {
-                        _power++;
-                        powerTime += GameConst.INTERVAL_TIME_SECONDS_POWER;
-                    }
-                    else
-                    {
-                        break;
-                    }
-                }
-            }
-            else
-            {
-                _power = GameConst.MAX_POWER_AUTO_REGAIN;
-                _gold = 0;
-                _exp = 0;
-                _lvl = 1;
-                _diaP = 0;
-                _diaR = 0;
-                powerTime = 0;
-            }
+            //roleId = roleInfo.id;
+            roleName = GameGlobal.zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRoleName();
+            //rechargeTotal = roleInfo.rechargeTotal;
+            //rechargeTotalMon = roleInfo.rechargeTotalMon;
+            //_gold = roleInfo.gold;
+            //_exp = roleInfo.exp;
+            //_lvl = roleInfo.lvl;
+            //_diaP = roleInfo.diaP;
+            //_diaR = roleInfo.diaR;
+            
         }
 
     }

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Data/ScoreSystemData.cs

@@ -1,3 +1,4 @@
+using ET;
 using System.Collections.Generic;
 using UnityEngine;
 
@@ -80,7 +81,7 @@ namespace GFGGame
                     }
                 }
             }
-            int roleScore = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).baseScore;
+            int roleScore = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl)).baseScore;
             int cardScore = DressUpMenuItemDataManager.GetItemScore(StoryDataManager.currentCardId);
             double tagScore = tagProportion * partScore;
 
@@ -143,7 +144,7 @@ namespace GFGGame
                     clickCoefficient = ConstScoreSystem.PERFECT_SCORE;
                     break;
             }
-            int roleScore = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl).baseScore;
+            int roleScore = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl)).baseScore;
             int cardScore = DressUpMenuItemDataManager.GetItemScore(StoryDataManager.currentCardId);
             double clickScore = (GetPartBaseScore(partId) + (cardScore + roleScore) * clickCoefficient) * ConstScoreSystem.CLICK_SCORE;
             return clickScore;

+ 10 - 21
GameClient/Assets/Game/HotUpdate/Data/StoryDataManager.cs

@@ -2,6 +2,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System;
 using UnityEngine;
+using ET;
 
 namespace GFGGame
 {
@@ -35,24 +36,12 @@ namespace GFGGame
         public static void InitServerData(RoleInfo roleInfo)
         {
             usedRecommend = false;
-            if (roleInfo != null)
-            {
-                _passChapter = roleInfo.chapter;
-                _passLevel = roleInfo.chapterLvl;
-                _passChapterJY = roleInfo.chapterJY;
-                _passLevelJY = roleInfo.chapterLvlJY;
-                _recommendCount = roleInfo.recommendCount;
-                recommendDay = roleInfo.recommendDay;
-            }
-            else
-            {
-                _passChapter = 0;
-                _passLevel = 0;
-                _passChapterJY = ConstStoryType.START_ID_OF_HARD;
-                _passLevelJY = 0;
-                recommendDay = -1;
-                ResetDailyData();
-            }
+            _passChapter = roleInfo.chapter;
+            _passLevel = roleInfo.chapterLvl;
+            _passChapterJY = roleInfo.chapterJY;
+            _passLevelJY = roleInfo.chapterLvlJY;
+            _recommendCount = roleInfo.recommendCount;
+            recommendDay = roleInfo.recommendDay;
         }
 
         public static void InitScoreList(List<StoryScore> list)
@@ -215,7 +204,7 @@ namespace GFGGame
         public static bool CheckChapterUnlock(int chapterId)
         {
             StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterId);
-            if (RoleDataManager.lvl < chapterCfg.lvl)
+            if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) < chapterCfg.lvl)
             {
                 return false;
             }
@@ -425,7 +414,7 @@ namespace GFGGame
             //消耗体力
             if (currentBonusList != null && currentBonusList.Count > 0)
             {
-                if (RoleDataManager.power >= levelCfg.power)
+                if (GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) >= levelCfg.power)
                 {
                     RoleDataManager.power -= levelCfg.power;
                 }
@@ -466,7 +455,7 @@ namespace GFGGame
         public static int GetCanFightTime(string levelID)
         {
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
-            int time = (int)Math.Floor((float)RoleDataManager.power / levelCfg.power);
+            int time = (int)Math.Floor((float)GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) / levelCfg.power);
             return time;
         }
 

+ 6 - 5
GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs

@@ -3,6 +3,7 @@ using UnityEngine;
 using System;
 using System.Linq;
 using FairyGUI;
+using ET;
 
 namespace GFGGame
 {
@@ -162,7 +163,7 @@ namespace GFGGame
 
         public void AddOrRemove(int value, bool checkDefault, bool isAdd = false, bool isRemove = false)
         {
-            int subType = ItemUtil.GetItemSubType(value);
+            int subType = ItemUtilCS.GetItemSubType(value);
             if (subType == ConstDressUpItemType.BEI_JING)
             {
                 _bgId = value;
@@ -199,7 +200,7 @@ namespace GFGGame
             for (int i = 0; i < _equipDatas.Count; i++)
             {
                 int itemID = (int)_equipDatas[i];
-                int subType = ItemUtil.GetItemSubType(itemID);
+                int subType = ItemUtilCS.GetItemSubType(itemID);
                 if (subType == type
                     || (type == ConstDressUpItemType.LIAN_YI_QUN && (subType == ConstDressUpItemType.SHANG_YI || subType == ConstDressUpItemType.XIA_ZHUANG || subType == ConstDressUpItemType.NEI_DA))
                     || (type == ConstDressUpItemType.SHANG_YI && subType == ConstDressUpItemType.LIAN_YI_QUN)
@@ -247,7 +248,7 @@ namespace GFGGame
                 for (int i = 0; i < _equipDatas.Count; i++)
                 {
                     int itemID = (int)_equipDatas[i];
-                    int subType = ItemUtil.GetItemSubType(itemID);
+                    int subType = ItemUtilCS.GetItemSubType(itemID);
                     if (subType == (int)ConstDressUpItemType.FA_XING)
                     {
                         has1 = true;
@@ -311,7 +312,7 @@ namespace GFGGame
                 checkDefaultItem();
                 UpdatePicAction();
             }
-            RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl);
+            RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
             score = roleLevelCfg.baseScore;
             foreach (int itemId in _equipDatas)
             {
@@ -414,7 +415,7 @@ namespace GFGGame
                 if (DressUpMenuItemDataManager.CheckHasItem(itemID))
                 {
                     bool isSceneType = DressUpMenuItemDataManager.CheckIsSceneType(itemID);
-                    subType = ItemUtil.GetItemSubType(itemID);
+                    subType = ItemUtilCS.GetItemSubType(itemID);
                     if (!_isPic || isSceneType)
                     {
                         if (!noSceneType || !isSceneType)

+ 1 - 1
GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs

@@ -54,7 +54,7 @@ namespace GFGGame
                 int id = (int)equipDatas[i];
                 if (exceptTypes != null)
                 {
-                    int subType = ItemUtil.GetItemSubType(id);
+                    int subType = ItemUtilCS.GetItemSubType(id);
                     if (Array.IndexOf(exceptTypes, subType) >= 0)
                     {
                         continue;

+ 1 - 6
GameClient/Assets/Game/HotUpdate/ETView/Numeric/Event/NumericWatcher_RefreshMainUI.cs

@@ -1,13 +1,8 @@
 using ET.EventType;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace ET
 {
-    [NumericWatcher(NumericType.LVL)]
+    [NumericWatcher(NumericType.Lvl)]
     public class NumericWatcher_RefreshMainUI : INumericWatcher
     {
         public void Run(NumbericChange args)

+ 0 - 39
GameClient/Assets/Game/HotUpdate/GameConst.cs

@@ -1,39 +0,0 @@
-namespace GFGGame
-{
-    public class GameConst
-    {
-
-        public static string SERVER_VERSION = "1.0.5";
-        /// <summary>
-        /// unity的一个单位长度对应的像素值
-        /// </summary>
-        public const int PIXELS_PER_UNITY_UNIT = 100;
-
-        public const int MAX_COUNT_TO_BUY_DIAMOND_RED = 9990;//单次鲛绡最大购买量
-        public const int MAX_COUNT_TO_SAVE_SUIT = 6;
-        public const int MAX_COUNT_EVERY_TYPE_ITEM = 10000;
-        public const float LETTERS_INTERVAL_MAX = 0.12f;
-        public const int MAX_SPEED_AUTO_PLAY = 4;
-        public const float NEXT_WORDS_INTERVAL_MAX = 1f;
-        public const float POWER_PER_GOLD = 0.5f;
-        // public const int MAX_GOLD_TO_BUY_POWER_ONCE = 60;
-        public const int MAX_POWER_AUTO_REGAIN = 62;
-        public const int INTERVAL_TIME_SECONDS_POWER = 60;
-        // public const int GOLD_PER_DIAMOND_PURPLE = 10;
-        // public const int DIAMOND_RED_PER_DIAMOND_PURPLE = 1;
-        // public const int MAX_DIAMOND_PURPLE_TO_BUY_GOLD_ONCE = 100;
-        // public const int MAX_DIAMOND_PURPLE_TO_BUY_DIAMOND_RED_ONCE = 100;
-        public const int MAX_COUNT_FIGHT_QUICKLY = 10;
-        public const int MAX_COUNT_RECOMMEND = 10;
-        public const string VISITOR_ID_KEY = "visitorID";
-        public const string ACCOUNT_LAST_LOGIN_KEY = "account";
-        public const string PASSWORD_LAST_LOGIN_KEY = "password";
-        public const string LAST_LOGIN_IS_VISITOR_KEY = "LAST_LOGIN_IS_VISITOR";
-
-        public const string ROLE_NAMES = "栀言 南歌 星纯 洛白 清辞 羽棋 月心 青颜 芸清 素伊 一禾 绾颜 晴初 语岚 容嫣 知渝 静岑 乐潼 歆恬 熙禾 乐羡 安夏 南伊 诺柠 念禾 楚兮 言梦 长乐 锦恬 语汐 芮依 书苑 忆厢 纯一 江阮 之韵 知笙 黎初 凉笙 浮梦 芊月 琼裳 静墨 缀画 云染 尘霜 花扶 绿绮 引歌 雨纤 凝眉 入画 雪落 玥影 云烟 舞柳 舒袖 春罗 墨染 若灵 月开 岚秀 千茉";
-        public static readonly string[] ROLE_NAME_LIST = ROLE_NAMES.Split(' ');
-        public static readonly string[] CHINESE_NUMBER = { "一", "二", "三", "四", "五", "六", "七", "八", "九", "十" };
-
-
-    }
-}

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

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

+ 5 - 3
GameClient/Assets/Game/HotUpdate/GameGlobal.cs

@@ -1,6 +1,6 @@
 using FairyGUI;
 using UnityEngine;
-using VEngine;
+using ET;
 using UI.Common;
 
 
@@ -23,8 +23,10 @@ namespace GFGGame
         public static string gameApiUrlTest;
 
         //ET
-        public static ET.Scene zoneScene;
         public const string LoginAddress = "127.0.0.1:10002";
+        public static Scene zoneScene;
+        public static Unit myUnit;
+        public static NumericComponent myNumericComponent;
 
         private static UI_ComHolder comHolder;
         private static GameObject _gameObj;
@@ -42,7 +44,7 @@ namespace GFGGame
         {
             get
             {
-                return Application.version + "." + Versions.ManifestsVersion;
+                return Application.version + "." + VEngine.Versions.ManifestsVersion;
             }
         }
         private static void CreatClickEffect()

+ 11 - 11
GameClient/Assets/Game/HotUpdate/Net/Proxy/GameProxy.cs

@@ -17,7 +17,7 @@ namespace GFGGame
                 {
                     if (result != null && result.roleInfo != null)
                     {
-                        GameController.PreEnterGame(result);
+                        //GameController.PreEnterGame(result);
                     }
                     else
                     {
@@ -37,11 +37,11 @@ namespace GFGGame
                 {
                     ViewManager.Hide(ViewName.CREATE_ROLE_VIEW);
                     GameGlobal.isFirstEntry = true;
-                    GameController.PreEnterGame(result);
+                    //GameController.PreEnterGame(result);
                     if (GameGlobal.skipGuide)
                     {
                         ReqUpdateStoryProgress(10, 100, 100010, 10100);
-                        RoleDataManager.lvl = 100;
+                        //RoleDataManager.lvl = 100;
                     }
                 }
             });
@@ -49,14 +49,14 @@ namespace GFGGame
 
         public static void ReqUpdateTreasure()
         {
-            Dictionary<string, object> data = JsonUtil.createJsonDic("id", RoleDataManager.roleId,
-                                                                    "power", RoleDataManager.power,
-                                                                    "gold", RoleDataManager.gold,
-                                                                    "exp", RoleDataManager.exp,
-                                                                    "lvl", RoleDataManager.lvl,
-                                                                    "diaP", RoleDataManager.diaP,
-                                                                    "diaR", RoleDataManager.diaR,
-                                                                    "powerTime", RoleDataManager.powerTime
+            Dictionary<string, object> data = JsonUtil.createJsonDic("id", RoleDataManager.roleId
+                                                                    //"power", RoleDataManager.power,
+                                                                    //"gold", RoleDataManager.gold,
+                                                                    //"exp", RoleDataManager.exp,
+                                                                    //"lvl", RoleDataManager.lvl,
+                                                                    //"diaP", RoleDataManager.diaP,
+                                                                    //"diaR", RoleDataManager.diaR
+                                                                    //"powerTime", RoleDataManager.powerTime
                                                                     );
             Post(GameProtoId.UPDATE_TREASURE, "roleInfo", data, (GameResult result) =>
             {

+ 12 - 45
GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs

@@ -1,3 +1,4 @@
+using ET;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -7,37 +8,7 @@ namespace GFGGame
 {
     public class ItemUtil
     {
-        /// <summary>
-        /// 物品的大类型,对应ConstItemType
-        /// </summary>
-        /// <param name="itemId"></param>
-        /// <returns></returns>
-        public static int GetItemType(int itemId)
-        {
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
-            if (itemCfg != null)
-            {
-                return itemCfg.itemType;
-            }
-            return 0;
-        }
-
-        /// <summary>
-        /// 物品子类型
-        /// </summary>
-        /// <param name="itemId"></param>
-        /// <returns></returns>
-        public static int GetItemSubType(int itemId)
-        {
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
-            int subType = 0;
-            if (itemCfg != null)
-            {
-                subType = itemCfg.subType;
-            }
-            return subType;
-        }
-
+        
         /// <param name="showTips">是否弹购买成功飘字,默认是</param>
         /// <param name="openSource">是否打开来源界面。默认否</param>
         /// <param name="showTxtBuyTips">是否显示购买提示</param>
@@ -70,10 +41,11 @@ namespace GFGGame
             CurrencyRatioCfg currencyRatioCfg;
             if (itemId == ConstItemID.POWER)
             {
+                int powerBuyTimes = GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerBuyTimes);
                 //体力购买次数不同,对应消耗配置不同
-                if (RoleDataManager.powerBuyTimes < currencyRatioCfgs.Length)
+                if (powerBuyTimes < currencyRatioCfgs.Length)
                 {
-                    currencyRatioCfg = currencyRatioCfgs[RoleDataManager.powerBuyTimes];
+                    currencyRatioCfg = currencyRatioCfgs[powerBuyTimes];
                 }
                 else
                 {
@@ -90,17 +62,18 @@ namespace GFGGame
         {
             CurrencyRatioCfg currencyRatioCfg = GetCurrencyRatioCfgById(ConstItemID.POWER);
             int count = GetCostItemCount(ConstItemID.POWER, currencyRatioCfg.num);
-            int lastBuyCount = currencyRatioCfg.maxLimit - RoleDataManager.powerBuyTimes;
+            int powerBuyTimes = GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerBuyTimes);
+            int lastBuyCount = currencyRatioCfg.maxLimit - powerBuyTimes;
 
             string showTxt = string.Format("每5分钟回复1点体力\n今日剩余购买{0}/{1}次", lastBuyCount, currencyRatioCfg.maxLimit);
             BuyConfirmController.Show(ConstItemID.POWER, currencyRatioCfg.num, currencyRatioCfg.costId, currencyRatioCfg.costNum, () =>
             {
-                RoleDataManager.powerBuyTimes = RoleDataManager.powerBuyTimes + 1;
+                NumericHelper.RequestAddAttributePoint(GameGlobal.zoneScene , NumericType.PowerBuyTimes).Coroutine();
                 if (onSuccess != null)
                 {
                     onSuccess();
                 }
-            }, lastBuyCount, RoleDataManager.powerBuyTimes, showTxt);
+            }, lastBuyCount, powerBuyTimes, showTxt);
 
         }
 
@@ -109,10 +82,10 @@ namespace GFGGame
             CurrencyRatioCfg currencyRatioCfg = GetCurrencyRatioCfgById(ConstItemID.GOLD);
             int count = value > 0 ? value : currencyRatioCfg.num;
             int costCount = GetCostItemCount(ConstItemID.GOLD, count);
-            int lastBuyCount = currencyRatioCfg.maxLimit - RoleDataManager.goldBuyTimes;
+            int lastBuyCount = currencyRatioCfg.maxLimit - GameGlobal.myNumericComponent.GetAsInt(NumericType.GoldBuyTimes);
             BuyConfirmController.Show(ConstItemID.GOLD, count, currencyRatioCfg.costId, costCount, () =>
             {
-                RoleDataManager.goldBuyTimes = RoleDataManager.goldBuyTimes + 1;
+                NumericHelper.RequestAddAttributePoint(GameGlobal.zoneScene, NumericType.GoldBuyTimes).Coroutine();
                 if (onSuccess != null)
                 {
                     onSuccess();
@@ -262,12 +235,6 @@ namespace GFGGame
             return itemData;
         }
 
-        public static Boolean IsDressUpItem(int itemId)
-        {
-            int itemType = GetItemType(itemId);
-            return itemType == ConstItemType.DRESS_UP;
-        }
-
         public static Boolean CheckItemEnough(int itemId, int num)
         {
             int hasNum = ItemDataManager.GetItemNum(itemId);
@@ -280,7 +247,7 @@ namespace GFGGame
 
             if (needItemId > 0)
             {
-                int subType = ItemUtil.GetItemSubType(needItemId);
+                int subType = ItemUtilCS.GetItemSubType(needItemId);
                 if (subType == cfg1.type)
                 {
                     return true;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Utils/SuitUtil.cs

@@ -14,7 +14,7 @@ namespace GFGGame
             int[] items = suitCfg.partsArr;
             foreach (int itemId in items)
             {
-                int itemType = ItemUtil.GetItemSubType(itemId);
+                int itemType = ItemUtilCS.GetItemSubType(itemId);
                 if (itemType != ConstDressUpItemType.FEN_WEI)
                 {
                     score += DressUpMenuItemDataManager.GetItemScore(itemId);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -687,7 +687,7 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
-            EventAgent.RemoveEventListener(ConstMessage.MONEY_CHANGE, UpdateUpStarView);
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateUpStarView);
             EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, OnItemChangeListener);
             Timers.inst.Remove(OnTimedEvent);
 

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/ClothingShopView.cs

@@ -87,7 +87,7 @@ namespace GFGGame
             _ui.m_compItemInfo.m_listTag.itemRenderer = RenderListTagItem;
 
             EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateItemChange);
-            EventAgent.AddEventListener(ConstMessage.MONEY_CHANGE, UpdateItemChange);
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateItemChange);
             // EventAgent.DispatchEvent(ConstMessage.MONEY_CHANGE, RoleDataManager.gold);
 
         }
@@ -236,7 +236,7 @@ namespace GFGGame
             {
                 _wrapper.wrapTarget = _sceneObject;
             }
-            int type = ItemUtil.GetItemSubType(_cfgSelected.itemID);
+            int type = ItemUtilCS.GetItemSubType(_cfgSelected.itemID);
             float duration = DURATION;
             if (!tween)
             {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -207,7 +207,7 @@ namespace GFGGame
             {
                 _wrapper.wrapTarget = _sceneObject;
             }
-            int type = ItemUtil.GetItemSubType(_selectedItemId);
+            int type = ItemUtilCS.GetItemSubType(_selectedItemId);
             float duration = DURATION;
             if (!tween)
             {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/GoodsItemTipsController.cs

@@ -4,7 +4,7 @@ namespace GFGGame
     {
         public static void ShowItemTips(int itemID)
         {
-            if(ItemUtil.IsDressUpItem(itemID))
+            if(ItemUtilCS.IsDressUpItem(itemID))
             {
                 ViewManager.Show(ViewName.DRESS_UP_ITEM_TIPS_VIEW, itemID);
             }

+ 9 - 36
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -1,5 +1,6 @@
 using UI.CommonGame;
 using FairyGUI;
+using ET;
 
 namespace GFGGame
 {
@@ -67,16 +68,10 @@ namespace GFGGame
 
         public void OnShown()
         {
-            UpdateGold();
-            UpdatePower();
-            UpdateDiamondPurple();
-            UpdateDiamondRed();
+            UpdateNumeric();
             UpdateCJExchange();
             UpdateCJ(LuckyBoxBonusDataCache.currentBoxId);
-            EventAgent.AddEventListener(ConstMessage.ROLE_GOLD_CHANGED, UpdateGold);
-            EventAgent.AddEventListener(ConstMessage.ROLE_POWER_CHANGED, UpdatePower);
-            EventAgent.AddEventListener(ConstMessage.ROLE_DIAMOND_PURPLE_CHANGED, UpdateDiamondPurple);
-            EventAgent.AddEventListener(ConstMessage.ROLE_DIAMOND_RED_CHANGED, UpdateDiamondRed);
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateNumeric);
             EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateItem);
         }
         public void Controller(int ctrlSelected)
@@ -86,10 +81,7 @@ namespace GFGGame
         }
         public void OnHide()
         {
-            EventAgent.RemoveEventListener(ConstMessage.ROLE_GOLD_CHANGED, UpdateGold);
-            EventAgent.RemoveEventListener(ConstMessage.ROLE_POWER_CHANGED, UpdatePower);
-            EventAgent.RemoveEventListener(ConstMessage.ROLE_DIAMOND_PURPLE_CHANGED, UpdateDiamondPurple);
-            EventAgent.RemoveEventListener(ConstMessage.ROLE_DIAMOND_RED_CHANGED, UpdateDiamondRed);
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateNumeric);
             EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateItem);
         }
 
@@ -99,35 +91,16 @@ namespace GFGGame
             UpdateCJ(LuckyBoxBonusDataCache.currentBoxId);
         }
 
-        private void UpdateGold()
+        private void UpdateNumeric()
         {
-            _valueBar.m_btnGold.text = "" + RoleDataManager.gold;
-            EventAgent.DispatchEvent(ConstMessage.MONEY_CHANGE, RoleDataManager.gold);
+            _valueBar.m_btnGold.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Gold);
+            _valueBar.m_btnPower.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Power);
+            _valueBar.m_btnDiamondPurple.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondP);
+            _valueBar.m_btnDiamondRed.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondR);
 
 
         }
 
-        private void UpdatePower()
-        {
-            _valueBar.m_btnPower.text = "" + RoleDataManager.power;
-            EventAgent.DispatchEvent(ConstMessage.MONEY_CHANGE, RoleDataManager.power);
-
-        }
-
-        private void UpdateDiamondPurple()
-        {
-            _valueBar.m_btnDiamondPurple.text = "" + RoleDataManager.diaP;
-            EventAgent.DispatchEvent(ConstMessage.MONEY_CHANGE, RoleDataManager.diaP);
-
-        }
-
-        private void UpdateDiamondRed()
-        {
-            _valueBar.m_btnDiamondRed.text = "" + RoleDataManager.diaR;
-            EventAgent.DispatchEvent(ConstMessage.MONEY_CHANGE, RoleDataManager.diaR);
-
-        }
-
         //ÕªÐÇ£¨³é½±£©¶Ò»»
         private void UpdateCJExchange()
         {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyCountView.cs

@@ -84,7 +84,7 @@ namespace GFGGame
             _ui.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
             string itemName = itemCfg.name;
             _ui.m_txtName.text = itemName;
-            if (ItemUtil.IsDressUpItem(_itemId))
+            if (ItemUtilCS.IsDressUpItem(_itemId))
             {
                 _ui.m_rarity.visible = true;
                 RarityIconController.UpdateRarityIcon(_ui.m_rarity, _itemId, false);

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

@@ -513,7 +513,7 @@ namespace GFGGame
             typeItem.m_icon.url = "ui://DressUp/hz_fenleituej_" + item2.id;
             //typeItem.m_imgTitle.url = "ui://DressUp/hz_iconziej_" + item2.id;
             typeItem.target.data = item2.id;
-            var subType = ItemUtil.GetItemSubType(_fightCfg.needItemId);
+            var subType = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
             typeItem.m_imgNeed.visible = subType == item2.type;
         }
 
@@ -679,7 +679,7 @@ namespace GFGGame
                         else if (GuideDataManager.GetGuideCountCopy(ConstGuideId.BUY_CLOTHING) <= 0)
                         {
                             int type = 0;
-                            if (_fightCfg.needItemId > 0) type = ItemUtil.GetItemSubType(_fightCfg.needItemId);
+                            if (_fightCfg.needItemId > 0) type = ItemUtilCS.GetItemSubType(_fightCfg.needItemId);
 
                             if (_fightCfg.needSuitId > 0) type = ConstDressUpItemType.TAO_ZHUANG;
 

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

@@ -60,7 +60,7 @@ namespace GFGGame
             base.OnShown();
 
             EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, UpdateNormal);
-            EventAgent.AddEventListener(ConstMessage.MONEY_CHANGE, UpdateNormal);
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateNormal);
 
             int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
             if (this.viewData != null)
@@ -233,7 +233,7 @@ namespace GFGGame
 
             Timers.inst.Remove(CheckTime);
             EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, UpdateNormal);
-            EventAgent.RemoveEventListener(ConstMessage.MONEY_CHANGE, UpdateNormal);
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateNormal);
         }
 
         private void OnClickBtnBack()

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs

@@ -1,3 +1,4 @@
+using ET;
 using FairyGUI;
 using System.Collections.Generic;
 using UI.Main;
@@ -137,7 +138,7 @@ namespace GFGGame
                     listItem.m_content.m_imgLock.visible = true;
                     listItem.m_content.m_imgLockBg.visible = true;
                     listItem.m_content.m_txtLockDesc.visible = true;
-                    if (chapterCfg.lvl > RoleDataManager.lvl)
+                    if (chapterCfg.lvl > GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl))
                     {
                         listItem.m_content.m_txtLockDesc.text = "通关上一章\n并达到" + chapterCfg.lvl + "级开启";
                     }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightQuicklyView.cs

@@ -52,14 +52,14 @@ namespace GFGGame
             _expAdd = fightCfg.exp;
             _power = levelCfg.power;
             StartFight(count);
-            EventAgent.AddEventListener(ConstMessage.ROLE_POWER_CHANGED, UpdateBtnFightTimes);
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
         }
 
         protected override void OnHide()
         {
             base.OnHide();
             Timers.inst.Remove(ShowBonusItem);
-            EventAgent.RemoveEventListener(ConstMessage.ROLE_POWER_CHANGED, UpdateBtnFightTimes);
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
         }
 
         private void StartFight(int count)

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryLevelInfoView.cs

@@ -51,14 +51,14 @@ namespace GFGGame
 
 
 
-            EventAgent.AddEventListener(ConstMessage.ROLE_POWER_CHANGED, UpdateBtnFightTimes);
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
         }
 
         protected override void OnHide()
         {
             base.OnHide();
 
-            EventAgent.RemoveEventListener(ConstMessage.ROLE_POWER_CHANGED, UpdateBtnFightTimes);
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateBtnFightTimes);
         }
 
         private void OnClickBtnStart()

+ 9 - 6
GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs

@@ -3,6 +3,8 @@ using UnityEngine;
 using UI.Main;
 using System.Collections;
 using System.Collections.Generic;
+using ET;
+
 namespace GFGGame
 {
     public class StroyFightResultView : BaseView
@@ -63,10 +65,10 @@ namespace GFGGame
             int score = EquipDataCache.cacher.totalScore;
             SceneController.UpdateRole(EquipDataCache.cacher.equipDatas, _sceneObject);
             _ui.m_selfScore.m_txtScore.text = "" + score;
-            _ui.m_expBar.m_txtLvl.text = "" + RoleDataManager.lvl;
-            RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl);
+            _ui.m_expBar.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
+            RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
             _ui.m_expBar.m_pbExp.max = roleLevelCfg.exp;
-            _ui.m_expBar.m_pbExp.value = RoleDataManager.exp;
+            _ui.m_expBar.m_pbExp.value = GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
 
             resule = GetFightResult();
             int starCount = !resule ? 0 : StoryDataManager.GetResultStarCount(score);
@@ -159,12 +161,13 @@ namespace GFGGame
 
         private void AddExp(object param)
         {
-            _ui.m_expBar.m_txtLvl.text = "" + RoleDataManager.lvl;
-            if (RoleDataManager.exp <= _ui.m_expBar.m_pbExp.value)
+            _ui.m_expBar.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
+            int exp = GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
+            if (exp <= _ui.m_expBar.m_pbExp.value)
             {
                 _ui.m_expBar.m_pbExp.value = 0;
             }
-            _ui.m_expBar.m_pbExp.TweenValue(RoleDataManager.exp, 0.2f);
+            _ui.m_expBar.m_pbExp.TweenValue(exp, 0.2f);
             _ui.m_btnClose.enabled = true;
             int targetY = (int)_ui.m_expBar.target.y - 250;
 

+ 4 - 5
GameClient/Assets/Game/HotUpdate/Views/MainUI/GMPanelView.cs

@@ -45,12 +45,12 @@ namespace GFGGame
 
         private void OnClickBtnGetAllDressUpItem()
         {
-            GMController.GetAllDressUpItem();
+            GMController.GetAllDressUpItem().Coroutine();
         }
 
         private void OnClickBtnGetAllCardItem()
         {
-            GMController.GetAllCardItem();
+            GMController.GetAllCardItem().Coroutine();
         }
 
         private void OnClickBtnAddItem(EventContext context)
@@ -67,9 +67,8 @@ namespace GFGGame
             int itemNum = int.Parse(infos[1]);
             if(itemId > 0 && itemNum > 0)
             {
-                ItemDataManager.Add(itemId, itemNum);
-                string message = "ÒÑ»ñµÃÎïÆ·" + itemId + "*" + itemNum;
-                PromptController.Instance.ShowFloatTextPrompt(message, MessageType.SUCCESS);
+                string messageSuc = "ÒÑ»ñµÃÎïÆ·" + itemId + "*" + itemNum;
+                GMController.SendGMCommand("getItem " + content, messageSuc).Coroutine();
             }
             else
             {

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -3,6 +3,7 @@ using UI.Main;
 using UI.CommonGame;
 using UnityEngine;
 using System.Collections.Generic;
+using ET;
 
 namespace GFGGame
 {
@@ -272,7 +273,7 @@ namespace GFGGame
 
         private void UpdateRoleLvl()
         {
-            _ui.m_headBar.m_txtLvl.text = "" + RoleDataManager.lvl;
+            _ui.m_headBar.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
         }
 
         private void Update(object param)

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Views/MainUI/RoleInfoView.cs

@@ -1,3 +1,4 @@
+using ET;
 using UI.Main;
 using static GFGGame.LauncherConfig;
 
@@ -42,11 +43,11 @@ namespace GFGGame
         {
             base.OnShown();
             _ui.m_txtRoleName.text = RoleDataManager.roleName;
-            _ui.m_txtLvl.text = "" + RoleDataManager.lvl;
-            RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(RoleDataManager.lvl);
+            _ui.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
+            RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
             if(roleLevelCfg.exp > 0)
             {
-                _ui.m_proBarExp.value = RoleDataManager.exp;
+                _ui.m_proBarExp.value = GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
                 _ui.m_proBarExp.max = roleLevelCfg.exp;
             }
             else