Browse Source

Merge remote-tracking branch 'remotes/origin/master' into xiaojie

hexiaojie 2 years ago
parent
commit
548d918073

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CreateRole/UI_CreateRoleUI.cs

@@ -7,6 +7,7 @@ namespace UI.CreateRole
     public partial class UI_CreateRoleUI
     {
         public GComponent target;
+        public GLoader m_loaBg;
         public UI_EnvelopeModel m_envelopeModel;
         public const string URL = "ui://5al8chbdxt5s0";
         public const string PACKAGE_NAME = "CreateRole";
@@ -55,10 +56,12 @@ namespace UI.CreateRole
 
         private void Init(GComponent comp)
         {
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_envelopeModel = (UI_EnvelopeModel)UI_EnvelopeModel.Create(comp.GetChild("envelopeModel"));
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_loaBg = null;
             m_envelopeModel.Dispose();
             m_envelopeModel = null;
             if(disposeTarget && target != null)

+ 0 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CreateRole/UI_EnvelopeModel.cs

@@ -7,7 +7,6 @@ namespace UI.CreateRole
     public partial class UI_EnvelopeModel
     {
         public GComponent target;
-        public GLoader m_loaBg;
         public GGraph m_NiaoEffectHolder;
         public GButton m_btnSure;
         public GButton m_btnDice;
@@ -65,7 +64,6 @@ namespace UI.CreateRole
 
         private void Init(GComponent comp)
         {
-            m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_NiaoEffectHolder = (GGraph)comp.GetChild("NiaoEffectHolder");
             m_btnSure = (GButton)comp.GetChild("btnSure");
             m_btnDice = (GButton)comp.GetChild("btnDice");
@@ -79,7 +77,6 @@ namespace UI.CreateRole
         }
         public void Dispose(bool disposeTarget = false)
         {
-            m_loaBg = null;
             m_NiaoEffectHolder = null;
             m_btnSure = null;
             m_btnDice = null;

+ 13 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/TaskSProxy.cs

@@ -93,7 +93,19 @@ namespace GFGGame
             //C2M_GetTaskBonus
             var response = (M2C_GetTaskBonus)await MessageHelper.SendToServer(new C2M_GetTaskBonus { Id = taskId });
             if (!(response is { Error: ErrorCode.ERR_Success })) return false;
-            TaskDataManager.Instance.UpdateTaskState(response.Id, response.Status);
+            if (response.NextTask != null) {
+                var taskInfo = new TaskInfo
+                {
+                    ID = response.NextTask.Id,
+                    State = response.NextTask.Status,
+                    Progress = response.NextTask.Progress
+                };
+                TaskDataManager.Instance.UpdateTaskInfo(response.NextTask.Id, taskInfo);
+                TaskDataManager.Instance.RemoveTaskInfo(response.Id);
+            }
+            else
+                TaskDataManager.Instance.UpdateTaskState(response.Id, response.Status);
+
             EventAgent.DispatchEvent(ConstMessage.NOTICE_BATCH_TASK_STATE_CHANGE, new List<int> { taskId });
             EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
             var taskCfg = TaskCfgArray.Instance.GetCfg(response.Id);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/CreateRole/CreateRoleView.cs

@@ -49,7 +49,7 @@ namespace GFGGame
             this.clickBlankToClose = false;
             this.modal = true;
 
-            _ui.m_envelopeModel.m_loaBg.url = ResPathUtil.GetBgImgPath("bg_yaoqinghan");
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bg_yaoqinghan");
             _ui.m_envelopeModel.m_btnSure.onClick.Add(OnClickBtnSure);
             _ui.m_envelopeModel.m_btnDice.onClick.Add(() =>
             {

+ 27 - 0
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioBaseView.cs

@@ -14,6 +14,7 @@ namespace GFGGame
         private GTextField _txtTime;
         private GTextField _txtNum;
         private GButton _btnBuy;
+        private int _time = 0;
 
         protected StudioCfg _studioCfg;
         protected List<StoryLevelCfg> storyLevelCfgs;
@@ -79,6 +80,9 @@ namespace GFGGame
             // _valueBarController.Controller(1);
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gzs_bjbj");
 
+            //add by zyq
+            UpdateItem();
+
             UpdateView();
             Timers.inst.Add(1, 0, UpdateShowTime);
 
@@ -93,6 +97,8 @@ namespace GFGGame
             storyLevelCfgs = null;
             Timers.inst.Remove(UpdateShowTime);
 
+            Timers.inst.Remove(OnTimerUpdate);
+
         }
         protected override void RemoveEventListener()
         {
@@ -180,5 +186,26 @@ namespace GFGGame
         {
             ViewManager.Show<StudioBuyNumView>(this._studioCfg.limit);
         }
+
+        private void UpdateItem()
+        {
+            for (int i = 0; i < list.numChildren; i++)
+            {
+                list.GetChildAt(i).visible = false;
+            }
+            _time = 0;
+            Timers.inst.Add(0.2f, list.numChildren, OnTimerUpdate, 1);
+        }
+        private void OnTimerUpdate(object param)
+        {
+            list.GetChildAt(_time).visible = true;
+            UI_ListItem listItem = UI_ListItem.Proxy(list.GetChildAt(_time++));
+            //播放动效
+            if (listItem.m_test != null)
+            {
+                listItem.m_test.Play();
+            }
+            UI_ListItem.ProxyEnd();
+        }
     }
 }

+ 0 - 19
GameClient/Assets/Game/HotUpdate/Views/Studio/StudioFabricView.cs

@@ -8,7 +8,6 @@ namespace GFGGame
     //织物副本
     public class StudioFabricView : StudioBaseView
     {
-        private int _time = 0;
         public override void Dispose()
         {
             base.Dispose();
@@ -34,22 +33,12 @@ namespace GFGGame
             list.ScrollToView(curIndex);
             base.OnShown();
 
-            //add by zyq
-            for (int i = 0; i < list.numChildren; i++)
-            {
-                list.GetChildAt(i).visible = false;
-            }
-            _time = 0;
-            Timers.inst.Add(0.2f, list.numChildren, OnTimerUpdate, 1);
-
-           
 
         }
 
         protected override void OnHide()
         {
             base.OnHide(); 
-            Timers.inst.Remove(OnTimerUpdate);
         }
 
         private void OnClickBtnBack()
@@ -57,13 +46,5 @@ namespace GFGGame
             ViewManager.GoBackFrom(typeof(StudioFabricView).FullName);
         }
 
-        private void OnTimerUpdate(object param)
-        {
-            list.GetChildAt(_time).visible = true;
-            UI_ListItem listItem = UI_ListItem.Proxy(list.GetChildAt(_time++));
-            //播放动效
-            listItem.m_test.Play();
-            UI_ListItem.ProxyEnd();
-        }
     }
 }

BIN
GameClient/Assets/ResIn/UI/CreateRole/CreateRole_fui.bytes