public static async ETTask <Scene> Create(Entity parent, string name, SceneType sceneType) { long id = IdGenerater.GenerateId(); return(await Create(parent, id, parent.DomainZone(), name, sceneType)); }
public static async ETTask <Scene> Create(Entity parent, long id, int zone, string name, SceneType sceneType, StartSceneConfig startSceneConfig = null) { Scene scene = EntitySceneFactory.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.OuterPort}:{startSceneConfig.OuterPort}"); break; case SceneType.Gate: scene.AddComponent <NetOuterComponent, string>($"{startSceneConfig.OuterPort}:{startSceneConfig.OuterPort}"); scene.AddComponent <PlayerComponent>(); scene.AddComponent <GateSessionKeyComponent>(); break; case SceneType.Map: scene.AddComponent <UnitComponent>(); scene.AddComponent <PathfindingComponent>(); break; case SceneType.Location: scene.AddComponent <LocationComponent>(); break; } return(scene); }
public static async ETTask <Scene> Create(Entity parent, long id, string name, SceneType sceneType) { Scene scene = EntityFactory.CreateScene(id, name, sceneType); scene.Parent = parent; scene.AddComponent <MailBoxComponent, MailboxType>(MailboxType.UnOrderMessageDispatcher); switch (scene.SceneType) { case SceneType.Realm: break; case SceneType.Gate: scene.AddComponent <PlayerComponent>(); scene.AddComponent <GateSessionKeyComponent>(); break; case SceneType.Map: scene.AddComponent <UnitComponent>(); scene.AddComponent <PathfindingComponent>(); break; case SceneType.Location: scene.AddComponent <LocationComponent>(); break; } return(scene); }
public static async ETTask <Scene> Create(Entity parent, string name, SceneType sceneType) { return(await Create(parent, IdGenerater.GenerateSceneId(), name, sceneType)); }
public static async ETTask <Scene> Create(Entity parent, long id, string name, SceneType sceneType) { Scene scene = EntityFactory.CreateScene(id, name, sceneType); scene.Parent = parent; scene.AddComponent <MailBoxComponent, MailboxType>(MailboxType.UnOrderMessageDispatcher); switch (scene.SceneType) { case SceneType.Realm: break; case SceneType.Gate: scene.AddComponent <PlayerComponent>(); scene.AddComponent <GateSessionKeyComponent>(); break; case SceneType.Map: #if !BODY3D scene.AddComponent <Box2dWorldComponent>(); #else scene.AddComponent <BulletSharpWorldComponent>(); #endif scene.AddComponent <UnitComponent>(); scene.AddComponent <BulletComponent>(); scene.AddComponent <MonsterComponent>(); //CreateMonsters(scene); break; case SceneType.Location: scene.AddComponent <LocationComponent>(); break; } await ETTask.CompletedTask; return(scene); }