Sfoglia il codice sorgente

删除所有ET unit相关

大爷 2 anni fa
parent
commit
e9a01def40

+ 1 - 1
Unity/Assets/Scripts/Codes/Hotfix/Client/Login/EnterMapHelper.cs

@@ -11,7 +11,7 @@ namespace ET.Client
             {
                 var param = new C2G_EnterMap() { MapName = mapName };
                 G2C_EnterMap g2CEnterMap = await clientScene.GetComponent<SessionComponent>().Session.Call(param) as G2C_EnterMap;
-                clientScene.GetComponent<PlayerComponent>().MyId = g2CEnterMap.MyId;
+                //clientScene.GetComponent<PlayerComponent>().MyId = g2CEnterMap.MyId;
                 
                 // 等待场景切换完成
                 //await clientScene.GetComponent<ObjectWait>().Wait<Wait_SceneChangeFinish>();

+ 3 - 3
Unity/Assets/Scripts/Codes/Hotfix/Client/Login/LoginHelper.cs

@@ -55,10 +55,10 @@ namespace ET.Client
                 var accountComponet = clientScene.AddComponent<AccountInfoComponent>();
                 accountComponet.Token = r2CLogin.Token;
                 accountComponet.UserId = r2CLogin.UserId;
+                Log.Debug($"登陆gate成功...token={r2CLogin.Token}, userId={r2CLogin.UserId}");
 
-                var player = g2CLoginGate.Player;
-                Log.Debug($"登陆gate成功...token={r2CLogin.Token}, userId={r2CLogin.UserId}, playerId={player.id}");
-
+                //var player = g2CLoginGate.Players[0];
+                //TODO:选角进入
                 await EventSystem.Instance.PublishAsync(clientScene, new EventType.LoginFinish());
             }
             catch (Exception e)

+ 3 - 2
Unity/Assets/Scripts/Codes/Hotfix/Client/Move/M2C_PathfindingResultHandler.cs

@@ -7,11 +7,12 @@ namespace ET.Client
 	{
 		protected override async ETTask Run(Session session, M2C_PathfindingResult message)
 		{
-			Unit unit = session.DomainScene().CurrentScene().GetComponent<UnitComponent>().Get(message.Id);
+            /*Unit unit = session.DomainScene().CurrentScene().GetComponent<UnitComponent>().Get(message.Id);
 
 			float speed = unit.GetComponent<NumericComponent>().GetAsFloat(NumericType.Speed);
 
-			await unit.GetComponent<MoveComponent>().MoveToAsync(message.Points, speed);
+			await unit.GetComponent<MoveComponent>().MoveToAsync(message.Points, speed);*/
+            await ETTask.CompletedTask;
 		}
 	}
 }

+ 2 - 2
Unity/Assets/Scripts/Codes/Hotfix/Client/Move/M2C_StopHandler.cs

@@ -7,7 +7,7 @@ namespace ET.Client
 	{
 		protected override async ETTask Run(Session session, M2C_Stop message)
 		{
-			Unit unit = session.DomainScene().CurrentScene().GetComponent<UnitComponent>().Get(message.Id);
+			/*Unit unit = session.DomainScene().CurrentScene().GetComponent<UnitComponent>().Get(message.Id);
 			if (unit == null)
 			{
 				return;
@@ -17,7 +17,7 @@ namespace ET.Client
 			moveComponent.Stop(message.Error == 0);
 			unit.Position = message.Position;
 			unit.Rotation = message.Rotation;
-			unit.GetComponent<ObjectWait>()?.Notify(new Wait_UnitStop() {Error = message.Error});
+			unit.GetComponent<ObjectWait>()?.Notify(new Wait_UnitStop() {Error = message.Error});*/
 			await ETTask.CompletedTask;
 		}
 	}

+ 2 - 9
Unity/Assets/Scripts/Codes/Hotfix/Client/Scene/SceneChangeHelper.cs

@@ -10,19 +10,12 @@
             CurrentScenesComponent currentScenesComponent = clientScene.GetComponent<CurrentScenesComponent>();
             currentScenesComponent.Scene?.Dispose(); // 删除之前的CurrentScene,创建新的
             Scene currentScene = SceneFactory.CreateCurrentScene(sceneInstanceId, clientScene.Zone, sceneName, currentScenesComponent);
