Pārlūkot izejas kodu

修复demo中创建zone场景id为0的bug (#212)

* 修改id为0的bug
wryl 5 gadi atpakaļ
vecāks
revīzija
43a848736e

+ 1 - 1
Unity/Assets/Hotfix/Unit/M2C_CreateUnitsHandler.cs

@@ -8,7 +8,7 @@ namespace ET
 	{
 		protected override async ETTask Run(Session session, M2C_CreateUnits message)
 		{	
-			UnitComponent unitComponent = Game.Scene.Get(0).GetComponent<UnitComponent>();
+			UnitComponent unitComponent = Game.Scene.Get(1).GetComponent<UnitComponent>();
 			
 			foreach (UnitInfo unitInfo in message.Units)
 			{

+ 2 - 2
Unity/Assets/Hotfix/Unit/UnitFactory.cs

@@ -12,9 +12,9 @@ namespace ET
 
 	        Game.EventSystem.Publish(new EventType.AfterUnitCreate() {Unit = unit});
 	        
-	        UnitComponent unitComponent = Game.Scene.Get(0).GetComponent<UnitComponent>();
+	        UnitComponent unitComponent = Game.Scene.Get(1).GetComponent<UnitComponent>();
             unitComponent.Add(unit);
             return unit;
         }
     }
-}
+}

+ 2 - 2
Unity/Assets/HotfixView/AppStart_Init.cs

@@ -23,9 +23,9 @@ namespace ET
 
             ResourcesComponent.Instance.LoadBundle("unit.unity3d");
 
-            Scene zoneScene = await SceneFactory.CreateZoneScene(0, 0, "Game");
+            Scene zoneScene = await SceneFactory.CreateZoneScene(1, 1, "Game");
 
             await Game.EventSystem.Publish(new EventType.AppStartInitFinish() { ZoneScene = zoneScene });
         }
     }
-}
+}

+ 1 - 1
Unity/Assets/HotfixView/UI/UILobby/EnterMapFinish_RemoveLobbyUI.cs

@@ -11,7 +11,7 @@
 			{
 				await sceneChangeComponent.ChangeSceneAsync("Map");
 			}
-            Game.Scene.Get(0).AddComponent<OperaComponent>();
+            Game.Scene.Get(1).AddComponent<OperaComponent>();
             await UIHelper.Remove(args.ZoneScene, UIType.UILobby);
 		}
 	}