소스 검색

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

tanghai 4 년 전
부모
커밋
5d71fbf010
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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});