Jelajahi Sumber

修复创建多个机器人instanceId重复的问题

tanghai 4 tahun lalu
induk
melakukan
5d71fbf010
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      Unity/Codes/Hotfix/Demo/Scene/SceneFactory.cs

+ 1 - 1
Unity/Codes/Hotfix/Demo/Scene/SceneFactory.cs

@@ -17,7 +17,7 @@ namespace ET
         
         
         public static Scene CreateCurrentScene(long id, int zone, string name, CurrentScenesComponent currentScenesComponent)
         public static Scene CreateCurrentScene(long id, int zone, string name, CurrentScenesComponent currentScenesComponent)
         {
         {
-            Scene currentScene = EntitySceneFactory.CreateScene(id, zone, SceneType.Current, name, currentScenesComponent);
+            Scene currentScene = EntitySceneFactory.CreateScene(id, IdGenerater.Instance.GenerateInstanceId(), zone, SceneType.Current, name, currentScenesComponent);
             currentScenesComponent.Scene = currentScene;
             currentScenesComponent.Scene = currentScene;
             
             
             Game.EventSystem.Publish(new EventType.AfterCreateCurrentScene() {CurrentScene = currentScene});
             Game.EventSystem.Publish(new EventType.AfterCreateCurrentScene() {CurrentScene = currentScene});