Bläddra i källkod

修改了开局流程:在摄像头卷动完成后显示“Start”按钮,点击按钮后才开始刷怪

大爷 1 år sedan
förälder
incheckning
26b9a3cb3d

BIN
Unity/Assets/Res/FGUI/HUD_atlas0.png


BIN
Unity/Assets/Res/FGUI/HUD_fui.bytes


+ 4 - 0
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/BattleMgr.cs

@@ -367,6 +367,10 @@ namespace ET
             {
                 var e = ev as ClientMsgEvent;
                 Log.Debug($">>>Battle client event: {e.Message}");
+                if(e.Message == BattleNotify.CameraOk.ToString() )
+                {
+                    EventSystem.Instance.Publish<CameraOkEvent>();
+                }
             });
             /*BubbleTalkEvent
             AddEffectEvent

+ 6 - 0
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/BattleMgr_Cmd.cs

@@ -30,6 +30,12 @@ namespace ET
             var session = PlayerComponent.Instance.ClientScene().GetComponent<SessionComponent>().Session;
             switch (a.FuncIndex)
             {
+                case (int)BattleFunc.FUNC.Start:
+                    session.Call(new C2G_BattleNotify()
+                    {
+                        Message = BattleNotify.StartRefreshMonster.ToString()
+                    }).Coroutine();
+                    break;
                 case (int)KeyCode.F1:
                     var units = new int[] { 101, 111, 121, 131 };
                     var centerpos = GetCurBattleCenter();

+ 2 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Scene/SceneChangeStart_AddComponent.cs

@@ -19,7 +19,6 @@ namespace ET.Client
             Log.Debug( $"scene({task.SceneObject.name}) load finished." );
 
             UIHelper.Remove( "Lobby" );
-            UIHelper.SetVisible( "Loading", false );
 
             await GameObjectPool.Instance.CacheSceneObject( mapInfo.Id );
             Log.Debug( $"cache scene object end." );
@@ -27,6 +26,8 @@ namespace ET.Client
             // 通知等待场景切换的协程
             EventSystem.Instance.Publish<EventType.SceneLoadFinish>();
             PlayerComponent.Instance.ClientScene().GetComponent<ObjectWait>().Notify( new Wait_SceneChangeFinish() );
+
+            UIHelper.SetVisible("Loading", false);
         }
     }
 }

+ 20 - 0
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/HUD/SceneChangeFinishEvent_CreateHUD.cs

@@ -135,6 +135,19 @@ namespace ET.Client
         }
     }
 
+    [Event]
+    public class CameraOkHandler : BEvent<CameraOkEvent>
+    {
+        protected override async ETTask OnEvent(CameraOkEvent a)
+        {
+            var view = UIHelper.GetUI("HUD") as GComponent;
+            view.GetChild("btn_start").visible = true;
+
+            await ETTask.CompletedTask;
+        }
+    }
+    
+
     public static class HUDMgr
     {
         public static void InitView(GComponent view)
@@ -199,6 +212,13 @@ namespace ET.Client
             txthp1.text = "";
             var txthp2 = progress2.GetChild("title");
             txthp2.text = "";
+
+            var btn = view.GetChild("btn_start");
+            btn.visible = false;
+            btn.onClick.Set( () => {
+                btn.visible = false;
+                EventSystem.Instance.Publish(BattleFunc.Static.Clone((int)BattleFunc.FUNC.Start));
+            });
         }
     }
 }

+ 5 - 0
Unity/Assets/Scripts/Codes/Model/Client/EventTypeClient.cs

@@ -156,6 +156,10 @@ namespace ET
         }
         public class BattleFunc
         {
+            public enum FUNC
+            {
+                Start = 1001,
+            }
             public int FuncIndex;
             public static BattleFunc Static = new();
             public BattleFunc Clone(int index)
@@ -255,6 +259,7 @@ namespace ET
                 return this;
             }
         }
+        public class CameraOkEvent { }
     }
 
     //状态指令

+ 2 - 1
Unity/Assets/Scripts/Codes/Model/Share/Const/ConstValue.cs

@@ -18,7 +18,8 @@
     public enum BattleNotify
     {
         ClientIsReady,
-
+        StartRefreshMonster,
+        CameraOk,
     }
 }