public override void EndInit() { foreach (StartSceneConfig startSceneConfig in this.GetAll().Values) { this.ProcessScenes.Add(startSceneConfig.Process, startSceneConfig); if (!this.ZoneScenesByName.ContainsKey(startSceneConfig.Zone)) { this.ZoneScenesByName.Add(startSceneConfig.Zone, new Dictionary <string, StartSceneConfig>()); } this.ZoneScenesByName[startSceneConfig.Zone].Add(startSceneConfig.Name, startSceneConfig); switch (startSceneConfig.Type) { case SceneType.Gate: this.Gates.Add(startSceneConfig.Zone, startSceneConfig); break; case SceneType.Location: this.LocationConfig = startSceneConfig; break; } } }
public static async ETTask <Scene> Create(Entity parent, long id, int zone, string name, SceneType sceneType, StartSceneConfig startSceneConfig = null) { Scene scene = CreateScene(id, zone, sceneType, name); scene.Parent = parent; scene.AddComponent <MailBoxComponent, MailboxType>(MailboxType.UnOrderMessageDispatcher); switch (scene.SceneType) { case SceneType.Realm: scene.AddComponent <NetOuterComponent, string>(startSceneConfig.OuterAddress); break; case SceneType.Gate: scene.AddComponent <NetOuterComponent, string>(startSceneConfig.OuterAddress); scene.AddComponent <PlayerComponent>(); scene.AddComponent <GateSessionKeyComponent>(); break; case SceneType.Map: scene.AddComponent <UnitComponent>(); break; case SceneType.Location: scene.AddComponent <LocationComponent>(); break; } return(scene); }