-            UnitComponent unitComponent = currentScene.AddComponent<UnitComponent>();
          
             // 可以订阅这个事件中创建Loading界面
             EventSystem.Instance.Publish(clientScene, new EventType.SceneChangeStart());
-
-            // 等待CreateMyUnit的消息
-            Wait_CreateMyUnit waitCreateMyUnit = await clientScene.GetComponent<ObjectWait>().Wait<Wait_CreateMyUnit>();
-            M2C_CreateMyUnit m2CCreateMyUnit = waitCreateMyUnit.Message;
-            var unit = UnitFactory.Create(currentScene, m2CCreateMyUnit.Unit, true);
-            unitComponent.MyUnitId = unit.Id;
-
-            clientScene.RemoveComponent<AIComponent>();
             clientScene.GetComponent<ObjectWait>().Notify(new Wait_SceneChangeFinish());
+
+            await ETTask.CompletedTask;
         }
     }
 }

+ 3 - 3
Unity/Assets/Scripts/Codes/HotfixView/Client/Global/GlobalComponentSystem.cs

@@ -3,11 +3,11 @@ using UnityEngine;
 namespace ET.Client
 {
     [ObjectSystem]
-    public class GlobalComponentAwakeSystem : AwakeSystem<GlobalComponent>
+    public class GlobalComponentAwakeSystem : AwakeSystem<GlobalViewComponent>
     {
-        protected override void Awake(GlobalComponent self)
+        protected override void Awake(GlobalViewComponent self)
         {
-            GlobalComponent.Instance = self;
+            GlobalViewComponent.Instance = self;
 
             self.Global = GameObject.Find("/Global").transform;
             self.Unit = GameObject.Find("/Global/Unit").transform;

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

@@ -1,4 +1,4 @@
-namespace ET.Client
+/*namespace ET.Client
 {
     [Event(SceneType.Client)]
     public class AfterCreateClientScene_AddComponent: AEvent<EventType.AfterCreateClientScene>
@@ -11,4 +11,4 @@ namespace ET.Client
             await ETTask.CompletedTask;
         }
     }
-}
+}*/

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

@@ -16,22 +16,22 @@ namespace ET.Client
         {
             var img = view.GetChild("img_direction");
             view.GetChild("btn_skill1").onClick.Add(() => {
-                Scene currentScene = scene.GetComponent<CurrentScenesComponent>().Scene;
+                /*Scene currentScene = scene.GetComponent<CurrentScenesComponent>().Scene;
                 var component = currentScene.GetComponent<UnitComponent>();
                 var actor = component.GetChild<Unit>(component.MyUnitId);
                 if(actor != null)
                 {
                     actor.GetComponent<AnimatorComponent>().AppendCommand(AnimatorComponent.CommandType.Skill0);
-                }
+                }*/
             });
             view.GetChild("btn_skill2").onClick.Add(() => {
-                Scene currentScene = scene.GetComponent<CurrentScenesComponent>().Scene;
+                /*Scene currentScene = scene.GetComponent<CurrentScenesComponent>().Scene;
                 var component = currentScene.GetComponent<UnitComponent>();
                 var actor = component.GetChild<Unit>(component.MyUnitId);
                 if (actor != null)
                 {
                     actor.GetComponent<AnimatorComponent>().AppendCommand(AnimatorComponent.CommandType.Skill1);
-                }
+                }*/
             });
         }
     }

+ 2 - 5
Unity/Assets/Scripts/Codes/Model/Share/EventType.cs

@@ -1,4 +1,5 @@
-namespace ET
+
+namespace ET
 {
     namespace EventType
     {
@@ -10,9 +11,5 @@
         public struct AppStartInitFinish { }
         public struct LoginFinish { }
         public struct EnterMapFinish { }
-        public struct AfterUnitCreate
-        {
-            public Unit Unit;
-        }
     }
 }

+ 0 - 10
Unity/Assets/Scripts/Codes/ModelView/Client/Unit/GameObjectComponent.cs

@@ -1,10 +0,0 @@
-using UnityEngine;
-
-namespace ET.Client
-{
-    [ComponentOf(typeof(Unit))]
-    public class GameObjectComponent: Entity, IAwake, IDestroy
-    {
-        public GameObject GameObject { get; set; }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/ModelView/Client/Unit/GameObjectComponent.cs.meta

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